Collaboration: The Key to Creativity for Mother Artists

Collaboration: The Key to Creativity for Mother Artists

Collaboration is Key

Mothers Institute for Collaboration and Art (MICA) is screaming for collaboration. Collaborating is invaluable for artists for innovation, creativity, and community. As we know, parents who are artists have unique circumstances; the caretaking of children takes up your time, to be blunt. When you become a parent, suddenly, you’re responsible for the well-being and future of a vulnerable human life. For most parents, this means you’re looking at the world from a different lens.

Heck, you’ve got neuroplasticity changing up your brain. It also means that whatever life you had created now needs to fit kids into it. So, if you’re an artist, well, finding time to create is even more precious than before.

Balancing the Two Sides of Parent Artists

Getting out of the caretaker’s head and into the artist’s head can be challenging. However, as artists, we must! The world depends on us. Listen, we know collaboration has long been a thing of art, and now, other industries have caught on. By the way, the Washington Post article linked talks about the five things Gen Z wants in the workplace:

1.  Customized career paths,

2.  Constant opportunities to learn,

3.  Purpose-driven work,

4.  Flexible work arrangements,

5.  Collaborative environments.

Hello? That is exactly what (Gen X) MICA founder Lyza Fennell is all about. Collaborating on projects can be particularly advantageous for parents to balance their creative practice with parenting responsibilities.  Finding time to create is a major challenge for parents, with all the obligations that come with parenting today.

The Benefits of Collaboration for Mother Artists

The benefits of collaboration are numerous! Here are a few ways to consider how it can help:

      • Providing support and community: artists can feel isolated and alone in their creative journey. Collaboration can give them a supportive community of fellow artists who understand their challenges.  Sometimes isolation is good, but not always.
      • Reducing time commitments: collaborating with others can help reduce your workload and save time for other important tasks. This is especially helpful if you have limited time to create art.
      • Expanding creative possibilities: Collaboration can help mother artists expand their creative possibilities. By bringing in new ideas and perspectives from other artists, you can push the boundaries of your art and create something truly innovative.

In other words, collaboration is a valuable approach that offers several benefits and serves as a support system for artist parents. By working together, these talented individuals can share ideas, resources, and experiences, which can help them overcome the challenges of balancing their creative pursuits and parental responsibilities. Therefore, this collaborative approach can also create a more inclusive environment within the arts community, where everyone can feel supported and empowered to pursue their passions.

Group of women standing and listening enthusiastically.

The Pathway to Collaboration

Time is precious when you are a parent and artist. There are so many demands on your time, and finding the time to create art can be hard. But collaboration can be a pathway to making art even when you’re busy.

Collaboration can help parent artists overcome the challenges of balancing their creative practice with parenting responsibilities in several ways. For example, collaboration can:

      • Overcoming creative blocks: Sometimes, mother artists can get stuck in a creative rut. Collaboration can help them break out of this rut by giving them new ideas and perspectives.
      • Learning new skills: Collaboration can be a great way to learn new skills from other artists. This can help mother artists grow as artists and create even more amazing work.
      • Building a network: Collaboration can help mother artists build their network of contacts in the art world. This can lead to more opportunities to exhibit and sell their art.

In other words, it is a powerful tool to help artists who are parents overcome the challenges of balancing their creative practice with parenting responsibilities. It’s a great way to gain support and community, reduce time commitments, expand creative possibilities, overcome creative blocks, learn new skills, and build your network.

inspiration, teamwork, collaboration, success, trust

Types of Collaboration

On-site collaboration: On-site collaborations such as artist residencies and workshops offer a hands-on experience. These immersive programs provide a unique opportunity to work closely with other artists, learn new techniques, and gain inspiration.

Virtual collaboration: In today’s digital age, virtual collaboration is growing increasingly popular. Online platforms allow you to connect with artists from around the world. You could collaborate on a digital art project, host a virtual workshop, or organize an online art exhibition.

Collaboration: A Catalyst for Innovation

Collaboration can be a catalyst for innovation. Individuals can pool their diverse perspectives, experiences, and expertise by working together to generate new and creative ideas, such as a group of artists with different backgrounds and skills could collaborate on a project to create a new form of art that combines elements of different disciplines.

Here are some specific examples of how collaboration can benefit mother artists:

Workshopping: Workshops can be a great way for mother artists to learn new skills, share ideas, and get feedback from other artists.

Critique groups: Critique groups can be a supportive and constructive way for mother artists to get feedback on their work.

Weekly meetings: Weekly meetings with other mother artists can provide a much-needed support system and accountability for them trying to balance their creative practice with their parenting responsibilities.

Successful forms of collaboration can lead to a more dynamic and productive environment where different voices and opinions are valued and leveraged for the greater good.

Ultimately, the power of collaboration lies in its ability to bring people together, fostering a sense of community and shared purpose that can drive real change and progress.

Finding the Right Collaborators

Finding the right collaborator can be daunting, but it’s essential for mother artists who want to collaborate effectively. Finding people who share your artistic vision and goals is important when looking for collaborators. You also want to find people who are reliable, hardworking, and easy to get along with.

Here are a few tips for finding the right collaborators:

      • Attend art events and join art organizations. This is a great way to meet other artists and learn about their work.
      • Reach out to artists whose work you admire. Send them a message or email and introduce yourself.
      • Look for collaborators online. There are many websites and online forums where artists can connect with each other.

Once you’ve found a few potential collaborators, getting to know them better is important. Meet up with them in person and talk about your work. This will help you to see if you’re a good fit for each other.

Here are a few questions you can ask potential collaborators:

      • What are your artistic goals?
      • What are your strengths and weaknesses as an artist?
      • What are you looking for in a collaborator?
      • How do you like to work?

If you find that you have a good rapport with a potential collaborator and share similar goals, you’re well on your way to a successful collaboration.

Social media platforms like Instagram or Facebook can also be useful tools to connect with other artists around the globe. You can search for hashtags related to your art form or interests and likely find other artists using those hashtags. You can also join groups on social media for artists; this is a great way to connect with other artists interested in collaborating.

five women meeting inside at table

Balancing Artistic Endeavors and Parenting

Juggling your artistic pursuits with motherhood can be challenging but not impossible. Here are a few tips for balancing these two important parts of your life:

      • Set boundaries. It’s important to set boundaries between your artistic and parenting time. This means setting aside specific times each day or week for your art and sticking to those times as much as possible. It also means not letting your parenting responsibilities seep into your artistic time and vice versa.
      • Manage your time effectively. This is essential for any busy parent, but it’s especially important for mother artists who want to make time for their art. Several time management techniques, such as batching tasks and using a planner, can be helpful.
      • Ask for help. Don’t be afraid to ask for help from your partner, family, and friends. This can free up some of your time to focus on your art.

In this way, collaboration can help, as shared projects can divide the workload and offer mutual support. Find other mother artists who are also passionate about their art and work on projects together. This can be a great way to get support and feedback, and it can also help you to stay motivated.

Want to Collaborate with Non-Artists?

Artists and non-artists can benefit greatly from collaboration. Artists can bring their creativity and vision to the table, while non-artists can provide expertise in other types of new technologies, processes, and fields of knowledge. This can lead to innovative and exciting new art that would not be possible without collaboration.

Here are some examples of how artists can collaborate with non-artists:

      • With technologists and scientists: Artists can collaborate with technologists and scientists to create new and engaging art that uses cutting-edge technology. This could involve creating interactive installations, virtual reality experiences, or augmented reality artworks.
      • With educators: Artists can collaborate with educators to create new and engaging art education programs. This could involve developing a new curriculum, leading workshops, or creating interactive art installations.
      • With community organizers: Artists can collaborate with community organizers to create art addressing social and environmental issues. This could involve creating murals, public art installations, or theater productions.
      • With businesses: Artists can collaborate with businesses to create art promoting their products or services. This could involve designing logos, creating marketing materials, or developing interactive exhibits.

There are many other possibilities for collaboration between artists and non-artists. The key is to be open to new ideas and to think outside the box. By collaborating with others, artists can have a greater impact on the world and make a difference in the lives of others.

group shot artist moms and kids

Where Do You Find the Collaborators?

Collaboration is essential for mother artists who want to take their art to the next level. By collaborating with other artists, mother artists can share ideas, learn new skills, and get feedback on their work. They can also build a community of support and accountability.

There are many places where mother artists can find collaborators. Here are a few suggestions:

        • Online communities: There are many online communities where mother artists can connect with each other and find potential collaborators. Some popular online communities include Meetup, Facebook groups, and Twitter.
        • Conferences and workshops: Attending conferences and workshops that bring together professionals from various fields is an excellent way to network with potential collaborators and stay current on the latest technologies and trends.
        • Reach out to local organizations: Many local organizations support collaboration between artists. Reaching out to these organizations is a great way to find collaborators in your area.

Finding collaborators can be daunting, but it’s essential for mother artists who want to collaborate effectively. Mother artists can find collaborators who share their artistic vision and goals by following the tips in this section.

It's Time to Get Out There and Collaborate

Collaborating with other artists can greatly enhance your artistic practice. It can broaden your creative range, expose you to different styles and techniques, and provide a platform to share and exchange ideas.

Moreover, it can help you build a network of like-minded individuals who can provide support, feedback, and encouragement.

Remember, your creativity does not have to be a solitary journey. Collaboration can open doors to new possibilities and experiences.

So, step out, reach out, and embrace the power of working together. Your art, your passion, and your creative journey deserve it.

Artist moms, are you ready to take your creativity to the next level? Collaboration is the key to unlocking new ideas, expanding your artistic horizons, and building a supportive community. Comment below, tell us what you’re thinking about or your experiences with collaborations.

Want to Join our Collaborative in Northampton, MA?

Email us or comment below today!

Sources:

“Future World-building Depends on Artists and Collaborative Networks” By Kamal Sinclair; National Endowment for the Arts.

Have an event? Share it on our events calendar!

Breaking Barriers: How to Create a More Inclusive Art World for Women and Moms

Breaking Barriers: How to Create a More Inclusive Art World for Women and Moms

The Challenges Facing Women and Moms in the Art World

Women and mothers in the arts have long faced systemic barriers that have prevented them from thriving. These barriers include inadequate access to affordable childcare, gender bias, time constraints, and isolation.

Addressing these obstacles with urgency and determination is imperative to achieve significant progress toward a truly inclusive and equitable art community. We must push for change now.

Here are some specific actions we can take:

      • Increase access to affordable childcare. This will allow mothers to have more time to create art without worrying about their children.
      • Challenge gender stereotypes in the art world. This will help to ensure that women’s work is seen and recognized.
      • Provide flexible work arrangements for mothers. This will allow mothers to balance their artistic careers with their family responsibilities.
      • Create opportunities for mothers to connect with each other. This will help to combat isolation and create a sense of community.

These actions allow us to cultivate an art world that empowers and supports women and mothers. Their voices will be heard, and their work will be showcased, allowing for a more diverse and dynamic art scene that accurately represents our society’s richness.

Increase Representation in Leadership

To achieve greater gender parity in the arts, it is crucial to ensure that women have equal opportunities for leadership positions. This can be accomplished by nominating more women for these roles, providing mentorship and training programs, and offering flexible work arrangements that allow women to balance their careers with family responsibilities. By promoting women into leadership positions, we can bring a wider range of perspectives to the table, leading to a more diverse and inclusive art community.

We were so pleased that for our inaugural opening night gala, we had two mothers in government attend. And the current mayor of Northampton, MA, Gina-Louise Sciarra, is a mother. Heck, 2021 brought us our first woman, and mother, to hold the office of Vice President with Kamala Harris, the highest-ranking mom ever in US history.

This is just the beginning. It is essential to ensure equal access for women and mothers to the arts. They deserve the same opportunities as men and should be included in all discussions. This way, we can create a just and inclusive art world that benefits everyone.

The Future of the Art World

The art world is at a crossroads. We can either continue to discriminate against mothers or create a more inclusive and equitable environment for all artists, regardless of their parental status. The future of the art world depends on the choices we make today.

Establishing a more inclusive and fair art world for women and mothers requires collaboration from everyone. We must increase the representation of women in leadership positions, advocate for policies that support working mothers, challenge gender stereotypes, and support organizations that promote equity. By taking these steps, we can gradually create a level playing field for women in the arts, enabling them to express their artistic abilities without barriers. As we strive for a more inclusive and elevated perspective in society, let’s not forget the immense contribution of mother artists to the creative world. We should celebrate and embrace their talents in all aspects of the art world.

Three women mean business

Advocate for Policies that Support Working Moms

Mothers disproportionately shoulder the unpaid labor of parenting. A 2020 New York Times Opinion piece estimated that women’s unpaid labor is worth $10.9 trillion worldwide.

Balancing motherhood and a career is challenging for many mothers. It can be even more daunting in the arts, where jobs often come with long hours and unpredictable schedules. However, we can make it easier for mothers in the arts to maintain their careers while raising a family by advocating for policies like paid parental leave, affordable childcare, and flexible work arrangements. That’s where women-friendly government officials can help.

Challenge Gender Stereotypes

Gender stereotypes continue to permeate the art world, resulting in a lack of recognition and opportunities for women. It’s crucial to commission more works from female artists, showcase more women artists in exhibitions and performances, and give female artists more chances to discuss their experiences as both artists and mothers. Event organizers, exhibition curators, and award panels must be held accountable for promoting diverse artists. It’s time to take action and put an end to this injustice.

Mom teaching girl to paint on canvas

Support Organizations Promoting Equity

Many organizations are working to create a more equitable art world. Supporting them can help to bridge the gap.

The Geena Davis Institute on Gender in Media is a non-profit organization dedicated to improving the representation of girls and women in media. Founded by Academy Award-winning actor Geena Davis, the organization works to make gender equality in film and television a reality through research, education, and advocacy.

The institute has conducted groundbreaking research that has revealed the extent to which gender stereotypes are perpetuated in media. For example, the institute found that women are underrepresented in leading roles in film and television, and when they are represented, they are often depicted in stereotypical ways.

The institute also provides educational materials and resources for teachers, parents, and media professionals who want to make a difference in this space. These materials can help people to understand the importance of gender equality in media and how they can work to challenge gender stereotypes.

In addition to the Geena Davis Institute on Gender in Media, many other organizations are working to promote equality for women in the art world. These organizations include WomenArts, the National Women’s Law Center, MomsRising, Moms F1rst, Parent Artist Advocacy League for Performing Arts + Media, and Mothers Institute for Collaboration and Art.

To truly empower mothers and women in their creative endeavors, it is imperative that we throw our support behind organizations that actively challenge gender inequality within the art world. By doing so, we can help facilitate increased funding and the implementation of policies that directly benefit women and their pursuit of artistic excellence.

The Future of the Art World Depends on It

Acknowledging the numerous obstacles mothers face in the creative arts is imperative. Sadly, these women’s individual experiences often go unnoticed. However, we possess the ability to rectify this. By investing in the futures of women and mothers, we can establish a supportive and uplifting art world that facilitates everyone in realizing their complete potential. This is a critical step towards securing the future of the art world.

The art world reflects the larger society, and we must continue to strive for equity and inclusion. Women and mothers are essential to any creative field and should be respected, valued, and celebrated.

By recognizing our shared responsibility to create a more equitable future for all artists, regardless of gender or parental status, we can create the conditions for a more diverse and vibrant art world. It is imperative that we prioritize inclusivity and equity in the art world to create equal opportunities for all to pursue their dreams and create meaningful work.  The necessary support and empowerment to mothers in the art world should not be ignored. The future of the art world depends on it.

The Importance of Supporting Mother Artists

It is widely recognized that women have made significant contributions to the arts despite their obstacles. It is also acknowledged that balancing a family and career can be difficult today. Our society has evolved, with many families having two working parents or being headed by a single parent. That said, it is clear that we are not providing enough support for families as a whole.

It is time that we recognize the incredible contribution of mother artists worldwide. From painters to musicians, writers to filmmakers, moms are making their mark in the creative world, and it is time for us to celebrate their achievements.

Many women artists have also acknowledged that they had to choose between a career or a family. And we know not everyone wants to be a mother, but those who are both mothers and artists, need unique support.

By supporting organizations that aim to support women and mothers as artists, we can help ensure that mother artists get access to the resources they need to continue creating and pushing boundaries in the arts. Recognizing and respecting the unique perspectives of mothers is absolutely essential. It is imperative to create an environment that is inclusive and values the opinions of all.

Only then can we truly create an equitable future for everyone in the creative world. Here are some specific things that we can do to support mother artists:

      • Advocate for more representation of women in leadership positions in the creative industries.
      • Support organizations that provide support and resources for women in art.
      • Buy art by mother artists.
      • Speak out against gender discrimination in the art world.

The creative world has long been male-dominated, but mother artists are breaking down these barriers and making their mark. Their work is often underrepresented in the art world, but it is essential that we recognize and celebrate their contributions.

By supporting mother artists, we can help to create a more inclusive and equitable art world for all. We can also help to ensure that mothers’ voices are heard, and their perspectives are valued.

Challenges Faced by Women and Moms in the Art World

Many women and mothers continue to encounter various obstacles in the art world that hinder their potential for success. One of these challenges is the need for adequate representation of women in leadership roles in the creative industries. Even though women constitute a substantial portion of individuals involved in art and its production, they occupy less than a quarter of top creative positions. Several factors, such as gender discrimination and unconscious bias, cause this inequality.

Balancing childcare and household responsibilities with an art career can be challenging for freelance and contractor mothers. It’s important to advocate for more opportunities in the art world for women and mothers, as this can bring fresh perspectives and ideas to the field.

woman-looking-at-camera-holding-banner-activists

The Financial Challenges of Being a Female Creative

Economic Barriers

Economic barriers can be a major roadblock for many female creatives. Due to institutional bias and discrimination, many female and mom-owned creative businesses that seek investment capital or funding from traditional sources need help. We must continue to strive towards creating an equitable economic environment where all artists are supported financially so that they can thrive.

Creating an Equitable Future

To create an equitable future for all women and mothers in the creative world, we must continue to support access to resources and funding for female creatives, recognize the unique perspectives and issues that mothers encounter, and create an environment where their voices are heard and valued.

With more awareness and action on these issues, we can continue celebrating the powerful work of female creatives throughout history and create a more inclusive and equitable future for all women in the creative industries.

The Art World's Mother Problem

The art world has a long history of discriminating against mothers. In the early 20th century, the avant-gardes viewed domesticity as a drag, and women artists who became mothers were often judged harshly. Even today, mothers in the art world face significant challenges, such as a lack of childcare options, a bias toward youth, and the expectation that they will have to choose between motherhood and a successful career.

These challenges have a real impact on women’s careers in the art world. A recent study by the Freelands Foundation found that only 32% of artists represented by London’s leading galleries are female. This suggests that motherhood is a significant barrier to women’s success in the art world.

There are several things that can be done to address this problem. First, we need to challenge the stereotypes that surround motherhood. Mothers are just as creative and committed to their work as non-mothers. Second, we must provide more support for working parents in art. This could include things like on-site childcare, flexible work arrangements, and paid parental leave.

Finally, we must change how we think about motherhood and work. Motherhood should not be seen as a liability but rather as an asset. Mothers bring a unique perspective and skills to the workplace and should be valued for their contributions.

mom with three kids sitting on couch cuddled together

How You Can Help Create a More Equitable Art World for Women and Moms

The art world is at a crossroads. We can either continue to discriminate against mothers or create a more inclusive and equitable environment for all artists, regardless of their parental status. The future of the art world depends on the choices we make today.

Here are some specific things you can do to help:

      • Support organizations that are working to promote equity for women and mothers in the arts. These organizations are on the frontlines of the fight for change, and your support can make a real difference.
      • Advocate for policies that support working moms. This includes paid parental leave, affordable childcare, and flexible work arrangements. When moms have the support they need, they can be more successful in their careers and in their art.
      • Challenge gender stereotypes in the art world. When we see mothers as artists, we challenge the idea that motherhood is a liability. We also open up new possibilities for women and moms to pursue their creative dreams.
      • Commission works by women artists. When you commission a work by a woman artist, you are sending a message that you value their work and their contributions to the art world.
      • Feature more women artists in exhibitions and performances. When you feature women artists in exhibitions and performances, you are helping to increase their visibility and reach.
      • Provide opportunities for female artists to discuss their experiences as artists and moms. When you give female artists a platform to share their stories, you are helping to break down the barriers that prevent them from succeeding.
      • Hold event organizers, exhibition curators, and award panels accountable. Ask them to explain their selection criteria and ensure their lineups are diverse. When you hold these gatekeepers accountable, you are helping to create a more equitable art world for all.

Final Thoughts

Before you go…

      • Your voice matters. When you speak up about the challenges facing women and moms in the art world, you are helping to raise awareness and create change.
      • Don’t be afraid to get involved. There are many ways to get involved in the fight for equity in the art world. Find an organization that aligns with your values, and get started today.
      • Celebrate the work of women and moms in the arts. When you see the work of a woman artist, take a moment to appreciate their talent and contributions to the art world.

Recognizing and honoring the invaluable contributions of mother artists to the creative world is crucial as we aim to cultivate a more inclusive and elevated societal perspective. These exceptional talents deserve to be celebrated and seamlessly integrated into every facet of the creative arts.

The world of art mirrors our society. To build a more just and inclusive society, we need to begin by fostering a more just and inclusive art world. One way we can achieve this is by supporting mothers who are artists and by challenging preconceived notions regarding motherhood. By working together, we can establish a more equitable art world that embraces women and mothers.

Sources:

Judah, Hettie. How Not to Exclude Artist Mothers (and Other Parents) (Hot Topics in the Art World) (pp. 13-16). Lund Humphries. Kindle Edition. 

Have an event? Share it on our events calendar!

Open Mic Nights as a Tool for Performing Artist Moms

Open Mic Nights as a Tool for Performing Artist Moms

Finding the balance between your passions and responsibilities can be challenging with the demands of motherhood, family life, and career goals. However, it’s crucial to keep exploring new opportunities and expanding your artistic reach. Open mic nights offer a unique opportunity to showcase your talents, meet new people, and grow your network.  These events allow artists of all skill levels to showcase their talents and receive audience feedback. This post will explore how you can navigate open mic nights as a mother/parent, from selecting appropriate material to building connections with other performers and venue owners. We’ll also discuss the positive impact of participating in open mics on your skills and career as a performing artist.

Research and Preparation

Before you dive into open mic nights, it is essential to research and prepare. In starting this article, finding an up-to-date comprehensive list was challenging, as many venues closed with the pandemic, and others either stopped their open mics or only did them seasonally. The last thing you want to do is arrange for a babysitter, arrive ready for your performance, and learn that the date listed was for last year. So, find local venues that host open mic nights and attend as an audience member. This way, you will get a sense of the vibe and style of the performances, which will help you prepare the right material that aligns with the audience’s interests. Also, research the venue’s policies, such as time limits, sign-up procedures, and content restrictions, ensuring you are well-prepared and can showcase your best work. Finding the right venue can make your experience more successful.

 

Knowing what type of audience you’ll be performing for is essential. Some open mic nights draw in a more mature crowd, while others cater to a younger demographic. Some events even have specific themes, such as poetry or hip-hop nights. Research various open mic nights in your area and attend a few as an audience member. You’ll get a sense of which event will be best for you. Don’t be afraid to ask other performers for recommendations. If you’re new to open mic nights, starting with smaller events before moving on to larger venues is a good idea. It will help you build confidence and get comfortable performing in front of an audience.

Choosing the Right Material

Once you’ve found your open mic night, select material that matches the tone and audience. The key to nailing an open mic performance is selecting the appropriate material. You want to choose pieces that highlight your strengths and resonate with the audience. Avoid performing pieces that are controversial, offensive, or too long. Focus on the work that showcases your unique voice and tap into what the audience wants to hear. Start by choosing something you’re comfortable with, showcasing your strengths as an artist. But don’t be afraid to push your boundaries by trying out new material. Before taking the stage, practice and time your piece. Most open mic nights have a time limit, so make sure your performance fits. Choosing the right content for your staged performance is one of the most crucial steps. We advise selecting familiar material you know well, reflecting your artistry’s message. If you are a musician, choose a song you can perform confidently. If you are a writer, choose a piece representing your style and capturing the audience’s attention. Moreover, make sure the material is appropriate for the venue and audience.

Prepare Yourself Mentally

The thought of performing in front of others can be intimidating, so practice visualization techniques, deep breathing exercises, and positive affirmations to calm nerves. Visualize your performance and receive warm applause from the audience. Rehearse in front of your kids. Isn’t that what they’re there for? 🤭

Building Connections

As a mother/parent, you may have personal stories to share that can connect with audiences. It’s essential to relate with your audience and build rapport. Be sure to introduce yourself to the venue owner and other performers. A simple introduction and a quick chat after your performance can go a long way. Not only will it help you build a relationship with the venue, but it can also lead to collaborative opportunities with other performers down the line.

Networking is vital to success in the performing arts industry. Open mic nights provide a great opportunity to connect with other performers and venue owners who can offer you options in the future. Feel free to share your contact information or social media handles. You never know whom you might meet at an open mic night, so being friendly and open to new connections is important. After the open mic, attend other events where your new connections perform. Building relationships with these people can lead to future collaborations, bookings, and opportunities.

Take Advantage of Feedback

Open mic nights offer the chance to receive feedback from audiences and other performers. Use this opportunity to improve your skills and connect with other artists. Be open to criticism and take time to reflect on the comments you receive. Remember that constructive feedback is essential for growth. Unfortunately, not every performance will be a hit. Sometimes, the audience may not respond in the way you hoped. But don’t take it personally! Instead, take it as a learning opportunity. Solicit feedback from other performers and audience members to understand what worked and what didn’t. Most open mic nights embrace constructive feedback to help performers grow. Additionally, open mic nights can lead to professional opportunities, such as invitations to perform at other events, collaborations, and recording opportunities.

Record Your Performance

Recording your performance is an excellent way to critique your performance after the event and determine areas for improvement. It can also provide material for sharing on social media platforms, helping to increase your reach and following. Before taking the stage, ensure you have permission to record your performance. Filming allows you to review your work later, improve, and share your progress with others. You can post the recording on your social media pages or YouTube channel or use it to apply for paid gigs. Additionally, you can use the footage to showcase your talent to potential fans, investors, and collaborators.

Conclusion

Participating in open mic nights offers numerous benefits. For one, it’s an opportunity to practice your craft, whether singing, stand-up comedy, or poetry. It’s also a chance to experiment and test new materials without the pressure of traditional performance. Open mic nights can also help you grow your audience and gain exposure, as many events are free and open to the public. Look at all the possibilities: gaining exposure, improving your performance skills, building your network, trying out new material, and getting audience feedback. You never know; if you share this article with your artist friends, you may meet another mom doing the same thing. Open mic nights are a supportive and encouraging environment where you can connect with and learn from other artists who are on a similar path.

Navigating open mic nights can be a valuable experience for performing artists. By starting small, selecting appropriate material, connecting with other performers and venue owners, and benefiting from the experience, mothers in the performing arts can continue to pursue their passions and expand their reach. Whether you’re just starting or a seasoned performer, open mic nights offer a valuable opportunity to connect with others, hone your skills, and share your talent with live audiences. So why not give it a try? You might just be surprised at what you can achieve. So, go out there and shine!

We have a starter list for you, just below. Be sure to comment below with your ideas and experiences!

Image of upclose microphone and lights behind shimmering in magenta and blue. Open Mics list for the 413 and beyond!

Add to Our List of Open Mics!

This started as a long list and got shorter and shorter. We took out anything that didn’t look like it was currently offering open mics. Help it grow? We know the list is small and regional, but here is our list from June 2023 for:

Open Mics 413

Bishop’s Lounge – Northampton, MA

The Rendezvous – Turners Falls, MA

The Dream Away Lodge – Becket, MA

Open Mic with Gundy at JJs Tavern – Florence, MA

Wurst Haus– Northampton, MA

Play Incubation Collective Pic Salon– various locations in the 413

 Luthier’s Co-op – Easthampton, MA

Paradise East Open Mic Night  -Northampton, MA

Workshop 13 – Ware, MA

The Stomping Ground– Putnam, CT

Irish Ale House– Springfield, MA

Hitchcock Brewing Company– Bernardston, MA

Open Mic listings:

Eventbrite listing for Northampton, MA open mic June 2023

Boston Comedy Open Mics -all of Massachusetts

 

");let r=`${e.styles??""} ${e.scripts??""} ${o}`;return t=URL.createObjectURL(new Blob([r],{type:"text/html"})),iue.set(e,t),v8e?.register(e,t),t}function k8e({contentRef:e,children:t,tabIndex:o=0,scale:r=1,frameSize:n=0,readonly:i,forwardedRef:s,title:a=(0,aue.__)("Editor canvas"),...l}){let{resolvedAssets:u,isPreviewMode:d}=(0,tU.useSelect)(P=>{let O=P(C).getSettings();return{resolvedAssets:O.__unstableResolvedAssets,isPreviewMode:O.isPreviewMode}},[]),[f,p]=(0,lb.useState)(),[h,m]=(0,lb.useState)([]),[g,b,v]=eU(),y=(0,Ad.useRefEffect)(P=>{let O;function N(D){D.preventDefault()}function z(D){D.target.tagName==="A"&&D.target.getAttribute("href")?.startsWith("#")&&(D.preventDefault(),O.defaultView.location.hash=D.target.getAttribute("href").slice(1))}let{ownerDocument:V}=P;m(Array.from(V.body.classList).filter(D=>D.startsWith("admin-color-")||D.startsWith("post-type-")||D==="wp-embed-responsive"));function M(){let{contentDocument:D}=P,{documentElement:L}=D;O=D,p(D),L.classList.add("block-editor-iframe__html"),D.dir=V.dir;for(let j of oue())D.getElementById(j.id)||(D.head.appendChild(j.cloneNode(!0)),d||console.warn(`${j.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,j));O.addEventListener("dragover",N,!1),O.addEventListener("drop",N,!1),O.addEventListener("click",z)}return P.addEventListener("load",M),()=>{p(void 0),P.removeEventListener("load",M),O?.removeEventListener("dragover",N),O?.removeEventListener("drop",N),O?.removeEventListener("click",z)}},[]),{contentResizeListener:k,containerResizeListener:S,isZoomedOut:_,scaleContainerWidth:x}=nue({scale:r,frameSize:parseInt(n),iframeDocument:f}),w=(0,Ad.useDisabled)({isDisabled:!i}),T=(0,Ad.useMergeRefs)([y8e(f),e,b,w]),B=(0,Ad.useRefEffect)(P=>P.ownerDocument.defaultView?(T(P),()=>T(null)):()=>{},[T]),R=S8e(u),I=o>=0&&!d,A=(0,ic.jsxs)(ic.Fragment,{children:[I&&g,(0,ic.jsx)("iframe",{...l,style:{...l.style,height:l.style?.height,border:0},ref:(0,Ad.useMergeRefs)([s,y]),tabIndex:o,src:R,title:a,onKeyDown:P=>{if(l.onKeyDown&&l.onKeyDown(P),P.currentTarget.ownerDocument!==P.target.ownerDocument){let{stopPropagation:O}=P.nativeEvent;P.nativeEvent.stopPropagation=()=>{},P.stopPropagation(),P.nativeEvent.stopPropagation=O,cue(P,window.KeyboardEvent,P.currentTarget)}},children:f&&(0,lb.createPortal)((0,ic.jsxs)("body",{ref:B,className:K("block-editor-iframe__body","editor-styles-wrapper",...h),children:[k,(0,ic.jsx)(lue.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),I&&v]});return(0,ic.jsxs)("div",{className:"block-editor-iframe__container",children:[S,(0,ic.jsx)("div",{className:K("block-editor-iframe__scale-container",_&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":_&&`${x}px`},children:A})]})}function _8e(e,t){return(0,tU.useSelect)(r=>r(C).getSettings().__internalIsInitialized,[])?(0,ic.jsx)(k8e,{...e,forwardedRef:t}):null}var LS=(0,lb.forwardRef)(_8e);var rfe=c(U(),1),jS=c(F(),1),nfe=c(Q(),1);var OA={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},x8e=new Set(["combinator","comma"]);var w8e=e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(OA[e].source.replace("(?\xB6*)","(?.*)"),"gu");default:return OA[e]}};function C8e(e,t){let o=0,r="";for(;t(o.push({value:i,offset:s}),"\uE000".repeat(i.length))),e=e.replace(T8e,(i,s,a,l)=>(o.push({value:i,offset:l}),`${s}${"\uE001".repeat(a.length)}${s}`));{let i=0,s;for(;(s=e.indexOf("(",i))>-1;){let a=C8e(e,s);o.push({value:a,offset:s}),e=`${e.substring(0,s)}(${"\xB6".repeat(a.length-2)})${e.substring(s+a.length)}`,i=s+a.length}}let r=E8e(e,t),n=new Set;for(let i of o.reverse())for(let s of r){let{offset:a,value:l}=i;if(!(s.pos[0]<=a&&a+l.length<=s.pos[1]))continue;let{content:u}=s,d=a-s.pos[0];s.content=u.slice(0,d)+l+u.slice(d+l.length),s.content!==u&&n.add(s)}for(let i of n){let s=w8e(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let a=s.exec(i.content);if(!a)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,a.groups)}return r}function*IA(e,t){switch(e.type){case"list":for(let o of e.list)yield*IA(o,e);break;case"complex":yield*IA(e.left,e),yield*IA(e.right,e);break;case"compound":yield*e.list.map(o=>[o,e]);break;default:yield[e,t]}}function uue(e){let t;return Array.isArray(e)?t=e:t=[...IA(e)].map(([o])=>o),t.map(o=>o.content).join("")}var Qde=c(Ide(),1),Jde=c(AA(),1),efe=c(Lde(),1),tfe=c(Zde(),1),Xde=new Map,ofe=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function HHe(e,t){let o=oU(t),r=o.findLastIndex(({content:s,type:a})=>ofe.some(l=>s===l.content&&a===l.type)),n=-1;for(let s=r+1;sd instanceof RegExp?a.match(d):a.includes(d))?a:ofe.some(d=>a.startsWith(d.content))?HHe(s,a):l}}),o&&(0,tfe.default)({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof Jde.default?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` `+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}var GHe=(e,t="",o)=>{let r=Xde.get(t);return r||(r=new WeakMap,Xde.set(t,r)),e.map(n=>{let i=r.get(n);return i||(i=UHe(n,t,o),r.set(n,i)),i})},zS=GHe;var fm=c(E(),1);Yf([qf,jy]);function WHe(e,t){return(0,jS.useCallback)(o=>{if(!o)return;let{ownerDocument:r}=o,{defaultView:n,body:i}=r,s=t?r.querySelector(t):i,a;if(s)a=n?.getComputedStyle(s,null).getPropertyValue("background-color");else{let u=r.createElement("div");u.classList.add("editor-styles-wrapper"),i.appendChild(u),a=n?.getComputedStyle(u,null).getPropertyValue("background-color"),i.removeChild(u)}let l=Lo(a);l.luminance()>.5||l.alpha()===0?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")},[e,t])}function $He({styles:e,scope:t,transformOptions:o}){let r=(0,nfe.useSelect)(s=>H(s(C)).getStyleOverrides(),[]),[n,i]=(0,jS.useMemo)(()=>{let s=Object.values(e??[]),a=[...r.filter(([,l])=>l?.__unstableType!=="custom-css"),...r.filter(([,l])=>l?.__unstableType==="custom-css")];for(let[l,u]of a){let d=s.findIndex(({id:p})=>l===p),f={...u,id:l};d===-1?s.push(f):s[d]=f}return[zS(s.filter(l=>l?.css),t,o),s.filter(l=>l.__unstableType==="svgs").map(l=>l.assets).join("")]},[e,r,t,o]);return(0,fm.jsxs)(fm.Fragment,{children:[(0,fm.jsx)("style",{ref:WHe(n,t)}),n.map((s,a)=>(0,fm.jsx)("style",{children:s},a)),(0,fm.jsx)(rfe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})]})}var Ld=(0,jS.memo)($He);var Ka=c(E(),1),KHe=(0,ZA.memo)(HS),VU=2e3,YHe=[];function qHe({viewportWidth:e,containerWidth:t,minHeight:o,additionalStyles:r=YHe}){e||(e=t);let[n,{height:i}]=(0,RC.useResizeObserver)(),{styles:s}=(0,ife.useSelect)(d=>({styles:d(C).getSettings().styles}),[]),a=(0,ZA.useMemo)(()=>s&&[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r],[s,r]),l=t/e,u=i?t/(i*l):0;return(0,Ka.jsx)(sfe.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:u,maxHeight:i>VU?VU*l:void 0,minHeight:o},children:(0,Ka.jsxs)(LS,{contentRef:(0,RC.useRefEffect)(d=>{let{ownerDocument:{documentElement:f}}=d;f.classList.add("block-editor-block-preview__content-iframe"),f.style.position="absolute",f.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:VU,minHeight:l!==0&&l<1&&o?o/l:o},children:[(0,Ka.jsx)(Ld,{styles:a}),n,(0,Ka.jsx)(KHe,{renderAppender:!1})]})})}function afe(e){let[t,{width:o}]=(0,RC.useResizeObserver)();return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Ka.jsx)("div",{className:"block-editor-block-preview__container",children:!!o&&(0,Ka.jsx)(qHe,{...e,containerWidth:o})})]})}var US=c(F(),1),dfe=c(cfe(),1),ufe=(0,dfe.createQueue)();function ffe({children:e,placeholder:t}){let[o,r]=(0,US.useState)(!1);return(0,US.useEffect)(()=>{let n={};return ufe.add(n,()=>{(0,US.flushSync)(()=>{r(!0)})}),()=>{ufe.cancel(n)}},[]),o?e:t}var pb=c(E(),1),ZHe=[];function XHe({blocks:e,viewportWidth:t=1200,minHeight:o,additionalStyles:r=ZHe,__experimentalMinHeight:n,__experimentalPadding:i}){n&&(o=n,(0,FU.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,FU.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));let s=(0,zU.useSelect)(u=>u(C).getSettings(),[]),a=(0,fb.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),l=(0,fb.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:(0,pb.jsx)(ES,{value:l,settings:a,children:(0,pb.jsx)(afe,{viewportWidth:t,minHeight:o,additionalStyles:r})})}var pfe=(0,fb.memo)(XHe);pfe.Async=ffe;var bs=pfe;function mfe({blocks:e,props:t={},layout:o}){let r=(0,zU.useSelect)(u=>u(C).getSettings(),[]),n=(0,fb.useMemo)(()=>({...r,styles:void 0,focusMode:!1,isPreviewMode:!0}),[r]),i=(0,XA.useDisabled)(),s=(0,XA.useMergeRefs)([t.ref,i]),a=(0,fb.useMemo)(()=>Array.isArray(e)?e:[e],[e]),l=(0,pb.jsxs)(ES,{value:a,settings:n,children:[(0,pb.jsx)(Ld,{}),(0,pb.jsx)(BC,{renderAppender:!1,layout:o})]});return{...t,ref:s,className:K(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?l:null}}var pm=c(E(),1);function QHe({item:e}){let{name:t,title:o,icon:r,description:n,initialAttributes:i,example:s}=e,a=(0,GS.isReusableBlock)(e),l=(0,hfe.useMemo)(()=>s?(0,GS.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks,innerContent:s.innerContent}):(0,GS.createBlock)(t,i),[t,s,i]),u=144,d=280,f=s?.viewportWidth??500,p=d/f,h=p!==0&&p<1&&u?u/p:u;return(0,pm.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,pm.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,pm.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,pm.jsx)(bs,{blocks:l,viewportWidth:f,minHeight:u,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } `}]})}):(0,pm.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,gfe.__)("No preview available.")})}),!a&&(0,pm.jsx)(cC,{title:o,icon:r,description:n})]})}var bfe=QHe;var XS=c(G(),1),Dd=c(F(),1),KU=c(fe(),1);var Ife=c(ue(),1),Ofe=c(fe(),1);var ZS=c(F(),1),mm=c(ue(),1),Bfe=c(U(),1),PC=c(io(),1);var Cfe=c(U(),1),Efe=c(F(),1);var WS=c(F(),1),yfe=c(G(),1),vfe=c(Qr(),1),Sfe=c(E(),1);function JHe(e,t){let[o,r]=(0,WS.useState)(!1);return(0,WS.useEffect)(()=>{o&&(0,vfe.speak)((0,yfe.__)("Use left and right arrow keys to move through blocks"))},[o]),(0,Sfe.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:n=>{!n.currentTarget.contains(n.relatedTarget)&&r(!1)},...e})}var jU=(0,WS.forwardRef)(JHe);var kfe=c(F(),1),_fe=c(U(),1),xfe=c(E(),1);function e7e(e,t){return(0,xfe.jsx)(_fe.Composite.Group,{role:"presentation",ref:t,...e})}var HU=(0,kfe.forwardRef)(e7e);var JA=c(U(),1),wfe=c(F(),1),QA=c(E(),1);function t7e({isFirst:e,as:t,children:o,...r},n){return(0,QA.jsx)(JA.Composite.Item,{ref:n,role:"option",accessibleWhenDisabled:!0,...r,render:i=>{let s={...i,tabIndex:e?0:i.tabIndex};return t?(0,QA.jsx)(t,{...s,children:o}):typeof o=="function"?o(s):(0,QA.jsx)(JA.Button,{__next40pxDefaultSize:!0,...s,children:o})}})}var UU=(0,wfe.forwardRef)(t7e);var GU=c(E(),1);function o7e({key:e,children:t}){return(0,GU.jsx)(Efe.Fragment,{children:t},e)}function r7e({children:e}){return(0,GU.jsx)(Cfe.Composite,{focusShift:!0,focusWrap:"horizontal",render:o7e,children:e})}var $S=r7e;var Tfe=c(U(),1),t2=c(ue(),1),o2=c(Q(),1),Rfe=c(F(),1);var YS=c(G(),1),KS=c(U(),1);var ac=c(E(),1);function e2({count:e,icon:t,isPattern:o,fadeWhenDisabled:r}){let n=o&&(0,YS.__)("Pattern");return(0,ac.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,ac.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,ac.jsxs)(KS.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,ac.jsx)(KS.FlexItem,{children:t?(0,ac.jsx)(Et,{icon:t}):n||(0,YS.sprintf)((0,YS._n)("%d block","%d blocks",e),e)}),(0,ac.jsx)(KS.FlexItem,{children:(0,ac.jsx)(Et,{icon:Hx})}),r&&(0,ac.jsx)(KS.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,ac.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var WU=c(E(),1),n7e=({isEnabled:e,blocks:t,icon:o,children:r,pattern:n})=>{let i=t.length===1?t[0].name:void 0,s=(0,o2.useSelect)(f=>i&&f(t2.store).getBlockType(i)?.icon,[i]),{startDragging:a,stopDragging:l}=H((0,o2.useDispatch)(C)),u=(0,Rfe.useMemo)(()=>n?.type===Yo.user&&n?.syncStatus!=="unsynced"?[(0,t2.createBlock)("core/block",{ref:n.id})]:void 0,[n?.type,n?.syncStatus,n?.id]);if(!e)return r({draggable:!1,onDragStart:void 0,onDragEnd:void 0});let d=u??t;return(0,WU.jsx)(Tfe.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:d},onDragStart:f=>{a();let p=new Set;for(let h of d){let m=`wp-block:${h.name}`;p.has(m)||(f.dataTransfer.items.add("",m),p.add(m))}},onDragEnd:()=>{l()},__experimentalDragComponent:(0,WU.jsx)(e2,{count:t.length,icon:o||!n&&s,isPattern:!!n}),children:({onDraggableStart:f,onDraggableEnd:p})=>r({draggable:!0,onDragStart:f,onDragEnd:p})})},qS=n7e;var Md=c(E(),1);function i7e({className:e,isFirst:t,item:o,onSelect:r,onHover:n,isDraggable:i,...s}){let a=(0,ZS.useRef)(!1),l=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},u=(0,ZS.useMemo)(()=>[(0,mm.createBlock)(o.name,o.initialAttributes,(0,mm.createBlocksFromInnerBlocksTemplate)(o.innerBlocks),o.innerContent)],[o.name,o.initialAttributes,o.innerBlocks,o.innerContent]),d=(0,mm.isReusableBlock)(o)&&o.syncStatus!=="unsynced"||(0,mm.isTemplatePart)(o);return(0,Md.jsx)(qS,{isEnabled:i&&!o.isDisabled,blocks:u,icon:o.icon,children:({draggable:f,onDragStart:p,onDragEnd:h})=>(0,Md.jsx)("div",{className:K("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:f,onDragStart:m=>{a.current=!0,p&&(n(null),p(m))},onDragEnd:m=>{a.current=!1,h&&h(m)},children:(0,Md.jsxs)(UU,{isFirst:t,className:K("block-editor-block-types-list__item",e),disabled:o.isDisabled,onClick:m=>{m.preventDefault(),r(o,(0,PC.isAppleOS)()?m.metaKey:m.ctrlKey),n(null)},onKeyDown:m=>{let{keyCode:g}=m;g===PC.ENTER&&(m.preventDefault(),r(o,(0,PC.isAppleOS)()?m.metaKey:m.ctrlKey),n(null))},onMouseEnter:()=>{a.current||n(o)},onMouseLeave:()=>n(null),...s,children:[(0,Md.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:l,children:(0,Md.jsx)(Et,{icon:o.icon,showColors:!0})}),(0,Md.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Md.jsx)(Bfe.__experimentalTruncate,{numberOfLines:3,children:o.title})})]})})})}var Pfe=(0,ZS.memo)(i7e);var IC=c(E(),1);function s7e(e,t){let o=[];for(let r=0,n=e.length;r{},children:r,label:n,isDraggable:i=!0}){let s="block-editor-block-types-list",a=(0,Ofe.useInstanceId)(Afe,s);return(0,IC.jsxs)(jU,{className:s,"aria-label":n,children:[s7e(e,3).map((l,u)=>(0,IC.jsx)(HU,{children:l.map((d,f)=>(0,IC.jsx)(Pfe,{item:d,className:(0,Ife.getBlockMenuDefaultClassName)(d.id),onSelect:t,onHover:o,isDraggable:i&&!d.isDisabled,isFirst:u===0&&f===0,rowId:`${a}-${u}`},d.id))},u)),r]})}var mb=Afe;var Lfe=c(U(),1),Nd=c(E(),1);function a7e({title:e,icon:t,children:o}){return(0,Nd.jsxs)(Nd.Fragment,{children:[(0,Nd.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Nd.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Nd.jsx)(Lfe.Icon,{icon:t})]}),(0,Nd.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})}var hm=a7e;var Mfe=c(G(),1),$U=c(E(),1);function l7e({children:e=(0,Mfe.__)("No results found.")}){return(0,$U.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,$U.jsx)("p",{children:e})})}var lc=l7e;var pn=c(E(),1),c7e=e=>e.name.split("/")[0],u7e=6,d7e=[];function Nfe({items:e,collections:t,categories:o,onSelectItem:r,onHover:n,showMostUsedBlocks:i,className:s}){let a=(0,Dd.useMemo)(()=>Kc(e,"frecency","desc").slice(0,u7e),[e]),l=(0,Dd.useMemo)(()=>e.filter(m=>!m.category),[e]),u=(0,Dd.useMemo)(()=>{let m={...t};return Object.keys(t).forEach(g=>{m[g]=e.filter(b=>c7e(b)===g),m[g].length===0&&delete m[g]}),m},[e,t]);(0,Dd.useEffect)(()=>()=>n(null),[]);let d=(0,KU.useAsyncList)(o),f=o.length===d.length,p=(0,Dd.useMemo)(()=>Object.entries(t),[t]),h=(0,KU.useAsyncList)(f?p:d7e);return(0,pn.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,pn.jsx)(hm,{title:(0,XS._x)("Most used","blocks"),children:(0,pn.jsx)(mb,{items:a,onSelect:r,onHover:n,label:(0,XS._x)("Most used","blocks")})}),d.map(m=>{let g=e.filter(b=>b.category===m.slug);return!g||!g.length?null:(0,pn.jsx)(hm,{title:m.title,icon:m.icon,children:(0,pn.jsx)(mb,{items:g,onSelect:r,onHover:n,label:m.title})},m.slug)}),f&&l.length>0&&(0,pn.jsx)(hm,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,XS.__)("Uncategorized"),children:(0,pn.jsx)(mb,{items:l,onSelect:r,onHover:n,label:(0,XS.__)("Uncategorized")})}),h.map(([m,g])=>{let b=u[m];return!b||!b.length?null:(0,pn.jsx)(hm,{title:g.title,icon:g.icon,children:(0,pn.jsx)(mb,{items:b,onSelect:r,onHover:n,label:g.title})},m)})]})}function f7e({rootClientId:e,onInsert:t,onHover:o,showMostUsedBlocks:r},n){let[i,s,a,l]=kp(e,t);if(!i.length)return(0,pn.jsx)(lc,{});let u=[],d=[];for(let f of i)f.category!=="reusable"&&(f.isSearchOnly||(f.isAllowedInCurrentRoot?u.push(f):d.push(f)));return(0,pn.jsx)($S,{children:(0,pn.jsxs)("div",{ref:n,children:[!!u.length&&(0,pn.jsx)(pn.Fragment,{children:(0,pn.jsx)(Nfe,{items:u,categories:s,collections:a,onSelectItem:l,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,pn.jsx)(Nfe,{items:d,categories:s,collections:a,onSelectItem:l,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}var Dfe=(0,Dd.forwardRef)(f7e);var npe=c(F(),1),ipe=c(fe(),1),spe=c(U(),1),ape=c(G(),1);var Qfe=c(U(),1),JU=c(F(),1),Jfe=c(G(),1);var r2=c(U(),1),YU=c(G(),1),Vd=c(E(),1);function p7e({selectedCategory:e,patternCategories:t,onClickCategory:o}){let r="block-editor-block-patterns-explorer__sidebar";return(0,Vd.jsx)("div",{className:`${r}__categories-list`,children:t.map(({name:n,label:i})=>(0,Vd.jsx)(r2.Button,{__next40pxDefaultSize:!0,label:i,className:`${r}__categories-list__item`,isPressed:e===n,onClick:()=>{o(n)},children:i},n))})}function m7e({searchValue:e,setSearchValue:t}){return(0,Vd.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Vd.jsx)(r2.SearchControl,{onChange:t,value:e,label:(0,YU.__)("Search"),placeholder:(0,YU.__)("Search")})})}function h7e({selectedCategory:e,patternCategories:t,onClickCategory:o,searchValue:r,setSearchValue:n}){return(0,Vd.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Vd.jsx)(m7e,{searchValue:r,setSearchValue:n}),!r&&(0,Vd.jsx)(p7e,{selectedCategory:e,patternCategories:t,onClickCategory:o})]})}var Vfe=h7e;var Fd=c(F(),1),ok=c(G(),1),Kfe=c(fe(),1),Yfe=c(U(),1),qfe=c(Qr(),1);var Ffe=c(ue(),1),hu=c(F(),1),OC=c(U(),1);var zfe=c(fe(),1),jfe=c(G(),1);var ys=c(U(),1),Ya=c(G(),1),hi=c(E(),1);function QS({currentPage:e,numPages:t,changePage:o,totalItems:r}){return(0,hi.jsxs)(ys.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,hi.jsx)(ys.__experimentalText,{variant:"muted",children:(0,Ya.sprintf)((0,Ya._n)("%s item","%s items",r),r)}),t>1&&(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(1),disabled:e===1,"aria-label":(0,Ya.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\xAB"})}),(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(e-1),disabled:e===1,"aria-label":(0,Ya.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\u2039"})})]}),(0,hi.jsx)(ys.__experimentalText,{variant:"muted",children:(0,Ya.sprintf)((0,Ya._x)("%1$s of %2$s","paging"),e,t)}),(0,hi.jsxs)(ys.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(e+1),disabled:e===t,"aria-label":(0,Ya.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\u203A"})}),(0,hi.jsx)(ys.Button,{variant:"tertiary",onClick:()=>o(t),disabled:e===t,"aria-label":(0,Ya.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,hi.jsx)("span",{children:"\xBB"})})]})]})]})}var Eo=c(E(),1),g7e=({showTooltip:e,title:t,children:o})=>e?(0,Eo.jsxs)(kt.Root,{children:[(0,Eo.jsx)(kt.Trigger,{render:o}),(0,Eo.jsx)(kt.Popup,{children:t})]}):(0,Eo.jsx)(Eo.Fragment,{children:o});function Hfe({id:e,isDraggable:t,pattern:o,onClick:r,onHover:n,showTitlesAsTooltip:i,category:s,isSelected:a}){let[l,u]=(0,hu.useState)(!1),{blocks:d,viewportWidth:f}=o,h=`block-editor-block-patterns-list__item-description-${(0,zfe.useInstanceId)(Hfe)}`,m=o.type===Yo.user,g=(0,hu.useMemo)(()=>!s||!t?d:(d??[]).map(b=>{let v=(0,Ffe.cloneBlock)(b);return v.attributes.metadata?.categories?.includes(s)&&(v.attributes.metadata.categories=[s]),v}),[d,t,s]);return(0,Eo.jsx)(qS,{isEnabled:t,blocks:g,pattern:o,children:({draggable:b,onDragStart:v,onDragEnd:y})=>(0,Eo.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:b,onDragStart:k=>{u(!0),v&&(n?.(null),v(k))},onDragEnd:k=>{u(!1),y&&y(k)},children:(0,Eo.jsx)(g7e,{showTooltip:i&&!m,title:o.title,children:(0,Eo.jsxs)(OC.Composite.Item,{render:(0,Eo.jsx)("div",{role:"option","aria-label":o.title,"aria-describedby":o.description?h:void 0,className:K("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":o.type===Yo.user&&!o.syncStatus,"is-selected":a})}),id:e,onClick:()=>{r(o,d),n?.(null)},onMouseEnter:()=>{l||n?.(o)},onMouseLeave:()=>n?.(null),children:[(0,Eo.jsx)(bs.Async,{placeholder:(0,Eo.jsx)(b7e,{}),children:(0,Eo.jsx)(bs,{blocks:d,viewportWidth:f})}),(!i||m)&&(0,Eo.jsxs)(OC.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[m&&!o.syncStatus&&(0,Eo.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Eo.jsx)(gt,{className:"block-editor-patterns__pattern-icon",icon:Hc})}),(0,Eo.jsx)(Bd,{render:(0,Eo.jsx)("div",{}),className:"block-editor-block-patterns-list__item-title",variant:"body-sm",children:o.title})]}),!!o.description&&(0,Eo.jsx)(bt,{id:h,children:o.description})]})})})})}function b7e(){return(0,Eo.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function y7e({isDraggable:e,blockPatterns:t,onHover:o,onClickPattern:r,orientation:n,category:i,label:s=(0,jfe.__)("Patterns"),showTitlesAsTooltip:a,pagingProps:l},u){let[d,f]=(0,hu.useState)(void 0),[p,h]=(0,hu.useState)(null);(0,hu.useEffect)(()=>{let g=t[0]?.name;f(g)},[t]);let m=(g,b)=>{h(g.name),r(g,b)};return(0,Eo.jsxs)(OC.Composite,{orientation:n,activeId:d,setActiveId:f,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:u,children:[t.map(g=>(0,Eo.jsx)(Hfe,{id:g.name,pattern:g,onClick:m,onHover:o,isDraggable:e,showTitlesAsTooltip:a,category:i,isSelected:!!p&&p===g.name},g.name)),l&&(0,Eo.jsx)(QS,{...l})]})}var gu=(0,hu.forwardRef)(y7e);var hb=c(Q(),1),Gfe=c(ue(),1),n2=c(G(),1),Wfe=c(Qr(),1),qU=c(F(),1);function Ufe({destinationRootClientId:e,destinationIndex:t,rootClientId:o,registry:r}){if(o===e)return t;let n=["",...r.select(C).getBlockParents(e),e],i=n.indexOf(o);return i!==-1?r.select(C).getBlockIndex(n[i+1])+1:r.select(C).getBlockOrder(o).length}function v7e({rootClientId:e="",insertionIndex:t,clientId:o,isAppender:r,onSelect:n,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){let a=(0,hb.useRegistry)(),{getSelectedBlock:l,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=H((0,hb.useSelect)(C)),{destinationRootClientId:f,destinationIndex:p}=(0,hb.useSelect)(S=>{let{getSelectedBlockClientId:_,getBlockRootClientId:x,getBlockIndex:w,getBlockOrder:T,getInsertionPoint:B}=H(S(C)),R=_(),I=e,A,P=B();return t!==void 0?A=t:P&&P.hasOwnProperty("index")?(I=P?.rootClientId?P.rootClientId:e,A=P.index):o?A=w(o):!r&&R?(I=x(R),A=w(R)+1):A=T(I).length,{destinationRootClientId:I,destinationIndex:A}},[e,t,o,r]),{replaceBlocks:h,insertBlocks:m,showInsertionPoint:g,hideInsertionPoint:b,setLastFocus:v}=H((0,hb.useDispatch)(C)),y=(0,qU.useCallback)((S,_,x=!1,w)=>{(x||i||s)&&v(null);let T=l();!r&&T&&(0,Gfe.isUnmodifiedDefaultBlock)(T,"content")?h(T.clientId,S,null,i||x?0:null,_):m(S,r||w===void 0?p:Ufe({destinationRootClientId:f,destinationIndex:p,rootClientId:w,registry:a}),r||w===void 0?f:w,s,i||x?0:null,_);let B=Array.isArray(S)?S.length:1,R=(0,n2.sprintf)((0,n2._n)("%d block added.","%d blocks added.",B),B);(0,Wfe.speak)(R),n&&n(S)},[r,l,h,m,f,p,n,i,s,v,a]),k=(0,qU.useCallback)(S=>{if(S&&!d()){let _=u(S.name,f);_!==null&&g(_,Ufe({destinationRootClientId:f,destinationIndex:p,rootClientId:_,registry:a}))}else b()},[u,d,g,b,f,p,a]);return[f,y,k]}var gm=v7e;var JS=c(F(),1),i2=c(ue(),1),ek=c(Q(),1),s2=c(G(),1),$fe=c(as(),1);var S7e=(e,t,o,r)=>{let n=(0,JS.useMemo)(()=>({[mp]:!!r}),[r]),i=(0,ek.useSelect)(m=>{let{getSettings:g}=H(m(C));return g()[mT]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:l}=(0,ek.useSelect)(m=>{let{getSettings:g,__experimentalGetAllowedPatterns:b}=H(m(C)),v=g(),y=v[id];return{patterns:b(t,n),userPatternCategories:y?y(m):v.__experimentalUserPatternCategories,patternCategories:v.__experimentalBlockPatternCategories}},[t,n]),u=(0,JS.useMemo)(()=>a.filter(m=>!(m.categories?.includes("navigation")&&!i)),[a,i]),{getClosestAllowedInsertionPointForPattern:d}=H((0,ek.useSelect)(C)),f=(0,JS.useMemo)(()=>{let m=[...s];return l?.forEach(g=>{m.find(b=>b.name===g.name)||m.push(g)}),m},[s,l]),{createSuccessNotice:p}=(0,ek.useDispatch)($fe.store),h=(0,JS.useCallback)((m,g)=>{let b=r?t:d(m,t);if(b===null)return;let v=m.type===Yo.user&&m.syncStatus!=="unsynced"?[(0,i2.createBlock)("core/block",{ref:m.id})]:g;e((v??[]).map(y=>{let k=(0,i2.cloneBlock)(y);return k.attributes.metadata?.categories?.includes(o)&&(k.attributes.metadata.categories=[o]),k}),m.name,!1,b),p((0,s2.sprintf)((0,s2.__)('Pattern "%s" inserted.'),m.title),{type:"snackbar",id:"inserter-notice"})},[p,e,o,t,d,r]);return[u,f,h]},bm=S7e;var tk=c(F(),1),ZU=c(fe(),1),XU=c(Tt(),1),a2=20;function l2(e,t,o,r=""){let[n,i]=(0,tk.useState)(1),s=(0,ZU.usePrevious)(t),a=(0,ZU.usePrevious)(r);(s!==t||a!==r)&&n!==1&&i(1);let l=e.length,u=n-1,d=(0,tk.useMemo)(()=>e.slice(u*a2,u*a2+a2),[u,e]),f=Math.ceil(e.length/a2),p=h=>{(0,XU.getScrollContainer)(o?.current)?.scrollTo(0,0),i(h)};return(0,tk.useEffect)(function(){(0,XU.getScrollContainer)(o?.current)?.scrollTo(0,0)},[t,o]),{totalItems:l,categoryPatterns:d,numPages:f,changePage:p,currentPage:n}}var cc=c(E(),1);function k7e({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,cc.jsx)(Yfe.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,ok.sprintf)((0,ok._n)("%d pattern found","%d patterns found",t),t)}):null}function _7e({searchValue:e,selectedCategory:t,patternCategories:o,rootClientId:r,onModalClose:n}){let i=(0,Fd.useRef)(),s=(0,Kfe.useDebounce)(qfe.speak,500),[a,l]=gm({rootClientId:r,shouldFocusBlock:!0}),[u,,d]=bm(l,a,t),f=(0,Fd.useMemo)(()=>o.map(v=>v.name),[o]),p=(0,Fd.useMemo)(()=>{let v=u.filter(y=>{if(t===gg.name||t===fd.name&&y.type===Yo.user||t===lv.name&&y.blockTypes?.includes("core/post-content"))return!0;if(t==="uncategorized"){let k=y.categories?.some(S=>f.includes(S))??!1;return!y.categories?.length||!k}return y.categories?.includes(t)});return e?Dw(v,e):v},[e,u,t,f]);(0,Fd.useEffect)(()=>{if(!e)return;let v=p.length,y=(0,ok.sprintf)((0,ok._n)("%d result found.","%d results found.",v),v);s(y)},[e,s,p.length]);let h=l2(p,t,i),[m,g]=(0,Fd.useState)(e);e!==m&&(g(e),h.changePage(1));let b=!!p?.length;return(0,cc.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,cc.jsx)(k7e,{filterValue:e,filteredBlockPatternsLength:p.length}),(0,cc.jsx)($S,{children:b&&(0,cc.jsxs)(cc.Fragment,{children:[(0,cc.jsx)(gu,{blockPatterns:h.categoryPatterns,onClickPattern:(v,y)=>{d(v,y),n()},isDraggable:!1}),(0,cc.jsx)(QS,{...h})]})})]})}var Zfe=_7e;var QU=c(F(),1),rk=c(G(),1),Xfe=c(Qr(),1);function x7e(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(o=>t.some(r=>r.name===o))}function nk(e,t="all"){let[o,r]=bm(void 0,e),n=(0,QU.useMemo)(()=>t==="all"?o:o.filter(s=>!PB(s,t)),[t,o]);return(0,QU.useMemo)(()=>{let s=r.filter(a=>n.some(l=>l.categories?.includes(a.name))).sort((a,l)=>a.label.localeCompare(l.label));return n.some(a=>!x7e(a,r))&&!s.find(a=>a.name==="uncategorized")&&s.push({name:"uncategorized",label:(0,rk._x)("Uncategorized")}),n.some(a=>a.blockTypes?.includes("core/post-content"))&&s.unshift(lv),n.some(a=>a.type===Yo.user)&&s.unshift(fd),n.length>0&&s.unshift({name:gg.name,label:gg.label}),(0,Xfe.speak)((0,rk.sprintf)((0,rk._n)("%d category button displayed.","%d category buttons displayed.",s.length),s.length)),s},[r,n])}var gb=c(E(),1);function w7e({initialCategory:e,rootClientId:t,onModalClose:o}){let[r,n]=(0,JU.useState)(""),[i,s]=(0,JU.useState)(e?.name),a=nk(t);return(0,gb.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,gb.jsx)(Vfe,{selectedCategory:i,patternCategories:a,onClickCategory:s,searchValue:r,setSearchValue:n}),(0,gb.jsx)(Zfe,{searchValue:r,selectedCategory:i,patternCategories:a,rootClientId:t,onModalClose:o})]})}function C7e({onModalClose:e,...t}){return(0,gb.jsx)(Qfe.Modal,{title:(0,Jfe.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,gb.jsx)(w7e,{onModalClose:e,...t})})}var epe=C7e;var ik=c(G(),1),Zo=c(U(),1);var Tn=c(E(),1);function E7e({title:e}){return(0,Tn.jsx)(Zo.__experimentalVStack,{spacing:0,children:(0,Tn.jsx)(Zo.__experimentalView,{children:(0,Tn.jsx)(Zo.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Tn.jsxs)(Zo.__experimentalHStack,{spacing:2,children:[(0,Tn.jsx)(Zo.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,ik.isRTL)()?un:Ti,size:"small",label:(0,ik.__)("Back")}),(0,Tn.jsx)(Zo.__experimentalSpacer,{children:(0,Tn.jsx)(Zo.__experimentalHeading,{level:5,children:e})})]})})})})}function c2({categories:e,children:t,screenClassName:o}){return(0,Tn.jsxs)(Zo.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Tn.jsx)(Zo.Navigator.Screen,{path:"/",children:(0,Tn.jsx)(Zo.__experimentalItemGroup,{children:e.map(r=>(0,Tn.jsx)(Zo.Navigator.Button,{path:`/category/${r.name}`,as:Zo.__experimentalItem,isAction:!0,children:(0,Tn.jsxs)(Zo.__experimentalHStack,{children:[(0,Tn.jsx)(Zo.FlexBlock,{children:r.label}),(0,Tn.jsx)(gt,{icon:(0,ik.isRTL)()?Ti:un})]})},r.name))})}),e.map(r=>(0,Tn.jsxs)(Zo.Navigator.Screen,{className:o,path:`/category/${r.name}`,children:[(0,Tn.jsx)(E7e,{title:(0,ik.__)("Back")}),t(r)]},r.name))]})}var qa=c(F(),1),e9=c(G(),1),uc=c(U(),1);var Ss=c(U(),1),vs=c(G(),1);var u2=c(F(),1);var Yn=c(E(),1),tpe=e=>e!=="all"&&e!=="user",T7e=e=>e.name===fd.name,R7e=[{value:"all",label:(0,vs._x)("All","patterns")},{value:Yo.directory,label:(0,vs.__)("Pattern Directory")},{value:Yo.theme,label:(0,vs.__)("Theme & Plugins")},{value:Yo.user,label:(0,vs.__)("User")}];function ope({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:o,patternSourceFilter:r,scrollContainerRef:n,category:i}){let s=i.name===fd.name?Yo.user:r,a=tpe(s),l=T7e(i),u=(0,u2.useMemo)(()=>[{value:"all",label:(0,vs._x)("All","patterns")},{value:Cw.full,label:(0,vs._x)("Synced","patterns"),disabled:a},{value:Cw.unsynced,label:(0,vs._x)("Not synced","patterns"),disabled:a}],[a]);function d(f){t(f),tpe(f)&&e("all")}return(0,Yn.jsx)(Yn.Fragment,{children:(0,Yn.jsx)(Ss.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,vs.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,Yn.jsx)(gt,{icon:(0,Yn.jsx)(Ss.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Yn.jsx)(Ss.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,Yn.jsxs)(Yn.Fragment,{children:[!l&&(0,Yn.jsx)(Ss.MenuGroup,{label:(0,vs.__)("Source"),children:(0,Yn.jsx)(Ss.MenuItemsChoice,{choices:R7e,onSelect:f=>{d(f),n.current?.scrollTo(0,0)},value:s})}),(0,Yn.jsx)(Ss.MenuGroup,{label:(0,vs.__)("Type"),children:(0,Yn.jsx)(Ss.MenuItemsChoice,{choices:u,onSelect:f=>{e(f),n.current?.scrollTo(0,0)},value:o})}),(0,Yn.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,u2.createInterpolateElement)((0,vs.__)("Patterns are available from theWordPress.org Pattern Directory, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,Yn.jsx)(Ss.ExternalLink,{href:(0,vs.__)("https://wordpress.org/patterns/")})})})]})})})}var Fi=c(E(),1),B7e=()=>{};function d2({rootClientId:e,onInsert:t,onHover:o=B7e,category:r,showTitlesAsTooltip:n}){let[i,,s]=bm(t,e,r?.name),[a,l]=(0,qa.useState)("all"),[u,d]=(0,qa.useState)("all"),f=nk(e,u),p=(0,qa.useRef)(),h=(0,qa.useMemo)(()=>i.filter(y=>PB(y,u,a)?!1:r.name===gg.name||r.name===fd.name&&y.type===Yo.user||r.name===lv.name&&y.blockTypes?.includes("core/post-content")?!0:r.name==="uncategorized"?y.categories?!y.categories.some(k=>f.some(S=>S.name===k)):!0:y.categories?.includes(r.name)),[i,f,r.name,u,a]),m=l2(h,r,p),{changePage:g}=m;(0,qa.useEffect)(()=>()=>o(null),[]);let b=(0,qa.useCallback)(y=>{l(y),g(1)},[l,g]),v=(0,qa.useCallback)(y=>{d(y),g(1)},[d,g]);return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsxs)(uc.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,Fi.jsxs)(uc.__experimentalHStack,{children:[(0,Fi.jsx)(uc.FlexBlock,{children:(0,Fi.jsx)(uc.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,Fi.jsx)(ope,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:p,category:r})]}),!h.length&&(0,Fi.jsx)(uc.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,e9.__)("No results found")})]}),h.length>0&&(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)(uc.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,e9.__)("Drag and drop patterns into the canvas.")}),(0,Fi.jsx)(gu,{ref:p,blockPatterns:m.categoryPatterns,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:n,patternFilter:u,pagingProps:m})]})]})}var p2=c(fe(),1),m2=c(U(),1),rpe=c(F(),1);var bb=c(E(),1),{Tabs:f2}=H(m2.privateApis);function P7e({categories:e,selectedCategory:t,onSelectCategory:o,children:r}){let s={type:"tween",duration:(0,p2.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},a=(0,p2.usePrevious)(t),l=t?t.name:null,[u,d]=(0,rpe.useState)(),f=e?.[0]?.name;return l===null&&!u&&f&&d(f),(0,bb.jsxs)(f2,{selectOnMove:!1,selectedTabId:l,orientation:"vertical",onSelect:p=>{o(e.find(h=>h.name===p))},activeTabId:u,onActiveTabIdChange:d,children:[(0,bb.jsx)(f2.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(p=>(0,bb.jsx)(f2.Tab,{tabId:p.name,"aria-current":p===t?"true":void 0,children:p.label},p.name))}),e.map(p=>(0,bb.jsx)(f2.TabPanel,{tabId:p.name,focusable:!1,children:(0,bb.jsx)(m2.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:a?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:s,children:r})},p.name))]})}var h2=P7e;var Zs=c(E(),1);function I7e({onSelectCategory:e,selectedCategory:t,onInsert:o,rootClientId:r,children:n}){let[i,s]=(0,npe.useState)(!1),a=nk(r),l=(0,ipe.useViewportMatch)("medium","<");return a.length?(0,Zs.jsxs)(Zs.Fragment,{children:[!l&&(0,Zs.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Zs.jsx)(h2,{categories:a,selectedCategory:t,onSelectCategory:e,children:n}),(0,Zs.jsx)(spe.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,ape.__)("Explore all patterns")})]}),l&&(0,Zs.jsx)(c2,{categories:a,children:u=>(0,Zs.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Zs.jsx)(d2,{onInsert:o,rootClientId:r,category:u},u.name)})}),i&&(0,Zs.jsx)(epe,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Zs.jsx)(lc,{})}var lpe=I7e;var Rpe=c(G(),1),Bpe=c(fe(),1),Ppe=c(U(),1),sk=c(F(),1);var vu=c(U(),1),fr=c(G(),1),bi=c(F(),1),LC=c(fe(),1),Cpe=c(Q(),1),Epe=c(Tt(),1),Tpe=c(as(),1);var gpe=c(U(),1),bpe=c(G(),1);var dr=c(U(),1),gi=c(G(),1),bu=c(F(),1),o9=c(ue(),1);var AC=c(Q(),1),fpe=c(as(),1),ppe=c(t9(),1),mpe=c(Fs(),1);var upe=c(ue(),1),dpe=c(E(),1),O7e={image:"img",video:"video",audio:"audio"};function g2(e,t){let o={id:e.id||void 0,caption:e.caption||void 0},r=e.url,n=e.alt||void 0;t==="image"?(o.url=r,o.alt=n):["video","audio"].includes(t)&&(o.src=r);let i=O7e[t],s=(0,dpe.jsx)(i,{src:e.previewUrl||r,alt:n,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:a})=>{a.src===e.previewUrl&&(a.src=r)}});return[(0,upe.createBlock)(`core/${t}`,o),s]}var Yt=c(E(),1),A7e=["image"],L7e={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function M7e({category:e,media:t,onDetach:o}){if(!e.getReportUrl&&!o)return null;let r=e.getReportUrl?.(t);return(0,Yt.jsx)(dr.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,gi.__)("Options"),popoverProps:L7e,icon:zs,children:()=>(0,Yt.jsxs)(dr.MenuGroup,{children:[r&&(0,Yt.jsx)(dr.MenuItem,{onClick:()=>window.open(r,"_blank").focus(),icon:w3,children:(0,gi.sprintf)((0,gi.__)("Report %s"),e.mediaType)}),o&&(0,Yt.jsx)(dr.MenuItem,{onClick:()=>o(t),icon:is,children:e.postTypeLabel?(0,gi.sprintf)((0,gi.__)("Detach from %s"),e.postTypeLabel):(0,gi.__)("Detach from post")})]})})}function N7e({onClose:e,onSubmit:t}){return(0,Yt.jsxs)(dr.Modal,{title:(0,gi.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,Yt.jsxs)(dr.__experimentalVStack,{spacing:3,children:[(0,Yt.jsx)("p",{children:(0,gi.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,Yt.jsx)("p",{children:(0,gi.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,Yt.jsxs)(dr.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Yt.jsx)(dr.FlexItem,{children:(0,Yt.jsx)(dr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,gi.__)("Cancel")})}),(0,Yt.jsx)(dr.FlexItem,{children:(0,Yt.jsx)(dr.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,gi.__)("Insert")})})]})]})}function hpe({media:e,onClick:t,onDetach:o,category:r}){let[n,i]=(0,bu.useState)(!1),[s,a]=(0,bu.useState)(!1),[l,u]=(0,bu.useState)(!1),[d,f]=(0,bu.useMemo)(()=>g2(e,r.mediaType),[e,r.mediaType]),{createErrorNotice:p,createSuccessNotice:h}=(0,AC.useDispatch)(fpe.store),{getSettings:m,getBlock:g}=(0,AC.useSelect)(C),{updateBlockAttributes:b}=(0,AC.useDispatch)(C),v=(0,bu.useCallback)(_=>{if(l)return;let x=m(),w=(0,o9.cloneBlock)(_),{id:T,url:B,caption:R}=w.attributes;if(!T&&!x.mediaUpload){i(!0);return}if(T){t(w);return}u(!0),window.fetch(B).then(I=>I.blob()).then(I=>{let A=(0,mpe.getFilename)(B)||"image.jpg",P=new File([I],A,{type:I.type});x.mediaUpload({filesList:[P],additionalData:{caption:R},onFileChange([O]){(0,ppe.isBlobURL)(O.url)||(g(w.clientId)?b(w.clientId,{...w.attributes,id:O.id,url:O.url}):(t({...w,attributes:{...w.attributes,id:O.id,url:O.url}}),h((0,gi.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),u(!1))},allowedTypes:A7e,onError(O){p(O,{type:"snackbar",id:"inserter-notice"}),u(!1)}})}).catch(()=>{i(!0),u(!1)})},[l,m,t,h,b,p,g]),y=typeof e.title=="string"?e.title:e.title?.rendered||(0,gi.__)("no title"),k=(0,bu.useCallback)(()=>a(!0),[]),S=(0,bu.useCallback)(()=>a(!1),[]);return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(qS,{isEnabled:!0,blocks:[d],children:({draggable:_,onDragStart:x,onDragEnd:w})=>(0,Yt.jsx)("div",{className:K("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:_,onDragStart:x,onDragEnd:w,children:(0,Yt.jsxs)("div",{onMouseEnter:k,onMouseLeave:S,children:[(0,Yt.jsxs)(kt.Root,{children:[(0,Yt.jsx)(kt.Trigger,{render:(0,Yt.jsx)(dr.Composite.Item,{render:(0,Yt.jsx)("div",{"aria-label":y,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>v(d),children:(0,Yt.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[f,l&&(0,Yt.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,Yt.jsx)(dr.Spinner,{})})]})})}),(0,Yt.jsx)(kt.Popup,{children:y})]}),!l&&(0,Yt.jsx)(M7e,{category:r,media:e,onDetach:o})]})})}),n&&(0,Yt.jsx)(N7e,{onClose:()=>i(!1),onSubmit:()=>{t((0,o9.cloneBlock)(d)),h((0,gi.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),i(!1)}})]})}var r9=c(E(),1);function D7e({mediaList:e,category:t,onClick:o,onDetach:r,label:n=(0,bpe.__)("Media List")}){return(0,r9.jsx)(gpe.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":n,children:e.map((i,s)=>(0,r9.jsx)(hpe,{media:i,category:t,onClick:o,onDetach:r},i.id||i.sourceId||s))})}var ype=D7e;var vpe=c(U(),1),V7e=()=>null,yu=(0,vpe.withFilters)("editor.MediaUpload")(V7e);var Spe=c(Q(),1);function F7e({fallback:e=null,children:t}){return(0,Spe.useSelect)(r=>{let{getSettings:n}=r(C);return!!n().mediaUpload},[])?t:e}var Xs=F7e;var zi=c(F(),1),n9=c(Q(),1);function kpe(e){return Array.isArray(e)?{mediaItems:e}:{mediaItems:e?.mediaItems??[],totalItems:e?.totalItems,totalPages:e?.totalPages}}function _pe(e,t={},o){let[r,n]=(0,zi.useState)(),[i,s]=(0,zi.useState)({}),[a,l]=(0,zi.useState)(!1),u=(0,zi.useRef)(),d=(0,zi.useRef)(),f=(0,zi.useRef)(),p=(0,zi.useRef)();return(0,zi.useEffect)(()=>{(async()=>{let h=JSON.stringify({category:e.name,...t}),m={};u.current=m,l(!0),(d.current!==h||f.current!==e.fetch)&&n([]),(p.current!==e.name||f.current!==e.fetch)&&s({}),d.current=h,f.current=e.fetch,p.current=e.name;let{page:g,...b}=t,v=g>1?t:b,{mediaItems:y,totalItems:k,totalPages:S}=kpe(await e.fetch?.(v));m===u.current&&(n(y),s({totalItems:k,totalPages:S}),l(!1))})()},[e.name,e.fetch,...Object.values(t),o]),{mediaList:r,isLoading:a,totalItems:i.totalItems,totalPages:i.totalPages}}function xpe(e,t=400){let[o,r]=(0,zi.useState)(!1);return(0,zi.useEffect)(()=>{if(!e)return;let n=setTimeout(()=>r(!0),t);return()=>{clearTimeout(n),r(!1)}},[e,t]),o}function wpe(e){let[t,o]=(0,zi.useState)([]),r=(0,n9.useSelect)(a=>H(a(C)).getInserterMediaCategories(),[]),{canInsertImage:n,canInsertVideo:i,canInsertAudio:s}=(0,n9.useSelect)(a=>{let{canInsertBlockType:l}=a(C);return{canInsertImage:l("core/image",e),canInsertVideo:l("core/video",e),canInsertAudio:l("core/audio",e)}},[e]);return(0,zi.useEffect)(()=>{(async()=>{let a=[];if(!r)return;let l=new Map(await Promise.all(r.map(async d=>{if(d.isExternalResource)return[d.name,!0];let f=[];try{let{mediaItems:p}=kpe(await d.fetch({per_page:1}));f=p}catch{}return[d.name,!!f.length]}))),u={image:n,video:i,audio:s};r.forEach(d=>{u[d.mediaType]&&(l.get(d.name)||d.emptyMessage)&&a.push(d)}),a.length&&o(a)})()},[n,i,s,r]),t}var on=c(E(),1),z7e=20,j7e=["image"];function H7e({onSelect:e}){return(0,on.jsx)(Xs,{children:(0,on.jsx)(yu,{multiple:"add",onSelect:e,allowedTypes:j7e,title:(0,fr.__)("Attach images"),render:({open:t})=>(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__media-panel-attach","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",onClick:o=>{o.target.focus(),t()},variant:"secondary",children:(0,fr.__)("Attach images")})})})}function MC({rootClientId:e,onInsert:t,category:o}){let[r,n,i]=(0,LC.useDebouncedInput)(),[s,a]=(0,bi.useState)(1),l=(0,LC.usePrevious)(o.name),u=(0,LC.usePrevious)(i);(l!==o.name||u!==i)&&s!==1&&a(1);let d=(0,bi.useMemo)(()=>({per_page:z7e,page:s,search:i}),[s,i]),[f,p]=(0,bi.useState)(0),{mediaList:h,isLoading:m,totalItems:g,totalPages:b}=_pe(o,d,f),v=b||1;typeof b=="number"&&s>v&&a(v);let y=!o.isExternalResource,k=y?o.attach:void 0,S=y?o.detach:void 0,_=y?o.subscribe:void 0,x=v>1,w=x||!!k,T=(0,bi.useRef)(),B=(0,bi.useCallback)(q=>{(0,Epe.getScrollContainer)(T.current)?.scrollTo(0,0),a(q)},[]),{createErrorNotice:R,createSuccessNotice:I,createWarningNotice:A}=(0,Cpe.useDispatch)(Tpe.store),P=xpe(m),O=(0,bi.useCallback)(()=>{y&&o.invalidate?.(d),p(q=>q+1)},[o,d,y]);(0,bi.useEffect)(()=>{if(_)return _(()=>p(q=>q+1),d)},[_,d]);let N=(0,bi.useCallback)(async q=>{try{let J=await k(q);if(!J){A((0,fr.__)("No images were attached."),{type:"snackbar",id:"inserter-notice"});return}O(),I(o.postTypeLabel?(0,fr.sprintf)((0,fr._n)("%1$d image attached to %2$s.","%1$d images attached to %2$s.",J),J,o.postTypeLabel):(0,fr.sprintf)((0,fr._n)("%d image attached to post.","%d images attached to post.",J),J),{type:"snackbar",id:"inserter-notice"})}catch{R((0,fr.__)("Could not attach images."),{type:"snackbar",id:"inserter-notice"})}},[k,o,O,R,I,A]),z=(0,bi.useCallback)(async q=>{try{await S(q),O(),I(o.postTypeLabel?(0,fr.sprintf)((0,fr.__)("Image detached from %s."),o.postTypeLabel):(0,fr.__)("Image detached from post."),{type:"snackbar",id:"inserter-notice"})}catch{R((0,fr.__)("Could not detach image."),{type:"snackbar",id:"inserter-notice"})}},[S,o,O,R,I]),[V,M]=(0,bi.useState)(),D=(0,bi.useCallback)(()=>{let q=V;M(void 0),z(q)},[z,V]),L="block-editor-inserter__media-panel",j=o.labels.search_items||(0,fr.__)("Search");return(0,on.jsxs)("div",{ref:T,className:K(L,{"has-footer":w}),children:[(0,on.jsx)(vu.SearchControl,{className:`${L}-search`,onChange:n,value:r,label:j,placeholder:j}),m&&!h?.length&&(0,on.jsx)("div",{className:`${L}-spinner`,children:(0,on.jsx)(vu.Spinner,{})}),!m&&!h?.length&&(0,on.jsx)(lc,{children:o.emptyMessage&&!i?o.emptyMessage:(0,fr.__)("No results found.")}),!!h?.length&&(0,on.jsx)("div",{className:K(`${L}-results`,{"is-loading":P}),"aria-busy":P,children:(0,on.jsx)(ype,{rootClientId:e,onClick:t,onDetach:S?M:void 0,mediaList:h,category:o})}),w&&(0,on.jsxs)(Qe,{direction:"column",gap:"sm",className:`${L}-footer`,children:[x&&(0,on.jsx)(QS,{currentPage:s,numPages:v,changePage:B,totalItems:g}),k&&(0,on.jsx)(H7e,{onSelect:N})]}),V&&(0,on.jsxs)(vu.Modal,{title:(0,fr.__)("Detach image"),onRequestClose:()=>M(void 0),overlayClassName:`${L}-detach-modal`,children:[(0,on.jsx)("p",{children:o.postTypeLabel?(0,fr.sprintf)((0,fr.__)("Detach this image from the current %s? The image will remain in the Media Library."),o.postTypeLabel):(0,fr.__)("Detach this image from the current post? The image will remain in the Media Library.")}),(0,on.jsxs)("div",{className:`${L}-detach-actions`,children:[(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>M(void 0),children:(0,fr.__)("Cancel")}),(0,on.jsx)(vu.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:D,children:(0,fr.__)("Detach")})]})]})]})}var Qs=c(E(),1),U7e=["image","video","audio"];function G7e({rootClientId:e,selectedCategory:t,onSelectCategory:o,onInsert:r,children:n}){let i=wpe(e),s=(0,Bpe.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",l=(0,sk.useCallback)(d=>{if(!d?.url)return;let f=window.__experimentalDataViewsMediaModal&&d.mime_type?d.mime_type.split("/")[0]:d.type,[p]=g2(d,f);r(p)},[r]),u=(0,sk.useMemo)(()=>i.map(d=>({...d,label:d.labels.name})),[i]);return(0,sk.useEffect)(()=>{if(!t)return;let d=u.find(f=>f.name===t.name);d&&d!==t?o(d):d||o(null)},[u,o,t]),u.length?(0,Qs.jsxs)(Qs.Fragment,{children:[!s&&(0,Qs.jsxs)("div",{className:`${a}-container`,children:[(0,Qs.jsx)(h2,{categories:u,selectedCategory:t,onSelectCategory:o,children:n}),(0,Qs.jsx)(Xs,{children:(0,Qs.jsx)(yu,{multiple:!1,onSelect:l,allowedTypes:U7e,render:({open:d})=>(0,Qs.jsx)(Ppe.Button,{__next40pxDefaultSize:!0,onClick:f=>{f.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,Rpe.__)("Open Media Library")})})})]}),s&&(0,Qs.jsx)(c2,{categories:u,screenClassName:"block-editor-inserter__media-mobile-screen",children:d=>(0,Qs.jsx)(MC,{onInsert:r,rootClientId:e,category:d})})]}):(0,Qs.jsx)(lc,{})}var i9=G7e;var NC=c(F(),1),ym=c(G(),1);var y2=c(fe(),1),Ape=c(Qr(),1),Lpe=c(Q(),1);var Ipe=c(U(),1),{Fill:Ope,Slot:W7e}=(0,Ipe.createSlotFill)("__unstableInserterMenuExtension");Ope.Slot=W7e;var b2=Ope;var ks=c(E(),1),$7e=9,K7e=[];function Y7e({filterValue:e,onSelect:t,onHover:o,onHoverPattern:r,rootClientId:n,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:l,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:f=!0,shouldFocusBlock:p=!0,prioritizePatterns:h,selectBlockOnInsert:m,isQuick:g}){let b=(0,y2.useDebounce)(Ape.speak,500),{prioritizedBlocks:v}=(0,Lpe.useSelect)(V=>({prioritizedBlocks:V(C).getBlockListSettings(n)?.prioritizedInserterBlocks||K7e}),[n]),[y,k]=gm({onSelect:t,rootClientId:n,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:p,selectBlockOnInsert:m}),[S,_,x,w]=kp(y,k,g),[T,,B]=bm(k,y,void 0,g),R=(0,NC.useMemo)(()=>{if(l===0)return[];let V=Dw(T,e);return l!==void 0?V.slice(0,l):V},[e,T,l]),I=u;h&&R.length>2&&(I=0);let A=(0,NC.useMemo)(()=>{if(I===0)return[];let V=S.filter(L=>L.name!=="core/block"),M=Kc(V,"frecency","desc");!e&&v.length&&(M=tP(M,v));let D=QB(M,_,x,e);return I!==void 0?D.slice(0,I):D},[e,S,_,x,I,v]);(0,NC.useEffect)(()=>{if(!e)return;let V=A.length+R.length,M=(0,ym.sprintf)((0,ym._n)("%d result found.","%d results found.",V),V);b(M)},[e,b,A,R]);let P=(0,y2.useAsyncList)(A,{step:$7e}),O=A.length>0||R.length>0,N=!!A.length&&(0,ks.jsx)(hm,{title:(0,ks.jsx)(bt,{children:(0,ym.__)("Blocks")}),children:(0,ks.jsx)(mb,{items:P,onSelect:w,onHover:o,label:(0,ym.__)("Blocks"),isDraggable:f})}),z=!!R.length&&(0,ks.jsx)(hm,{title:(0,ks.jsx)(bt,{children:(0,ym.__)("Patterns")}),children:(0,ks.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,ks.jsx)(gu,{blockPatterns:R,onClickPattern:B,onHover:r,isDraggable:f})})});return(0,ks.jsxs)($S,{children:[!d&&!O&&(0,ks.jsx)(lc,{}),h?z:N,!!A.length&&!!R.length&&(0,ks.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?N:z,d&&(0,ks.jsx)(b2.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:e,hasItems:O,rootClientId:y},children:V=>V.length?V:O?null:(0,ks.jsx)(lc,{})})]})}var v2=Y7e;var k2=c(U(),1),Mpe=c(F(),1);var zd=c(E(),1),{Tabs:S2}=H(k2.privateApis);function q7e({defaultTabId:e,onClose:t,onSelect:o,selectedTab:r,tabs:n,closeButtonLabel:i},s){return(0,zd.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,zd.jsxs)(S2,{selectOnMove:!1,defaultTabId:e,onSelect:o,selectedTabId:r,children:[(0,zd.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,zd.jsx)(k2.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:tg,label:i,onClick:()=>t(),size:"compact"}),(0,zd.jsx)(S2.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:n.map(a=>(0,zd.jsx)(S2.Tab,{tabId:a.name,className:"block-editor-tabbed-sidebar__tab",children:a.title},a.name))})]}),n.map(a=>(0,zd.jsx)(S2.TabPanel,{tabId:a.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:a.panelRef,children:a.panel},a.name))]})})}var _2=(0,Mpe.forwardRef)(q7e);var x2=c(Q(),1),ak=c(F(),1);function DC(e=!0){let{setZoomLevel:t,resetZoomLevel:o}=H((0,x2.useDispatch)(C)),{isZoomedOut:r,isZoomOut:n}=(0,x2.useSelect)(a=>{let{isZoomOut:l}=H(a(C));return{isZoomedOut:l(),isZoomOut:l}},[]),i=(0,ak.useRef)(!1),s=(0,ak.useRef)(e);(0,ak.useEffect)(()=>{r!==s.current&&(i.current=!1)},[r]),(0,ak.useEffect)(()=>(s.current=e,e!==n()&&(i.current=!0,e?t("auto-scaled"):o()),()=>{i.current&&n()&&o()}),[e,n,o,t])}var qt=c(E(),1),Dpe=()=>{};function Z7e({rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,onSelect:n,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:l=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:f,__experimentalInitialCategory:p},h){let{isZoomOutMode:m,hasSectionRootClientId:g}=(0,Npe.useSelect)(he=>{let{isZoomOut:ke,getSectionRootClientId:_e}=H(he(C));return{isZoomOutMode:ke(),hasSectionRootClientId:!!_e()}},[]),[b,v,y]=(0,VC.useDebouncedInput)(a),[k,S]=(0,Jt.useState)(null),[_,x]=(0,Jt.useState)(p),[w,T]=(0,Jt.useState)("all"),[B,R]=(0,Jt.useState)(null),I=(0,VC.useViewportMatch)("large"),P=(0,VC.useViewportMatch)("medium","<")?d:Dpe;function O(){return f||(m?"patterns":"blocks")}let[N,z]=(0,Jt.useState)(O());DC(g&&(N==="patterns"||N==="media")&&I);let[M,D,L]=gm({rootClientId:e,clientId:t,isAppender:o,insertionIndex:r,shouldFocusBlock:l}),j=(0,Jt.useRef)(),q=(0,Jt.useCallback)((he,ke,_e,we)=>{D(he,ke,_e,we),n(he),P(),window.requestAnimationFrame(()=>{!l&&!j.current?.contains(h.current.ownerDocument.activeElement)&&j.current?.querySelector("button").focus()})},[D,P,n,h,l]),J=(0,Jt.useCallback)((he,ke,..._e)=>{L(!1),D(he,{patternName:ke},..._e),n(),P()},[D,P,n,L]),te=(0,Jt.useCallback)(he=>{L(he),S(he)},[L,S]),ee=(0,Jt.useCallback)((he,ke)=>{x(he),T(ke),u?.()},[x,u]),$=N==="patterns"&&!y&&!!_,W=N==="media"&&!!B,[Y,Z]=(0,Jt.useState)(!1),oe=(0,Jt.useRef)(null),ne=(0,Jt.useRef)(null),X=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{let he=_e=>{Z(_e.currentTarget.scrollTop>0)},ke=[oe.current,ne.current,X.current].filter(Boolean);return ke.forEach(_e=>_e.addEventListener("scroll",he)),()=>{ke.forEach(_e=>_e.removeEventListener("scroll",he))}},[]);let re=(0,Jt.useMemo)(()=>N==="media"?null:(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(w2.SearchControl,{className:K("block-editor-inserter__search",{"is-scrolled":Y}),onChange:he=>{k&&S(null),v(he)},value:b,label:(0,vm.__)("Search"),placeholder:(0,vm.__)("Search")}),!!y&&(0,qt.jsx)(v2,{filterValue:y,onSelect:n,onHover:te,rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:N==="patterns"})]}),[N,k,S,v,b,y,n,te,l,t,e,r,o,Y]),ae=(0,Jt.useMemo)(()=>(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,qt.jsx)(Dfe,{ref:j,rootClientId:M,onInsert:q,onHover:te,showMostUsedBlocks:s})}),i&&(0,qt.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,qt.jsx)(bt,{render:(0,qt.jsx)("h2",{}),children:(0,vm.__)("A tip for using the block editor")}),(0,qt.jsx)(jle,{})]})]}),[M,q,te,s,i]),ve=(0,Jt.useMemo)(()=>(0,qt.jsx)(lpe,{rootClientId:M,onInsert:J,onSelectCategory:ee,selectedCategory:_,children:$&&(0,qt.jsx)(d2,{rootClientId:M,onInsert:J,category:_,patternFilter:w,showTitlesAsTooltip:!0})}),[M,J,ee,w,_,$]),xe=(0,Jt.useMemo)(()=>(0,qt.jsx)(i9,{rootClientId:M,selectedCategory:B,onSelectCategory:R,onInsert:q,children:W&&(0,qt.jsx)(MC,{rootClientId:M,onInsert:q,category:B})}),[M,q,B,R,W]),ge=he=>{he!=="patterns"&&x(null),z(he)},be=(0,Jt.useRef)();return(0,Jt.useLayoutEffect)(()=>{be.current&&window.requestAnimationFrame(()=>{be.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,qt.jsxs)("div",{className:K("block-editor-inserter__menu",{"show-panel":$||W,"is-zoom-out":m}),ref:h,children:[(0,qt.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,qt.jsx)(_2,{ref:be,onSelect:ge,onClose:d,selectedTab:N,closeButtonLabel:(0,vm.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,vm.__)("Blocks"),panelRef:oe,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,N==="blocks"&&!y&&ae]})},{name:"patterns",title:(0,vm.__)("Patterns"),panelRef:ne,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,N==="patterns"&&!y&&ve]})},{name:"media",title:(0,vm.__)("Media"),panelRef:X,panel:(0,qt.jsxs)(qt.Fragment,{children:[re,xe]})}]})}),i&&k&&(0,qt.jsx)(w2.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,qt.jsx)(bfe,{item:k})})]})}var s9=(0,Jt.forwardRef)(Z7e);function X7e(e,t){return(0,qt.jsx)(s9,{...e,onPatternCategorySelection:Dpe,ref:t})}var Vpe=(0,Jt.forwardRef)(X7e);var C2=c(F(),1),FC=c(G(),1),E2=c(U(),1),Fpe=c(Q(),1);var yb=c(E(),1),Q7e=6,J7e=6,eUe=2;function T2({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n,hasSearch:i=!0}){let[s,a]=(0,C2.useState)(""),[l,u]=gm({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n}),[d]=kp(l,u,!0),{setInserterIsOpened:f,insertionIndex:p}=(0,Fpe.useSelect)(g=>{let{getSettings:b,getBlockIndex:v,getBlockCount:y}=g(C),k=b(),S=v(o),_=y();return{setInserterIsOpened:k.__experimentalSetIsInserterOpened,insertionIndex:S===-1?_:S}},[o]),h=i&&d.length>Q7e;(0,C2.useEffect)(()=>{f&&f(!1)},[f]);let m=()=>{f({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:p})};return(0,yb.jsxs)("div",{className:K("block-editor-inserter__quick-inserter",{"has-search":h,"has-expand":f}),children:[h&&(0,yb.jsx)(E2.SearchControl,{className:"block-editor-inserter__search",value:s,onChange:g=>{a(g)},label:(0,FC.__)("Search"),placeholder:(0,FC.__)("Search")}),(0,yb.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,yb.jsx)(v2,{filterValue:s,onSelect:e,rootClientId:t,clientId:o,isAppender:r,maxBlockPatterns:s?eUe:0,maxBlockTypes:J7e,isDraggable:!1,selectBlockOnInsert:n,isQuick:!0})}),f&&(0,yb.jsx)(E2.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:m,"aria-label":(0,FC.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,FC.__)("Browse all")})]})}var tUe=50;function zpe(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;let o=t.__experimentalLabel(e.attributes,{context:"appender"});return typeof o=="string"&&o.length0?o:null}var lk=c(E(),1),oUe=({onToggle:e,disabled:t,isOpen:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s={}},a)=>{let{as:l=R2.Button,label:u,onClick:d,...f}=s,p=u;!p&&i?p=i:!p&&n?p=(0,jd.sprintf)((0,jd._x)("Add %s","directly add the only allowed block"),r.toLowerCase()):p||(p=(0,jd._x)("Add block","Generic label for block inserter button"));function h(m){e&&e(m),d&&d(m)}return(0,lk.jsx)(l,{ref:a,__next40pxDefaultSize:s.as?void 0:!0,icon:Ca,label:p,tooltipPosition:"bottom",onClick:h,className:"block-editor-inserter__toggle","aria-haspopup":n?!1:"true","aria-expanded":n?!1:o,isPressed:!n&&o,disabled:t,...f})},rUe=(0,a9.forwardRef)(oUe),nUe=({clientId:e,rootClientId:t,disabled:o,isAppender:r,position:n,selectBlockOnInsert:i,shouldDirectInsert:s=!0,showInserterHelpPanel:a,__experimentalIsQuick:l,onSelectOrClose:u,onToggle:d,renderToggle:f,toggleProps:p},h)=>{let{hasItems:m,hasSingleBlockType:g,blockTitle:b,allowedBlockType:v,blockToInsert:y,appenderLabel:k,targetRootClientId:S}=(0,ck.useSelect)(V=>{let{getBlockRootClientId:M,hasInserterItems:D,getAllowedBlocks:L,getDirectInsertBlock:j,getBlockListSettings:q}=V(C),{getBlockVariations:J,getBlockType:te}=V(vb.store),ee=t||M(e)||void 0,$=L(ee),W=s&&j(ee),{defaultBlock:Y}=q(ee)??{},Z=$?.length===1&&J($[0].name,"inserter")?.length===0,oe=Z?$[0]:null,ne=W||null;!ne&&Z&&Y?.name===oe.name&&(ne=Y);let X=W?te(W.name):null;return{hasItems:D(ee),hasSingleBlockType:Z,blockTitle:oe?oe.title:"",allowedBlockType:oe,blockToInsert:ne,appenderLabel:zpe(W,X),targetRootClientId:ee}},[t,e,s]),{insertBlock:_}=(0,ck.useDispatch)(C),{getBlock:x,getBlockIndex:w,getBlockOrder:T,getBlockRootClientId:B,getBlockSelectionEnd:R,getPreviousBlockClientId:I}=(0,ck.useSelect)(C),{getActiveBlockVariation:A,getBlockType:P}=(0,ck.useSelect)(vb.store);if(!m&&(r||S||e))return null;function O(){let V=y?.name??v.name;function M(te){if(!te?.length)return{};let ee;if(e){let $=x(e),W=x(I(e));$?.name===W?.name&&(ee=W?.attributes)}else if(S){let $=x(S)?.innerBlocks?.at(-1);$?.name===V&&(ee=$.attributes)}return ee?Object.fromEntries(te.filter($=>$ in ee).map($=>[$,ee[$]])):{}}function D(){if(e)return w(e);let te=R();return!r&&te&&B(te)===S?w(te)+1:T(S).length}let L=M(y?.attributesToCopy),j=(0,vb.createBlock)(V,{...y?.attributes,...L});_(j,D(),S,i),u?.(j);let q=P(V),J;if(q&&(J=(0,vb.__experimentalGetBlockLabel)(q,j.attributes),J===q.title&&(J=A(V,j.attributes)?.title||J)),J){let te=(0,jd.sprintf)((0,jd.__)("%s block added"),J);(0,jpe.speak)(te)}}function N({onToggle:V,isOpen:M}){let D={onToggle:V,isOpen:M,disabled:o||!m,blockTitle:b,hasSingleBlockType:g,appenderLabel:k,toggleProps:p};return f?f(D):(0,lk.jsx)(rUe,{ref:h,...D})}function z({onClose:V}){return l?(0,lk.jsx)(T2,{onSelect:M=>{let D=Array.isArray(M)&&M?.length?M[0]:M;u&&typeof u=="function"&&u(D),V()},rootClientId:S,clientId:e,isAppender:r,selectBlockOnInsert:i}):(0,lk.jsx)(Vpe,{onSelect:()=>{V()},onClose:V,rootClientId:S,clientId:e,isAppender:r,showInserterHelpPanel:a})}return g||y?N({onToggle:O}):(0,lk.jsx)(R2.Dropdown,{className:"block-editor-inserter",contentClassName:K("block-editor-inserter__popover",{"is-quick":l}),popoverProps:{position:n,shift:!0},onToggle:d,expandOnMobile:!0,headerTitle:(0,jd.__)("Add a block"),renderToggle:N,renderContent:z,onClose:u})},iUe=(0,a9.forwardRef)(nUe),Za=iUe;var zC=c(E(),1),sUe="\uFEFF";function uk({rootClientId:e}){let{showPrompt:t,isLocked:o,placeholder:r,isManualGrid:n}=(0,B2.useSelect)(u=>{let{getBlockCount:d,getSettings:f,getTemplateLock:p,getBlockAttributes:h}=u(C),m=!d(e),{bodyPlaceholder:g}=f();return{showPrompt:m,isLocked:!!p(e),placeholder:g,isManualGrid:h(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:i,startTyping:s}=(0,B2.useDispatch)(C);if(o||n)return null;let a=(0,Hpe.decodeEntities)(r)||(0,l9.__)("Type / to choose a block"),l=()=>{i(void 0,e),s()};return(0,zC.jsxs)("div",{"data-root-client-id":e||"",className:K("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,zC.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,l9.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(P2.ENTER===u.keyCode||P2.SPACE===u.keyCode)&&l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?a:sUe}),(0,zC.jsx)(Za,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}var Upe=c(U(),1),c9=c(F(),1),jC=c(G(),1);var Gpe=c(Rt(),1);var I2=c(E(),1);function Wpe({rootClientId:e,className:t,onFocus:o,tabIndex:r,onSelect:n},i){return(0,I2.jsx)(Za,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...s)=>{n&&typeof n=="function"&&n(...s)},renderToggle:({onToggle:s,disabled:a,isOpen:l,blockTitle:u,hasSingleBlockType:d,appenderLabel:f})=>{let p=!d,h;return f?h=f:d?h=(0,jC.sprintf)((0,jC._x)("Add %s","directly add the only allowed block"),u.toLowerCase()):h=(0,jC._x)("Add block","Generic label for block inserter button"),(0,I2.jsx)(Upe.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:o,tabIndex:r,className:K(t,"block-editor-button-block-appender"),onClick:s,"aria-haspopup":p?"true":void 0,"aria-expanded":p?l:void 0,disabled:a,label:h,showTooltip:!0,children:(0,I2.jsx)(gt,{icon:Ca})})},isAppender:!0})}var $pe=(0,c9.forwardRef)((e,t)=>((0,Gpe.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Wpe(e,t))),Sm=(0,c9.forwardRef)(Wpe);var dk=c(E(),1);function aUe({rootClientId:e}){return(0,u9.useSelect)(o=>o(C).canInsertBlockType((0,Kpe.getDefaultBlockName)(),e))?(0,dk.jsx)(uk,{rootClientId:e}):(0,dk.jsx)(Sm,{rootClientId:e,className:"block-list-appender__toggle"})}function Ype({rootClientId:e,CustomAppender:t,className:o,tagName:r="div"}){let n=(0,u9.useSelect)(i=>{let{getBlockInsertionPoint:s,isBlockInsertionPointVisible:a,getBlockCount:l}=i(C),u=s();return a()&&e===u?.rootClientId&&l(e)===0},[e]);return(0,dk.jsx)(r,{tabIndex:-1,className:K("block-list-appender wp-block",o,{"is-drag-over":n}),contentEditable:!1,"data-block":!0,children:t?(0,dk.jsx)(t,{}):(0,dk.jsx)(aUe,{rootClientId:e})})}var cme=c(fe(),1),UC=c(Q(),1),ume=c(F(),1),dme=c(G(),1);var fk=c(Q(),1),_m=c(F(),1),L2=c(U(),1),ame=c(fe(),1);var Xpe=c(Q(),1),km=c(F(),1),Qpe=c(U(),1),Jpe=c(G(),1);var Zpe=c(fe(),1),d9=c(Tt(),1),qpe=new WeakMap;function lUe(e){let t=(0,Zpe.useRefEffect)(o=>{function r(i){let{deltaX:s,deltaY:a,target:l}=i,u=e.current,d=qpe.get(u);d||(d=(0,d9.getScrollContainer)(u),qpe.set(u,d));let f=(0,d9.getScrollContainer)(l);o.contains(f)||d.scrollBy(s,a)}let n={passive:!0};return o.addEventListener("wheel",r,n),()=>{o.removeEventListener("wheel",r,n)}},[e]);return e?t:null}var Sb=lUe;var f9=c(E(),1),cUe=Number.MAX_SAFE_INTEGER;function uUe({previousClientId:e,nextClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,operation:i="insert",nearestSide:s="right",...a}){let[l,u]=(0,km.useReducer)(y=>(y+1)%cUe,0),{orientation:d,rootClientId:f,isVisible:p}=(0,Xpe.useSelect)(y=>{let{getBlockListSettings:k,getBlockRootClientId:S,isBlockVisible:_}=y(C),x=S(e??t);return{orientation:k(x)?.orientation||"vertical",rootClientId:x,isVisible:_(e)&&_(t)}},[e,t]),h=Nt(e),m=Nt(t),g=d==="vertical",b=(0,km.useMemo)(()=>l<0||!h&&!m||!p?void 0:{contextElement:i==="group"?m||h:h||m,getBoundingClientRect(){let k=h?h.getBoundingClientRect():null,S=m?m.getBoundingClientRect():null,_=0,x=0,w=0,T=0;if(i==="group"){let B=S||k;x=B.top,w=0,T=B.bottom-B.top,_=s==="left"?B.left-2:B.right-2}else g?(x=k?k.bottom:S.top,w=k?k.width:S.width,T=S&&k?S.top-k.bottom:0,_=k?k.left:S.left):(x=k?k.top:S.top,T=k?k.height:S.height,(0,Jpe.isRTL)()?(_=S?S.right:k.left,w=k&&S?k.left-S.right:0):(_=k?k.right:S.left,w=k&&S?S.left-k.right:0),w=Math.max(w,0));return new window.DOMRect(_,x,w,T)}},[h,m,l,g,p,i,s]),v=Sb(n);return(0,km.useLayoutEffect)(()=>{if(!h)return;let y=new window.MutationObserver(u);return y.observe(h,{attributes:!0}),()=>{y.disconnect()}},[h]),(0,km.useLayoutEffect)(()=>{if(!m)return;let y=new window.MutationObserver(u);return y.observe(m,{attributes:!0}),()=>{y.disconnect()}},[m]),(0,km.useLayoutEffect)(()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",u),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",u)}},[h]),!h&&!m||!p?null:(0,f9.jsx)(Qpe.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:K("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,f9.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:o})},t+"--"+f)}var O2=uUe;var rme=c(Q(),1),nme=c(fe(),1),ime=c(U(),1);var Ud=c(F(),1);var eme=c(fe(),1),tme=c(U(),1),Hd=c(F(),1);var p9=c(E(),1),dUe=Number.MAX_SAFE_INTEGER;function fUe({clientId:e,bottomClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,shift:i=!0,...s},a){let l=Nt(e),u=Nt(t??e),d=(0,eme.useMergeRefs)([a,Sb(n)]),[f,p]=(0,Hd.useReducer)(m=>(m+1)%dUe,0);(0,Hd.useLayoutEffect)(()=>{if(!l)return;let m,g=new window.MutationObserver(()=>{m||(m=window.requestAnimationFrame(()=>{m=null,p()}))});return g.observe(l,{attributes:!0}),()=>{g.disconnect(),m&&window.cancelAnimationFrame(m)}},[l]);let h=(0,Hd.useMemo)(()=>{if(!(f<0||!l||t&&!u))return{getBoundingClientRect(){return u?Mj(Nv(l),Nv(u)):Nv(l)},contextElement:l}},[f,l,t,u]);return!l||t&&!u?null:(0,p9.jsx)(tme.Popover,{ref:d,animate:!1,focusOnMount:!1,anchor:h,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:K("block-editor-block-popover",s.className),variant:"unstyled",children:o})}var kb=(0,Hd.forwardRef)(fUe),pUe=({clientId:e,bottomClientId:t,children:o,...r},n)=>(0,p9.jsx)(kb,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:n,children:o}),ome=(0,Hd.forwardRef)(pUe);var A2=c(E(),1);function mUe({clientId:e,bottomClientId:t,children:o,shift:r=!1,additionalStyles:n,...i},s){t??=e;let a=Nt(e);return(0,A2.jsx)(kb,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:a&&e===t?(0,A2.jsx)(hUe,{selectedElement:a,additionalStyles:n,children:o}):o})}function hUe({selectedElement:e,additionalStyles:t={},children:o}){let[r,n]=(0,Ud.useState)(e.offsetWidth),[i,s]=(0,Ud.useState)(e.offsetHeight);(0,Ud.useEffect)(()=>{let l=new window.ResizeObserver(()=>{n(e.offsetWidth),s(e.offsetHeight)});return l.observe(e,{box:"border-box"}),()=>l.disconnect()},[e]);let a=(0,Ud.useMemo)(()=>({position:"absolute",width:r,height:i,...t}),[r,i,t]);return(0,A2.jsx)("div",{style:a,children:o})}var Xa=(0,Ud.forwardRef)(mUe);var m9=c(E(),1),HC={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function gUe({__unstablePopoverSlot:e,__unstableContentRef:t}){let{clientId:o}=(0,rme.useSelect)(n=>{let{getBlockOrder:i,getBlockInsertionPoint:s}=n(C),a=s(),l=i(a.rootClientId);return l.length?{clientId:l[a.index]}:{}},[]),r=(0,nme.useReducedMotion)();return(0,m9.jsx)(Xa,{clientId:o,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,m9.jsx)(ime.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?HC.show:HC.hide,animate:HC.show,exit:r?HC.show:HC.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}var sme=gUe;var Gd=c(E(),1),pk=(0,_m.createContext)();pk.displayName="InsertionPointOpenRefContext";function bUe({__unstablePopoverSlot:e,__unstableContentRef:t,operation:o="insert",nearestSide:r="right"}){let{selectBlock:n,hideInsertionPoint:i}=(0,fk.useDispatch)(C),s=(0,_m.useContext)(pk),a=(0,_m.useRef)(),{orientation:l,previousClientId:u,nextClientId:d,rootClientId:f,isInserterShown:p,isDistractionFree:h,isZoomOutMode:m}=(0,fk.useSelect)(B=>{let{getBlockOrder:R,getBlockListSettings:I,getBlockInsertionPoint:A,isBlockBeingDragged:P,getPreviousBlockClientId:O,getNextBlockClientId:N,getSettings:z,isZoomOut:V}=H(B(C)),M=A(),D=R(M.rootClientId);if(!D.length)return{};let L=D[M.index-1],j=D[M.index];for(;P(L);)L=O(L);for(;P(j);)j=N(j);let q=z();return{previousClientId:L,nextClientId:j,orientation:I(M.rootClientId)?.orientation||"vertical",rootClientId:M.rootClientId,isDistractionFree:q.isDistractionFree,isInserterShown:M?.__unstableWithInserter,isZoomOutMode:V()}},[]),{getBlockEditingMode:g}=(0,fk.useSelect)(C),b=(0,ame.useReducedMotion)();function v(B){B.target===a.current&&d&&g(d)!=="disabled"&&n(d,-1)}function y(B){B.target===a.current&&!s.current&&i()}function k(B){B.target!==a.current&&(s.current=!0)}let S=(0,_m.useCallback)(B=>{!B&&s.current&&(s.current=!1)},[s]),_={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:p?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},x={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h||m&&o!=="insert")return null;let T=K("block-editor-block-list__insertion-point",l==="horizontal"||o==="group"?"is-horizontal":"is-vertical");return(0,Gd.jsx)(O2,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:o,nearestSide:r,children:(0,Gd.jsxs)(L2.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:v,onFocus:k,className:K(T,{"is-with-inserter":p}),onHoverEnd:y,children:[(0,Gd.jsx)(L2.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),p&&(0,Gd.jsx)(L2.__unstableMotion.div,{variants:x,className:K("block-editor-block-list__insertion-point-inserter"),children:(0,Gd.jsx)(Za,{ref:S,position:"bottom center",clientId:d,rootClientId:f,__experimentalIsQuick:!0,onToggle:B=>{s.current=B},onSelectOrClose:()=>{s.current=!1}})})]})})}function lme(e){let{insertionPoint:t,isVisible:o,isBlockListEmpty:r}=(0,fk.useSelect)(n=>{let{getBlockInsertionPoint:i,isBlockInsertionPointVisible:s,getBlockCount:a}=n(C),l=i();return{insertionPoint:l,isVisible:s(),isBlockListEmpty:a(l?.rootClientId)===0}},[]);return!o||r?null:t.operation==="replace"?(0,Gd.jsx)(sme,{...e},`${t.rootClientId}-${t.index}`):(0,Gd.jsx)(bUe,{operation:t.operation,nearestSide:t.nearestSide,...e})}function fme(){let e=(0,ume.useContext)(pk),t=(0,UC.useSelect)(g=>{let b=g(C).getSettings();return b.isDistractionFree||b.isPreviewMode||H(g(C)).isZoomOut()},[]),{getBlockListSettings:o,getBlockIndex:r,isMultiSelecting:n,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:f,getParentSectionBlock:p}=H((0,UC.useSelect)(C)),{showInsertionPoint:h,hideInsertionPoint:m}=(0,UC.useDispatch)(C);return(0,cme.useRefEffect)(g=>{if(t)return;function b(v){if(e===void 0||e.current||v.target.nodeType===v.target.TEXT_NODE||n())return;if(!v.target.classList.contains("block-editor-block-list__layout")){m();return}let y;if(v.target.classList.contains("is-root-container")||(y=(v.target.getAttribute("data-block")?v.target:v.target.closest("[data-block]")).getAttribute("data-block")),a(y)||u(y)==="disabled"||d(y)==="core/block"||y&&f(y).layout?.isManualPlacement)return;let k=o(y),S=k?.orientation||"vertical",_=!!k?.__experimentalCaptureToolbars,x=v.clientY,w=v.clientX,B=Array.from(v.target.children).find(P=>{let O=P.getBoundingClientRect();return P.classList.contains("wp-block")&&S==="vertical"&&O.top>x||P.classList.contains("wp-block")&&S==="horizontal"&&((0,dme.isRTL)()?O.rightw)});if(!B){m();return}if(!B.id&&(B=B.firstElementChild,!B)){m();return}let R=B.id.slice(6);if(!R||l(R)||p(R)||i().includes(R)&&S==="vertical"&&!_&&!s().hasFixedToolbar)return;let I=B.getBoundingClientRect();if(S==="horizontal"&&(v.clientY>I.bottom||v.clientYI.right||v.clientX{g.removeEventListener("mousemove",b)}},[e,o,r,n,h,m,i,t])}var M2=c(Q(),1),pme=c(fe(),1);var mme=c(E(),1);function _b(){let{getSettings:e,hasSelectedBlock:t,hasMultiSelection:o}=(0,M2.useSelect)(C),{clearSelectedBlock:r}=(0,M2.useDispatch)(C),{clearBlockSelection:n}=e();return(0,pme.useRefEffect)(i=>{if(!n)return;function s(a){!t()&&!o()||a.target===i&&r()}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[t,o,r,n])}function hme(e){return(0,mme.jsx)("div",{ref:_b(),...e})}var Nme=c(fe(),1),hk=c(F(),1),Dme=c(Q(),1),Eb=c(ue(),1);var gme=c(E(),1);function bme({showSeparator:e,isFloating:t,onAddBlock:o,isToggle:r}){let{clientId:n}=ht();return(0,gme.jsx)(Sm,{className:K({"block-list-appender__toggle":r}),rootClientId:n,showSeparator:e,isFloating:t,onAddBlock:o})}var yme=c(E(),1);function vme(){let{clientId:e}=ht();return(0,yme.jsx)(uk,{rootClientId:e})}var D2=c(F(),1),_me=c(Q(),1),N2=c(Rt(),1),xme=c(GC(),1);var WC=new WeakMap;function yUe(){let e;return t=>((e===void 0||!(0,xme.isShallowEqual)(e,t))&&(e=t),e)}function kme(e){let[t]=(0,D2.useState)(yUe);return t(e)}function wme(e,t,o,r,n,i,s,a,l,u,d,f){let p=(0,_me.useRegistry)(),h=kme(o),m=kme(r),g=l===void 0||t==="contentOnly"?t:l;(0,D2.useLayoutEffect)(()=>{let b={allowedBlocks:h,prioritizedInserterBlocks:m,templateLock:g};if(u!==void 0&&(b.__experimentalCaptureToolbars=u),d!==void 0)b.orientation=d;else{let v=Ba(f?.type);b.orientation=v.getOrientation(f)}s!==void 0&&((0,N2.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),b.defaultBlock=s),n!==void 0&&(b.defaultBlock=n),a!==void 0&&((0,N2.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),b.directInsert=a),i!==void 0&&(b.directInsert=i),b.directInsert!==void 0&&typeof b.directInsert!="boolean"&&(0,N2.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),WC.get(p)||WC.set(p,{}),WC.get(p)[e]=b,window.queueMicrotask(()=>{let v=WC.get(p);if(Object.keys(v).length){let{updateBlockListSettings:y}=p.dispatch(C);y(v),WC.set(p,{})}})},[e,h,m,g,n,i,s,a,u,d,f,p])}var h9=c(Xh(),1),V2=c(F(),1),Cme=c(Q(),1),Eme=c(ue(),1);function Tme(e,t,o,r){let n=(0,Cme.useRegistry)(),i=(0,V2.useRef)(null);(0,V2.useLayoutEffect)(()=>{let s=!1,{getBlocks:a,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:u}=n.select(C),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(C);return window.queueMicrotask(()=>{if(s)return;let p=a(e),h=p.length===0||o==="all"||o==="contentOnly",m=!(0,h9.default)(t,i.current);if(!h||!m)return;i.current=t;let g=(0,Eme.synchronizeBlocksWithTemplate)(p,t);(0,h9.default)(g,p)||(f({history:"ignore"}),d(e,g,p.length===0&&r&&g.length!==0&&u(e),l()))}),()=>{s=!0}},[t,o,e,n,r])}var Rme=c(ue(),1),Bme=c(Q(),1);function Pme(e){return(0,Bme.useSelect)(t=>{let o=t(C).getBlock(e);if(!o)return;let r=t(Rme.store).getBlockType(o.name);if(r&&Object.keys(r.providesContext).length!==0)return Object.fromEntries(Object.entries(r.providesContext).map(([n,i])=>[n,o.attributes[i]]))},[e])}var Cb=c(Q(),1),j2=c(F(),1),H2=c(fe(),1),Lme=c(G(),1),mk=c(ue(),1);var g9=c(F(),1),_s=c(ue(),1),xb=c(Q(),1),Ime=c(Tt(),1);function b9(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function vUe(e,t,o,r,n,i,s,a,l){return u=>{let{srcRootClientId:d,srcClientIds:f,type:p,blocks:h}=b9(u);if(p==="inserter"){s();let m=h.map(g=>(0,_s.cloneBlock)(g));i(m,!0,null)}if(p==="block"){let m=o(f[0]);if(d===e&&m===t||f.includes(e)||r(f).some(y=>y===e))return;if(a==="group"){let y=f.map(k=>l(k));i(y,!0,null,f);return}let g=d===e,b=f.length,v=g&&m{if(!t().mediaUpload)return;let s=(0,_s.findTransform)((0,_s.getBlockTransforms)("from"),a=>a.type==="files"&&r(a.blockName,e)&&a.isMatch(i));if(s){let a=s.transform(i,o);n(a)}}}function kUe(e){return t=>{let o=(0,_s.pasteHandler)({HTML:t,mode:"BLOCKS"});o.length&&e(o)}}function F2(e,t,o={}){let{operation:r="insert",nearestSide:n="right"}=o,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:l,getBlocksByClientId:u,getSettings:d,getBlock:f}=(0,xb.useSelect)(C),{getGroupingBlockName:p}=(0,xb.useSelect)(_s.store),{insertBlocks:h,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:v,removeBlocks:y}=(0,xb.useDispatch)(C),k=(0,xb.useRegistry)(),S=(0,g9.useCallback)((B,R=!0,I=0,A=[])=>{Array.isArray(B)||(B=[B]);let O=l(e)[t];if(r==="replace")v(O,B,void 0,I);else if(r==="group"){let N=f(O);n==="left"?B.push(N):B.unshift(N);let z=B.map(L=>(0,_s.cloneSanitizedBlock)(L)),V=B.every(L=>L.name==="core/image"),M=i("core/gallery",e),D=(0,_s.createBlock)(V&&M?"core/gallery":p(),{layout:{type:"flex",flexWrap:V&&M?null:"nowrap"}},z);v([O,...A],D,void 0,I)}else h(B,t,e,R,I)},[l,e,t,r,v,f,n,i,p,h]),_=(0,g9.useCallback)((B,R,I)=>{if(r==="replace"){let A=u(B),O=l(e)[t];k.batch(()=>{y(B,!1),v(O,A,void 0,0)})}else m(B,R,e,I)},[r,l,u,m,k,y,v,t,e]),x=vUe(e,t,s,a,_,S,b,r,f),w=SUe(e,d,g,i,S),T=kUe(S);return B=>{let R=(0,Ime.getFilesFromDataTransfer)(B.dataTransfer),I=B.dataTransfer.getData("text/html");I?T(I):R.length?w(R):x(B)}}function _Ue(e,t,o){let r=o==="top"||o==="bottom",{x:n,y:i}=e,s=r?n:i,a=r?i:n,l=r?t.left:t.top,u=r?t.right:t.bottom,d=t[o],f;return s>=l&&s<=u?f=s:s{let s=_Ue(e,t,i);(r===void 0||s=e.x&&t.top<=e.y&&t.bottom>=e.y}function Ome(e,t){return t.top<=e.y&&t.bottom>=e.y}var y9=30,xUe=120,wUe=120;function CUe(e,t,o="vertical",r={}){let n=o==="horizontal"?["left","right"]:["top","bottom"],i=0,s="before",a=1/0,l=null,u="right",{dropZoneElement:d,parentBlockOrientation:f,rootBlockIndex:p=0}=r;if(d&&f!=="horizontal"){let v=d.getBoundingClientRect(),[y,k]=wb(t,v,["top","bottom"]);if(v.height>xUe&&ywUe&&y{let _=y();if(!_)return;let[x,w]=wb(t,_,n),[T,B]=wb(t,_,["left","right"]),R=z2(t,_);v&&R?x=0:o==="vertical"&&S!=="horizontal"&&(R&&Tl);n=o.every(l=>a?.includes(l))}let s=o.map(a=>e(a)).every(a=>{let[l]=a?.parent||[];return l?l===r:!0});return n&&s}function Ame(e,t){let{defaultView:o}=t;return!!(o&&e instanceof o.HTMLElement&&e.closest("[data-is-insertion-point]"))}function Mme({dropZoneElement:e,rootClientId:t="",parentClientId:o="",isDisabled:r=!1}={}){let n=(0,Cb.useRegistry)(),[i,s]=(0,j2.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:l,getGroupingBlockName:u}=(0,Cb.useSelect)(mk.store),{canInsertBlockType:d,getBlockListSettings:f,getBlocks:p,getBlockIndex:h,getDraggedBlockClientIds:m,getBlockNamesByClientId:g,getAllowedBlocks:b,isDragging:v,isGroupable:y,isZoomOut:k,getSectionRootClientId:S,getBlockParents:_}=H((0,Cb.useSelect)(C)),{showInsertionPoint:x,hideInsertionPoint:w,startDragging:T,stopDragging:B}=H((0,Cb.useDispatch)(C)),R=F2(i.operation==="before"||i.operation==="after"?o:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),I=(0,H2.useThrottle)((0,j2.useCallback)((A,P)=>{v()||T();let O=m(),N=[t,..._(t,!0)];if(O.some(Z=>N.includes(Z)))return;let V=b(t),M=g([t])[0],D=g(O);if(!U2(a,V,D,M))return;let j=S();if(k()&&j!==t)return;let q=p(t).filter(Z=>!((0,mk.hasBlockSupport)(Z.name,"visibility",!0)&&Z.attributes?.metadata?.blockVisibility===!1));if(q.length===0){n.batch(()=>{s({index:0,operation:"insert"}),x(t,0,{operation:"insert"})});return}let J=q.map(Z=>{let oe=Z.clientId;return{isUnmodifiedDefaultBlock:(0,mk.isUnmodifiedDefaultBlock)(Z),getBoundingClientRect:()=>{let ne=P.getElementById(`block-${oe}`);return ne?ne.getBoundingClientRect():null},blockIndex:h(oe),blockOrientation:f(oe)?.orientation}}),te=CUe(J,{x:A.clientX,y:A.clientY},f(t)?.orientation,{dropZoneElement:e,parentBlockClientId:o,parentBlockOrientation:o?f(o)?.orientation:void 0,rootBlockIndex:h(t)}),[ee,$,W]=te,Y=J[ee]?.isUnmodifiedDefaultBlock;if(!(k()&&!Y&&$!=="insert")){if($==="group"){let Z=q[ee],oe=[Z.name,...D].every(ve=>ve==="core/image"),ne=d("core/gallery",t),X=y([Z.clientId,m()]),re=l(u(),"block"),ae=re&&re.find(({name:ve})=>ve==="group-row");if(oe&&!ne&&(!X||!ae)||!oe&&(!X||!ae))return}n.batch(()=>{s({index:ee,operation:$,nearestSide:W});let Z=["before","after"].includes($)?o:t;x(Z,ee,{operation:$,nearestSide:W})})}},[v,b,t,g,m,a,S,k,p,f,e,o,h,n,T,x,d,y,l,u]),200);return(0,H2.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:r,onDrop:R,onDragOver(A){I(A,A.currentTarget.ownerDocument)},onDragLeave(A){let{ownerDocument:P}=A.currentTarget;Ame(A.relatedTarget,P)||Ame(A.target,P)||(I.cancel(),w())},onDragEnd(){I.cancel(),B(),w()}})}var Wd=c(E(),1),EUe={};function TUe({children:e,clientId:t}){let o=Pme(t);return(0,Wd.jsx)(sT,{value:o,children:e})}var RUe=(0,hk.memo)(BC);function Vme(e){let{clientId:t,allowedBlocks:o,prioritizedInserterBlocks:r,defaultBlock:n,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:l,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:h,renderAppender:m,orientation:g,placeholder:b,layout:v,name:y,blockType:k,parentLock:S,defaultLayout:_}=e;wme(t,S,o,r,n,i,s,a,u,p,g,v),Tme(t,l,u,f);let x=(0,Eb.getBlockSupport)(y,"layout")||(0,Eb.getBlockSupport)(y,"__experimentalLayout")||EUe,{allowSizingOnChildren:w=!1}=x,T=v||x,B=(0,hk.useMemo)(()=>({..._,...T,...w&&{allowSizingOnChildren:!0}}),[_,T,w]),R=(0,Wd.jsx)(RUe,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:h,layout:B,wrapperRef:d,placeholder:b});return!k?.providesContext||Object.keys(k.providesContext).length===0?R:(0,Wd.jsx)(TUe,{clientId:t,children:R})}function BUe(e){return hA(e),(0,Wd.jsx)(Vme,{...e})}var G2=(0,hk.forwardRef)((e,t)=>{let o=Tb({ref:t},e);return(0,Wd.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Wd.jsx)("div",{...o})})});function Tb(e={},t={}){let{__unstableDisableLayoutClassNames:o,__unstableDisableDropZone:r,dropZoneElement:n}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=ht(),l=(0,Dme.useSelect)(S=>{let{getBlockName:_,isZoomOut:x,getTemplateLock:w,getBlockRootClientId:T,getBlockEditingMode:B,getBlockSettings:R,getSectionRootClientId:I}=H(S(C));if(!i){let D=I();return{isDropZoneDisabled:x()&&D!==""}}let{hasBlockSupport:A,getBlockType:P}=S(Eb.store),O=_(i),N=B(i),z=T(i),[V]=R(i,"layout"),M=N==="disabled";if(x()){let D=I();M=i!==D}return{__experimentalCaptureToolbars:A(O,"__experimentalExposeControlsToChildren",!1),name:O,blockType:P(O),parentLock:w(z),parentClientId:z,isDropZoneDisabled:M,defaultLayout:V}},[i]),{__experimentalCaptureToolbars:u,name:d,blockType:f,parentLock:p,parentClientId:h,isDropZoneDisabled:m,defaultLayout:g}=l,b=Mme({dropZoneElement:n,rootClientId:i,parentClientId:h}),v=(0,Nme.useMergeRefs)([e.ref,r||m||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:b]),y={__experimentalCaptureToolbars:u,layout:s,name:d,blockType:f,parentLock:p,defaultLayout:g,...t},k=y.value&&y.onChange?BUe:Vme;return{...e,ref:v,className:K(e.className,"block-editor-block-list__layout",o?"":a),children:i?(0,Wd.jsx)(k,{...y,clientId:i}):(0,Wd.jsx)(BC,{...t})}}Tb.save=Eb.__unstableGetInnerBlocksProps;G2.DefaultBlockAppender=vme;G2.ButtonBlockAppender=bme;G2.Content=()=>Tb.save().children;var $C=G2;var KC=c(U(),1),Fme=c(fe(),1),zme=c(Q(),1),jme=c(F(),1),Hme=c(G(),1);var W2=c(E(),1);function v9({clientId:e,rootClientId:t="",position:o="top"}){let[r,n]=(0,jme.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:l,blockInsertionPoint:u,blocksBeingDragged:d}=(0,zme.useSelect)(_=>{let{getInsertionPoint:x,getBlockOrder:w,getSectionRootClientId:T,isBlockInsertionPointVisible:B,getBlockInsertionPoint:R,getDraggedBlockClientIds:I}=H(_(C)),A=T(),P=w(A);return{sectionRootClientId:A,sectionClientIds:P,insertionPoint:x(),blockInsertionPoint:R(),blockInsertionPointVisible:B(),blocksBeingDragged:I()}},[]),f=(0,Fme.useReducedMotion)();if(!e)return;let p=!1;if(!(t===i&&s&&s.includes(e)))return null;let m=a?.index===0&&e===s[a.index],g=a&&a.hasOwnProperty("index")&&e===s[a.index-1];o==="top"&&(p=m||l&&u.index===0&&e===s[u.index]),o==="bottom"&&(p=g||l&&e===s[u.index-1]);let b=d[0],v=d.includes(e),y=s.indexOf(b),S=(y>0?s[y-1]:null)===e;return(v||S)&&(p=!1),(0,W2.jsx)(KC.__unstableAnimatePresence,{children:p&&(0,W2.jsx)(KC.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:f?0:.2,ease:[.6,0,.4,1]},className:K("block-editor-block-list__zoom-out-separator",{"is-dragged-over":r}),"data-is-insertion-point":"true",onDragOver:()=>n(!0),onDragLeave:()=>n(!1),children:(0,W2.jsx)(KC.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,Hme.__)("Drop pattern.")})})})}var ji=c(E(),1),iI=(0,xm.createContext)();iI.displayName="IntersectionObserverContext";var $2=new WeakMap,PUe={trailing:!0};function IUe({className:e,...t}){let{isOutlineMode:o,isFocusMode:r,isPreviewMode:n,editedContentOnlySection:i}=(0,Qa.useSelect)(f=>{let{getSettings:p,isTyping:h,hasBlockSpotlight:m,getEditedContentOnlySection:g}=H(f(C)),{outlineMode:b,focusMode:v,isPreviewMode:y}=p();return{isOutlineMode:b&&!h(),isFocusMode:v||m(),isPreviewMode:y,editedContentOnlySection:g()}},[]),s=(0,Qa.useRegistry)(),{setBlockVisibility:a}=(0,Qa.useDispatch)(C),l=(0,K2.useDebounce)((0,xm.useCallback)(()=>{let f={};$2.get(s).forEach(([p,h])=>{f[p]=h}),a(f)},[s]),300,PUe),u=(0,xm.useMemo)(()=>{let{IntersectionObserver:f}=window;if(f)return new f(p=>{$2.get(s)||$2.set(s,[]);for(let h of p){let m=h.target.getAttribute("data-block");$2.get(s).push([m,h.isIntersecting])}l()})},[]),d=Tb({ref:(0,K2.useMergeRefs)([_b(),fme()]),className:K("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r,"is-preview-mode":n})},t);return(0,ji.jsxs)(iI.Provider,{value:u,children:[(0,ji.jsx)("div",{...d}),!!i&&(0,ji.jsx)(OUe,{clientId:i})]})}function OUe({clientId:e}){let{stopEditingContentOnlySection:t}=H((0,Qa.useDispatch)(C)),o=(0,Qa.useSelect)(r=>{let{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:s}=r(C);return!s()||n(e)||i(e,!0)},[e]);return(0,xm.useEffect)(()=>{o||t()},[o,t]),null}function HS(e){return(0,ji.jsx)(oT,{value:vF,children:(0,ji.jsx)(IUe,{...e})})}var AUe=[],LUe=new Set;function MUe({placeholder:e,rootClientId:t,renderAppender:o,__experimentalAppenderTagName:r,layout:n=Lz}){let i=o!==!1,s=!!o,{order:a,isZoomOut:l,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:f}=(0,Qa.useSelect)(p=>{let{getSettings:h,getBlockOrder:m,getSelectedBlockClientIds:g,__unstableGetVisibleBlocks:b,getTemplateLock:v,getBlockEditingMode:y,isSectionBlock:k,isContainerInsertableToInContentOnlyMode:S,getBlockName:_,isZoomOut:x,canInsertBlockType:w}=H(p(C)),T=m(t);if(h().isPreviewMode)return{order:T,selectedBlocks:AUe,visibleBlocks:LUe};let B=g(),R=B[0],I=!t&&!R&&(!T.length||!w((0,Ume.getDefaultBlockName)(),t)),A=!!(t&&R&&t===R),P=v(t);return{order:T,selectedBlocks:B,visibleBlocks:b(),isZoomOut:x(),shouldRenderAppender:(!k(t)||S(_(R),t))&&y(t)!=="disabled"&&(!P||P==="contentOnly")&&i&&!x()&&(s||A||I)}},[t,i,s]);return(0,ji.jsxs)(dP,{value:n,children:[a.map(p=>(0,ji.jsxs)(Qa.AsyncModeProvider,{value:!d.has(p)&&!u.includes(p),children:[l&&(0,ji.jsx)(v9,{clientId:p,rootClientId:t,position:"top"}),(0,ji.jsx)(gI,{rootClientId:t,clientId:p}),l&&(0,ji.jsx)(v9,{clientId:p,rootClientId:t,position:"bottom"})]},p)),a.length<1&&e,f&&(0,ji.jsx)(Ype,{tagName:r,rootClientId:t,CustomAppender:o})]})}function BC(e){return(0,ji.jsx)(Qa.AsyncModeProvider,{value:!1,children:(0,ji.jsx)(MUe,{...e})})}var Fk=c(Q(),1),iG=c(Tt(),1),sG=c(U(),1),pye=c(Yl(),1),uM=c(F(),1),dM=c(ue(),1),aG=c(Qr(),1),zk=c(G(),1);var She=c(fe(),1),khe=c(Q(),1),_he=c(Tt(),1),Su=c(F(),1);var fc=c(G(),1),Bb=c(ue(),1),mhe=c(fe(),1),hhe=c(Q(),1),rL=c(F(),1);var ZC=c(U(),1),Xme=c(Yw(),1),Qme=c(Rt(),1),bk=c(F(),1);var Rn=c(U(),1),Gme=(0,Rn.createSlotFill)("InspectorControls"),NUe=(0,Rn.createSlotFill)("InspectorAdvancedControls"),DUe=(0,Rn.createSlotFill)("InspectorControlsBindings"),VUe=(0,Rn.createSlotFill)("InspectorControlsBackground"),FUe=(0,Rn.createSlotFill)("InspectorControlsBorder"),zUe=(0,Rn.createSlotFill)("InspectorControlsColor"),jUe=(0,Rn.createSlotFill)("InspectorControlsFilter"),HUe=(0,Rn.createSlotFill)("InspectorControlsDimensions"),UUe=(0,Rn.createSlotFill)("InspectorControlsLayout"),GUe=(0,Rn.createSlotFill)("InspectorControlsElements"),WUe=(0,Rn.createSlotFill)("InspectorControlsPosition"),$Ue=(0,Rn.createSlotFill)("InspectorControlsTypography"),KUe=(0,Rn.createSlotFill)("InspectorControlsListView"),YUe=(0,Rn.createSlotFill)("InspectorControlsStyles"),qUe=(0,Rn.createSlotFill)("InspectorControlsEffects"),ZUe=(0,Rn.createSlotFill)("InspectorControlsContent"),XUe={default:Gme,advanced:NUe,background:VUe,bindings:DUe,border:FUe,color:zUe,content:ZUe,dimensions:HUe,effects:qUe,elements:GUe,filter:jUe,layout:UUe,list:KUe,position:WUe,settings:Gme,styles:YUe,typography:$Ue},dc=XUe,YC=(0,Rn.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));var Y2=c(F(),1);var qC="default",Js={viewport:qC,pseudo:qC},Wme=(0,Y2.createContext)(Js),q2=Wme.Provider;function Ja(){return(0,Y2.useContext)(Wme)}function Hi(e){return!!e?.viewport&&e.viewport!==qC}function ea(e){return!!e?.pseudo&&e.pseudo!==qC}function Bn(e){return!Hi(e)&&!ea(e)}function $me(e){return Bn(e)?[]:[e.viewport,e.pseudo].filter(t=>t&&t!==qC)}function To(e,t){let o=$me(t);return o.length?cd(e,o):e}function Pn(e,t,o){let r=$me(t);return r.length?Ge(De(e,r,o)):Ge(o)}function Kme(e,t){return!t||Bn(e)?t:o=>{let r=To(o?.style,e)||{},n=t({style:r}),i=n&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.hasOwnProperty.call(n,"style")?n.style:n;return{style:Pn(o?.style,e,i)}}}var gk=c(U(),1),X2=c(F(),1),Yme=c(fe(),1),Q2=c(Q(),1);var Z2=c(E(),1),qme=Symbol("ListViewContentPopover"),{Fill:Zme,Slot:QUe}=(0,gk.createSlotFill)(qme);function JUe(){return(0,Yme.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}}}function J2({listViewRef:e}){let{popoverProps:t}=JUe(),o=(0,gk.__experimentalUseSlotFills)(qme),r=!!(o&&o.length),{selectedClientId:n,isOpen:i}=(0,Q2.useSelect)(u=>{let{getSelectedBlockClientId:d}=u(C),f=H(u(C));return{selectedClientId:d(),isOpen:f.isListViewContentPanelOpen()}},[]),[s,a]=(0,X2.useState)(null);(0,X2.useLayoutEffect)(()=>{if(!n||!e?.current){a(null);return}let u=e.current.querySelector(`[data-block="${n}"]`);a(u)},[n,e]);let{closeListViewContentPanel:l}=H((0,Q2.useDispatch)(C));return!i||!r||!s?null:(0,Z2.jsx)(gk.Popover,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:l,children:(0,Z2.jsx)("div",{style:{width:"280px"},children:(0,Z2.jsx)(QUe,{})})})}var wm=c(E(),1),e9e=["content","list"];function Rb({children:e,group:t="default",__experimentalGroup:o,resetAllFilter:r}){o&&((0,Qme.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=o);let n=ht(),i=dc[t]?.Fill;if(!i)return(0,Xme.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(n[Kf]){let s=n.name==="core/template-part",a=e9e.includes(t);if(!(s||a))return null}return!n[Kf]&&!n[Dl]?null:t==="content"&&n[Bx]&&n[Kf]?n[Dl]?(0,wm.jsx)(ZC.__experimentalStyleProvider,{document,children:(0,wm.jsx)(Zme,{children:e})}):null:(0,wm.jsx)(ZC.__experimentalStyleProvider,{document,children:(0,wm.jsx)(i,{children:s=>(0,wm.jsx)(o9e,{fillProps:s,children:e,resetAllFilter:r})})})}function t9e({resetAllFilter:e,children:t}){let{registerResetAllFilter:o,deregisterResetAllFilter:r}=(0,bk.useContext)(ZC.__experimentalToolsPanelContext),n=Ja(),i=(0,bk.useMemo)(()=>Kme(n,e),[e,n]);return(0,bk.useEffect)(()=>{if(i&&o&&r)return o(i),()=>{r(i)}},[i,o,r]),t}function o9e({children:e,resetAllFilter:t,fillProps:o}){let{forwardedContext:r=[]}=o,n=(0,wm.jsx)(t9e,{resetAllFilter:t,children:e});return r.reduce((i,[s,a])=>(0,wm.jsx)(s,{...a,children:i}),n)}var she=c(U(),1),ahe=c(F(),1),lhe=c(Yw(),1),che=c(Rt(),1);var ehe=c(U(),1),eL=c(Q(),1),the=c(F(),1);var Jme=c(fe(),1);function xr(){return(0,Jme.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function yk(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}var ohe=c(E(),1);function rhe({children:e,group:t,label:o}){let{updateBlockAttributes:r}=(0,eL.useDispatch)(C),{getBlockAttributes:n,getBlockName:i,getMultiSelectedBlockClientIds:s,getSelectedBlockClientId:a,hasMultiSelection:l}=(0,eL.useSelect)(C),u=xr(),d=a(),f=(0,the.useCallback)((p=[])=>{let h={},m=l()?s():[d];m.forEach(g=>{let b=n(g)||{},{style:v}=b,y={style:v},k={attributes:b,clientId:g,name:i(g)};p.forEach(S=>{y={...y,...S(y,k)}}),y={...y,style:Ge(y.style)},h[g]=y}),r(m,h,!0)},[n,i,s,l,d,r]);return(0,ohe.jsx)(ehe.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:o,resetAll:f,panelId:d,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:u,children:e},d)}var S9=c(U(),1),tL=c(F(),1),nhe=c(E(),1);function ihe({Slot:e,fillProps:t,...o}){let r=(0,tL.useContext)(S9.__experimentalToolsPanelContext),n=(0,tL.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[S9.__experimentalToolsPanelContext.Provider,{value:r}]]}),[r,t]);return(0,nhe.jsx)(e,{...o,fillProps:n,bubblesVirtually:!0})}var oL=c(E(),1);function r9e({__experimentalGroup:e,group:t="default",label:o,fillProps:r,...n},i){e&&((0,che.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);let s=dc[t],a=(0,she.__experimentalUseSlotFills)(s?.name);if(!s)return(0,lhe.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;let{Slot:l}=s;return o?(0,oL.jsx)(rhe,{group:t,label:o,children:(0,oL.jsx)(ihe,{...n,fillProps:r,Slot:l})}):(0,oL.jsx)(l,{...n,ref:i,fillProps:r,bubblesVirtually:!0})}var k9=(0,ahe.forwardRef)(r9e);var _9=c(E(),1),uhe=Rb;uhe.Slot=k9;var Cm=e=>(0,_9.jsx)(Rb,{...e,group:"advanced"});Cm.Slot=function(t){return(0,_9.jsx)(k9,{...t,group:"advanced"})};Cm.slotName="InspectorAdvancedControls";var Oe=uhe;var fhe=c(Q(),1),Em=c(ue(),1),XC=c(G(),1);function dhe(e){let t=e?.style?.position?.type;return t==="sticky"?(0,XC.__)("Sticky"):t==="fixed"?(0,XC.__)("Fixed"):null}function Do(e){return(0,fhe.useSelect)(t=>{if(!e)return null;let o=t(C),{getBlockName:r,getBlockAttributes:n,getBlock:i,__experimentalGetParsedPattern:s}=o,{getBlockType:a,getActiveBlockVariation:l}=t(Em.store),u=r(e),d=a(u);if(!d)return null;let f=n(e),{isSectionBlock:p}=H(o),h=f?.metadata?.patternName;if(h&&p(e)){let S=s(h),_=dhe(f);return{isSynced:!1,title:(0,XC.__)("Pattern"),icon:Hc,description:S?.description||(0,XC.__)("A block pattern."),anchor:f?.anchor,positionLabel:_,positionType:f?.style?.position?.type,name:S?.title||f?.metadata?.name}}let m=l(u,f,void 0,i?.(e)?.innerContent),g=(0,Em.isReusableBlock)(d)||(0,Em.isTemplatePart)(d),v=(g?(0,Em.__experimentalGetBlockLabel)(d,f):void 0)||d.title,y=dhe(f),k={isSynced:g,title:v,icon:d.icon,description:d.description,anchor:f?.anchor,positionLabel:y,positionType:f?.style?.position?.type,name:f?.metadata?.name};return m?{isSynced:g,title:m.title||d.title,icon:m.icon||d.icon,description:m.description||d.description,anchor:f?.anchor,positionLabel:y,positionType:f?.style?.position?.type,name:f?.metadata?.name}:k},[e])}var Tm=c(E(),1),QC="position",x9={key:"default",value:"",label:(0,fc.__)("Default")},w9={key:"sticky",value:"sticky",label:(0,fc._x)("Sticky","Name for the value of the CSS position property"),hint:(0,fc.__)("The block will stick to the top of the window instead of scrolling.")},phe={key:"fixed",value:"fixed",label:(0,fc._x)("Fixed","Name for the value of the CSS position property"),hint:(0,fc.__)("The block will not move when the page is scrolled.")},n9e=["top","right","bottom","left"],i9e=["sticky","fixed"];function s9e({selector:e,style:t}){let o="",{type:r}=t?.position||{};return i9e.includes(r)&&(o+=`${e} {`,o+=`position: ${r};`,n9e.forEach(n=>{t?.position?.[n]!==void 0&&(o+=`${n}: ${t.position[n]};`)}),(r==="sticky"||r==="fixed")&&(o+="z-index: 10"),o+="}"),o}function a9e(e){let t=(0,Bb.getBlockSupport)(e,QC);return!!(t===!0||t?.sticky)}function l9e(e){let t=(0,Bb.getBlockSupport)(e,QC);return!!(t===!0||t?.fixed)}function c9e(e){return!!(0,Bb.getBlockSupport)(e,QC)}function ghe(e){let t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function bhe({name:e}={}){let[t,o]=Le("position.fixed","position.sticky"),r=!t&&!o;return!c9e(e)||r}function u9e({style:e={},clientId:t,name:o,setAttributes:r}){let n=l9e(o),i=a9e(o),s=e?.position?.type,{firstParentClientId:a}=(0,hhe.useSelect)(m=>{let{getBlockParents:g}=m(C),b=g(t);return{firstParentClientId:b[b.length-1]}},[t]),l=Do(a),u=i&&s===w9.value&&l?(0,fc.sprintf)((0,fc.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,d=(0,rL.useMemo)(()=>{let m=[x9];return(i||s===w9.value)&&m.push(w9),(n||s===phe.value)&&m.push(phe),m},[n,i,s]),f=m=>{let b={...e,position:{...e?.position,type:m,top:m==="sticky"||m==="fixed"?"0px":void 0}};r({style:Ge(b)})},p=s&&d.find(m=>m.value===s)||x9,h=(0,rL.useId)();return d.length>1?(0,Tm.jsx)(Oe,{group:"position",children:(0,Tm.jsx)(Y7,{label:(0,fc.__)("Position"),hideLabelFromVision:!0,description:u,items:d,value:p,onValueChange:m=>{f(m.value)},children:d.map(m=>{let g=m.hint?`${h}-${m.key}`:void 0;return(0,Tm.jsxs)(Y7.Item,{value:m,label:m.label,className:"block-editor-hooks__position-control-item","aria-describedby":g,children:[(0,Tm.jsx)("div",{children:m.label}),m.hint&&(0,Tm.jsx)("div",{id:g,className:"block-editor-hooks__position-control-item-hint","aria-hidden":"true",children:m.hint})]},m.key)})})}):null}var C9={edit:function(t){return bhe(t)?null:(0,Tm.jsx)(u9e,{...t})},useBlockProps:f9e,attributeKeys:["style"],hasSupport(e){return(0,Bb.hasBlockSupport)(e,QC)}},d9e={};function f9e({name:e,style:t}){let o=(0,Bb.hasBlockSupport)(e,QC),r=bhe({name:e}),n=o&&!r,i=(0,mhe.useInstanceId)(d9e),s=`.wp-container-${i}.wp-container-${i}`,a;n&&(a=s9e({selector:s,style:t})||"");let l=K({[`wp-container-${i}`]:n&&!!a,[`is-position-${t?.position?.type}`]:n&&!!a&&!!t?.position?.type});return el({css:a}),{className:l}}var xhe={placement:"top-start"},yhe={...xhe,flip:!1,shift:!0},p9e={...xhe,flip:!0,shift:!1};function vhe(e,t,o,r,n){if(!e||!t)return yhe;let i=o?.scrollTop||0,s=Nv(t),a=e.getBoundingClientRect(),l=i+a.top,u=e.ownerDocument.documentElement.clientHeight,d=l+r,f=s.top>d,p=s.height>u-r;return!n&&(f||p)?yhe:p9e}function nL({contentElement:e,clientId:t}){let o=Nt(t),[r,n]=(0,Su.useState)(0),{blockIndex:i,isSticky:s}=(0,khe.useSelect)(p=>{let{getBlockIndex:h,getBlockAttributes:m}=p(C);return{blockIndex:h(t),isSticky:ghe(m(t))}},[t]),a=(0,Su.useMemo)(()=>{if(e)return(0,_he.getScrollContainer)(e)},[e]),[l,u]=(0,Su.useState)(()=>vhe(e,o,a,r,s)),d=(0,She.useRefEffect)(p=>{n(p.offsetHeight)},[]),f=(0,Su.useCallback)(()=>u(vhe(e,o,a,r,s)),[e,o,a,r,s]);return(0,Su.useLayoutEffect)(f,[i,f]),(0,Su.useLayoutEffect)(()=>{if(!e||!o)return;let p=e?.ownerDocument?.defaultView;p?.addEventListener?.("resize",f);let h,m=o?.ownerDocument?.defaultView;return m?.ResizeObserver&&(h=new m.ResizeObserver(f),h.observe(o)),()=>{p?.removeEventListener?.("resize",f),h&&h.disconnect()}},[f,e,o]),{...l,ref:d}}var whe=c(Q(),1);function iL(e){return(0,whe.useSelect)(o=>{let{getBlockRootClientId:r,getBlockParents:n,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:s,getBlockInsertionPoint:a,getBlockOrder:l,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=o(C),f=n(e),p=i(f),h=f.find(g=>p[g]?.__experimentalCaptureToolbars),m=!1;if(s()){let g=a();m=l(g.rootClientId)[g.index]===e}return{capturingClientId:h,isInsertionPointVisible:m,lastClientId:u()?d():null,rootClientId:r(e)}},[e])}var sL=c(E(),1);function Che({clientId:e,__unstableContentRef:t}){let{capturingClientId:o,isInsertionPointVisible:r,lastClientId:n,rootClientId:i}=iL(e),s=nL({contentElement:t?.current,clientId:e});return(0,sL.jsx)(Xa,{clientId:o||e,bottomClientId:n,className:K("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,sL.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,sL.jsx)(Za,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var oye=c(Q(),1),Vk=c(F(),1),rye=c(Yl(),1);var Xbe=c(G(),1),Qbe=c(Q(),1),tG=c(F(),1),Jbe=c(fe(),1),tf=c(ue(),1),eye=c(U(),1);var Pb=c(U(),1),Nhe=c(Q(),1),Dhe=c(G(),1);var Phe=c(ue(),1),Ihe=c(U(),1),JC=c(Q(),1),eE=c(F(),1),Ohe=c(fe(),1);var The=c(Tt(),1),ku=c(F(),1),aL=50,Rhe=25,m9e=1e3,Ehe=m9e*(Rhe/1e3);function Bhe(){let e=(0,ku.useRef)(null),t=(0,ku.useRef)(null),o=(0,ku.useRef)(null),r=(0,ku.useRef)(null);(0,ku.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]);let n=(0,ku.useCallback)(a=>{e.current=a.clientY,o.current=(0,The.getScrollContainer)(a.target),r.current=setInterval(()=>{if(o.current&&t.current){let l=o.current.scrollTop+t.current;o.current.scroll({top:l})}},Rhe)},[]),i=(0,ku.useCallback)(a=>{if(!o.current)return;let l=o.current.offsetHeight,u=e.current-o.current.offsetTop,d=a.clientY-o.current.offsetTop;if(a.clientY>u){let f=Math.max(l-u-aL,0),p=Math.max(d-u-aL,0),h=f===0||p===0?0:p/f;t.current=Ehe*h}else if(a.clientY{e.current=null,o.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}var E9=c(E(),1),h9e=({appendToOwnerDocument:e,children:t,clientIds:o,cloneClassname:r,elementId:n,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:l})=>{let{srcRootClientId:u,isDraggable:d,icon:f,visibleInserter:p,getBlockType:h}=(0,JC.useSelect)(R=>{let{canMoveBlocks:I,getBlockRootClientId:A,getBlockName:P,getBlockAttributes:O,isBlockInsertionPointVisible:N}=R(C),{getBlockType:z,getActiveBlockVariation:V}=R(Phe.store),M=A(o[0]),D=P(o[0]),L=V(D,O(o[0]));return{srcRootClientId:M,isDraggable:I(o),icon:L?.icon||z(D)?.icon,visibleInserter:N(),getBlockType:z}},[o]),m=(0,eE.useRef)(!1),[g,b,v]=Bhe(),{getAllowedBlocks:y,getBlockNamesByClientId:k,getBlockRootClientId:S}=(0,JC.useSelect)(C),{startDraggingBlocks:_,stopDraggingBlocks:x}=(0,JC.useDispatch)(C);(0,eE.useEffect)(()=>()=>{m.current&&x()},[]);let T=Nt(o[0])?.closest("body");return(0,eE.useEffect)(()=>{if(!T||!a)return;let I=(0,Ohe.throttle)(A=>{if(!A.target.closest("[data-block]"))return;let P=k(o),O=A.target.closest("[data-block]").getAttribute("data-block"),N=y(O),z=k([O])[0],V;if(N?.length===0){let M=S(O),D=k([M])[0],L=y(M);V=U2(h,L,P,D)}else V=U2(h,N,P,z);!V&&!p?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return T.addEventListener("dragover",I),()=>{T.removeEventListener("dragover",I)}},[o,T,a,y,k,S,h,p]),d?(0,E9.jsx)(Ihe.Draggable,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:{type:"block",srcClientIds:o,srcRootClientId:u},onDragStart:R=>{window.requestAnimationFrame(()=>{_(o),m.current=!0,g(R),i&&i()})},onDragOver:b,onDragEnd:()=>{x(),m.current=!1,v(),s&&s()},__experimentalDragComponent:l!==void 0?l:(0,E9.jsx)(e2,{count:o.length,icon:f,fadeWhenDisabled:!0}),elementId:n,children:({onDraggableStart:R,onDraggableEnd:I})=>t({draggable:!0,onDragStart:R,onDragEnd:I})}):t({draggable:!1})},lL=h9e;var Lhe=c(ue(),1),Mhe=c(U(),1);var cL=c(fe(),1),uL=c(Q(),1),vk=c(F(),1),tl=c(G(),1),T9=c(io(),1);var ot=c(G(),1),Rm=(e,t)=>e==="up"?t==="horizontal"?(0,ot.isRTL)()?"right":"left":"up":e==="down"?t==="horizontal"?(0,ot.isRTL)()?"left":"right":"down":null;function Ahe(e,t,o,r,n,i,s){let a=o+1;if(e>1)return g9e(e,o,r,n,i,s);if(r&&n)return(0,ot.sprintf)((0,ot.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!n){let l=Rm("down",s);if(l==="down")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&n){let l=Rm("down",s);if(l==="down")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved down"),t);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved left"),t);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the end of the content and can\u2019t be moved right"),t)}if(i<0&&!r){let l=Rm("up",s);if(l==="up")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){let l=Rm("up",s);if(l==="up")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved up"),t);if(l==="left")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved left"),t);if(l==="right")return(0,ot.sprintf)((0,ot.__)("Block %1$s is at the beginning of the content and can\u2019t be moved right"),t)}}function g9e(e,t,o,r,n,i){let s=t+1;if(o&&r)return(0,ot.__)("All blocks are selected, and cannot be moved");if(n>0&&!r){let a=Rm("down",i);if(a==="down")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if(a==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n>0&&r){let a=Rm("down",i);if(a==="down")return(0,ot.__)("Blocks cannot be moved down as they are already at the bottom");if(a==="left")return(0,ot.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ot.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(n<0&&!o){let a=Rm("up",i);if(a==="up")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if(a==="left")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ot.sprintf)((0,ot.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n<0&&o){let a=Rm("up",i);if(a==="up")return(0,ot.__)("Blocks cannot be moved up as they are already at the top");if(a==="left")return(0,ot.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ot.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}var $d=c(E(),1),b9e=(e,t)=>e==="up"?t==="horizontal"?(0,tl.isRTL)()?un:Ti:eg:e==="down"?t==="horizontal"?(0,tl.isRTL)()?Ti:un:cn:null,y9e=(e,t)=>e==="up"?t==="horizontal"?(0,tl.isRTL)()?(0,tl.__)("Move right"):(0,tl.__)("Move left"):(0,tl.__)("Move up"):e==="down"?t==="horizontal"?(0,tl.isRTL)()?(0,tl.__)("Move left"):(0,tl.__)("Move right"):(0,tl.__)("Move down"):null,R9=(0,vk.forwardRef)(({clientIds:e,direction:t,orientation:o,...r},n)=>{let i=(0,cL.useInstanceId)(R9),s=(0,vk.useMemo)(()=>Array.isArray(e)?e:[e],[e]),a=s.length,l=(0,cL.useViewportMatch)("small","<"),{blockType:u,isDisabled:d,rootClientId:f,isFirst:p,isLast:h,firstIndex:m,orientation:g="vertical"}=(0,uL.useSelect)(_=>{let{getBlockIndex:x,getBlockRootClientId:w,getBlockOrder:T,getBlock:B,getBlockListSettings:R}=_(C),I=s[0],A=w(I),P=x(I),O=x(s[s.length-1]),N=T(A),z=B(I),V=P===0,M=O===N.length-1,{orientation:D}=R(A)||{};return{blockType:z?(0,Lhe.getBlockType)(z.name):null,isDisabled:t==="up"?V:M,rootClientId:A,firstIndex:P,isFirst:V,isLast:M,orientation:o||D}},[t,o,s]),{moveBlocksDown:b,moveBlocksUp:v}=(0,uL.useDispatch)(C),y=t==="up"?v:b,k=_=>{y(e,f),r.onClick&&r.onClick(_)},S=`block-editor-block-mover-button__description-${i}`;return(0,$d.jsxs)($d.Fragment,{children:[(0,$d.jsx)(Mhe.Button,{__next40pxDefaultSize:!0,ref:n,className:K("block-editor-block-mover-button",`is-${t}-button`),icon:b9e(t,g),label:y9e(t,g),tooltipPosition:!l&&t==="down"&&g==="vertical"?"bottom":"top","aria-describedby":S,...r,onClick:d?null:k,disabled:d,accessibleWhenDisabled:!0,shortcut:t==="up"?T9.displayShortcut.secondary("t"):T9.displayShortcut.secondary("y")}),(0,$d.jsx)(bt,{id:S,children:Ahe(a,u&&u.title,m,p,h,t==="up"?-1:1,g)})]})}),dL=(0,vk.forwardRef)((e,t)=>(0,$d.jsx)(R9,{direction:"up",ref:t,...e})),fL=(0,vk.forwardRef)((e,t)=>(0,$d.jsx)(R9,{direction:"down",ref:t,...e}));var _u=c(E(),1);function v9e({clientIds:e,hideDragHandle:t}){let{canMove:o,rootClientId:r,isFirst:n,isLast:i,orientation:s,isManualGrid:a}=(0,Nhe.useSelect)(l=>{let{getBlockIndex:u,getBlockListSettings:d,canMoveBlocks:f,getBlockOrder:p,getBlockRootClientId:h,getBlockAttributes:m}=l(C),g=Array.isArray(e)?e:[e],b=g[0],v=h(b),y=u(b),k=u(g[g.length-1]),S=p(v),{layout:_={}}=m(v)??{};return{canMove:f(e),rootClientId:v,isFirst:y===0,isLast:k===S.length-1,orientation:d(v)?.orientation,isManualGrid:_.type==="grid"&&_.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!o||n&&i&&!r||t&&a?null:(0,_u.jsxs)(Pb.ToolbarGroup,{className:K("block-editor-block-mover",{"is-horizontal":s==="horizontal"}),children:[!t&&(0,_u.jsx)(lL,{clientIds:e,fadeWhenDisabled:!0,children:l=>(0,_u.jsx)(Pb.Button,{__next40pxDefaultSize:!0,icon:Hx,className:"block-editor-block-mover__drag-handle",label:(0,Dhe.__)("Drag"),tabIndex:"-1",...l})}),!a&&(0,_u.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,_u.jsx)(Pb.ToolbarItem,{children:l=>(0,_u.jsx)(dL,{clientIds:e,...l})}),(0,_u.jsx)(Pb.ToolbarItem,{children:l=>(0,_u.jsx)(fL,{clientIds:e,...l})})]})]})}var pL=v9e;var zhe=c(U(),1),hL=c(Q(),1),gL=c(G(),1),jhe=c(F(),1);var tE=c(Q(),1),Bm=c(F(),1);var{clearTimeout:Vhe,setTimeout:S9e}=window,Fhe=200;function k9e({ref:e,isFocused:t,highlightParent:o,debounceTimeout:r=Fhe}){let{getSelectedBlockClientId:n,getBlockRootClientId:i}=(0,tE.useSelect)(C),{toggleBlockHighlight:s}=(0,tE.useDispatch)(C),a=(0,Bm.useRef)(),l=(0,tE.useSelect)(g=>g(C).getSettings().isDistractionFree,[]),u=g=>{if(g&&l)return;let b=n(),v=o?i(b):b;s(v,g)},d=()=>e?.current&&e.current.matches(":hover"),f=()=>{let g=d();return!t&&!g},p=()=>{let g=a.current;g&&Vhe&&Vhe(g)},h=g=>{g&&g.stopPropagation(),p(),u(!0)},m=g=>{g&&g.stopPropagation(),p(),a.current=S9e(()=>{f()&&u(!1)},r)};return(0,Bm.useEffect)(()=>()=>{u(!1),p()},[]),{debouncedShowGestures:h,debouncedHideGestures:m}}function Sk({ref:e,highlightParent:t=!1,debounceTimeout:o=Fhe}){let[r,n]=(0,Bm.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=k9e({ref:e,debounceTimeout:o,isFocused:r,highlightParent:t}),a=(0,Bm.useRef)(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,Bm.useEffect)(()=>{let u=e.current,d=()=>{l()&&(n(!0),i())},f=()=>{l()||(n(!1),s())};return u&&!a.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",f,!0),a.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",f))}},[e,a,n,i,s]),{onMouseMove:i,onMouseLeave:s}}var mL=c(E(),1);function Hhe(){let{selectBlock:e}=(0,hL.useDispatch)(C),{parentClientId:t}=(0,hL.useSelect)(i=>{let{getBlockParents:s,getSelectedBlockClientIds:a,getParentSectionBlock:l}=H(i(C)),[u]=a(),d=l(u),f=s(u);return{parentClientId:d??f[f.length-1]}},[]),o=Do(t),r=(0,jhe.useRef)(),n=Sk({ref:r,highlightParent:!0});return(0,mL.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...n,children:(0,mL.jsx)(zhe.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,gL.sprintf)((0,gL.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,mL.jsx)(Et,{icon:o?.icon})})},t)}var bL=c(U(),1);var Ib=c(U(),1),_9e=(0,Ib.createSlotFill)("BlockControls"),x9e=(0,Ib.createSlotFill)("BlockControlsBlock"),w9e=(0,Ib.createSlotFill)("BlockFormatControls"),C9e=(0,Ib.createSlotFill)("BlockControlsOther"),E9e=(0,Ib.createSlotFill)("BlockControlsParent"),T9e=(0,Ib.createSlotFill)("BlockControlsStyleState"),R9e={default:_9e,block:x9e,inline:w9e,other:C9e,parent:E9e,"style-state":T9e},oE=R9e;function Uhe(e,t){let o=ht();return o[Dl]?oE[e]?.Fill:o[Vy]&&t?oE.parent.Fill:null}var Kd=c(E(),1);function B9({group:e="default",controls:t,children:o,__experimentalShareWithChildBlocks:r=!1}){let n=Uhe(e,r);if(!n)return null;let i=(0,Kd.jsxs)(Kd.Fragment,{children:[e==="default"&&(0,Kd.jsx)(bL.ToolbarGroup,{controls:t}),o]});return(0,Kd.jsx)(bL.__experimentalStyleProvider,{document,children:(0,Kd.jsx)(n,{children:s=>{let{forwardedContext:a=[]}=s;return a.reduce((l,[u,d])=>(0,Kd.jsx)(u,{...d,children:l}),i)}})})}var rE=c(F(),1),Yd=c(U(),1),Whe=c(Yw(),1);var P9=c(E(),1),{ComponentsContext:Ghe}=H(Yd.privateApis);function I9({group:e="default",...t}){let o=(0,rE.useContext)(Yd.__experimentalToolbarContext),r=(0,rE.useContext)(Ghe),n=(0,rE.useMemo)(()=>({forwardedContext:[[Yd.__experimentalToolbarContext.Provider,{value:o}],[Ghe.Provider,{value:r}]]}),[o,r]),i=oE[e],s=(0,Yd.__experimentalUseSlotFills)(i.name);if(!i)return(0,Whe.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;let{Slot:a}=i,l=(0,P9.jsx)(a,{...t,bubblesVirtually:!0,fillProps:n});return e==="default"?l:(0,P9.jsx)(Yd.ToolbarGroup,{children:l})}var O9=c(E(),1),$he=B9;$he.Slot=I9;var A9=e=>(0,O9.jsx)(B9,{group:"inline",...e});A9.Slot=function(t){return(0,O9.jsx)(I9,{group:"inline",...t})};var No=$he;var Khe=c(U(),1),{Fill:Yhe,Slot:B9e}=(0,Khe.createSlotFill)("__unstableBlockToolbarLastItem");Yhe.Slot=B9e;var yL=Yhe;var DL=c(U(),1);var Tk=c(ue(),1),Ui=c(U(),1),Im=c(Q(),1);var ML=c(F(),1),nl=c(G(),1),qge=c(Yl(),1),Xd=c(fe(),1);var xk=c(Q(),1),wk=c(ue(),1);var uge=c(F(),1),iE=c(ue(),1),nE=c(Q(),1),dge=c(as(),1),qd=c(G(),1);var ta=c(ue(),1),P9e="align";var qhe="__experimentalBorder",vL="color",I9e="customClassName",Zhe="typography.__experimentalFontFamily",Xhe="typography.fontSize",O9e="typography.lineHeight",A9e="typography.__experimentalFontStyle",L9e="typography.__experimentalFontWeight",Qhe="typography.textAlign",M9e="typography.textColumns",N9e="typography.__experimentalTextDecoration",D9e="typography.__experimentalWritingMode",V9e="typography.__experimentalTextTransform",F9e="typography.__experimentalLetterSpacing",z9e="layout",j9e=[O9e,Xhe,A9e,L9e,Zhe,Qhe,M9e,N9e,V9e,D9e,F9e],H9e=["shadow"],U9e="spacing",G9e=[...H9e,...j9e,qhe,vL,U9e],Jhe=e=>(0,ta.hasBlockSupport)(e,P9e);function ege(e,t="any"){let o=(0,ta.getBlockSupport)(e,qhe);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}var tge=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t!==null&&typeof t=="object"&&!!t.gradients},oge=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t&&t.background!==!1},rge=e=>(0,ta.hasBlockSupport)(e,Qhe);var nge=e=>{let t=(0,ta.getBlockSupport)(e,vL);return t&&t.text!==!1};var ige=e=>(0,ta.hasBlockSupport)(e,I9e,!0);var sge=e=>(0,ta.hasBlockSupport)(e,Zhe);var age=e=>(0,ta.hasBlockSupport)(e,Xhe);var lge=e=>(0,ta.hasBlockSupport)(e,z9e);var cge=e=>G9e.some(t=>(0,ta.hasBlockSupport)(e,t));function W9e(e){try{let t=(0,iE.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}var $9e={align:Jhe,borderColor:e=>ege(e,"color"),backgroundColor:oge,textAlign:rge,textColor:nge,gradient:tge,className:ige,fontFamily:sge,fontSize:age,layout:lge,style:cge};function K9e(e,t){return Object.entries($9e).reduce((o,[r,n])=>(n(e.name)&&n(t.name)&&(o[r]=e.attributes[r]),o),{})}function L9(e,t,o){for(let r=0;r{let s="";try{if(!window.navigator.clipboard){n((0,qd.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}s=await window.navigator.clipboard.readText()}catch{n((0,qd.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!s||!W9e(s)){r((0,qd.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}let a=(0,iE.parse)(s);if(a.length===1?e.batch(()=>{L9(i,i.map(()=>a[0]),t)}):e.batch(()=>{L9(i,a,t)}),i.length===1){let l=(0,iE.getBlockType)(i[0].name)?.title;o((0,qd.sprintf)((0,qd.__)("Pasted styles to %s."),l),{type:"snackbar"})}else o((0,qd.sprintf)((0,qd.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,o,r,n])}var _k=c(ue(),1);function ol(e,t){let o=(0,_k.findTransform)((0,_k.getBlockTransforms)("from",t),r=>r.type==="block"&&r.isMultiBlock&&r.blocks.includes("*"));if(o?.__experimentalConvert){let r=o.__experimentalConvert(e);return Array.isArray(r)?r:[r]}return(0,_k.switchToBlockType)(e,t)}function fge({clientIds:e,children:t,__experimentalUpdateSelection:o}){let{getDefaultBlockName:r,getGroupingBlockName:n}=(0,xk.useSelect)(wk.store),i=(0,xk.useSelect)(k=>{let{canInsertBlockType:S,getBlockRootClientId:_,getBlocksByClientId:x,getDirectInsertBlock:w,canRemoveBlocks:T}=k(C),B=x(e),R=_(e[0]),I=S(r(),R),A=R?w(R):null;return{canRemove:T(e),canInsertBlock:B.every(P=>(I||!!A)&&S(P.name,R)),canCopyStyles:B.every(P=>!!P&&((0,wk.hasBlockSupport)(P.name,"color")||(0,wk.hasBlockSupport)(P.name,"typography"))),canDuplicate:B.every(P=>!!P&&(0,wk.hasBlockSupport)(P.name,"multiple",!0)&&S(P.name,R))}},[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,xk.useSelect)(C),{canRemove:l,canInsertBlock:u,canCopyStyles:d,canDuplicate:f}=i,{removeBlocks:p,replaceBlocks:h,duplicateBlocks:m,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:v}=(0,xk.useDispatch)(C),y=kk();return t({canCopyStyles:d,canDuplicate:f,canInsertBlock:u,canRemove:l,onDuplicate(){return m(e,o)},onRemove(){return p(e,o)},onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;let k=n(),S=ol(s(e),k);S&&h(e,S)},onUngroup(){if(!e.length)return;let k=a(e[0]);k.length&&h(e,k)},onCopy(){e.length===1&&v(e[0])},async onPasteStyles(){await y(s(e))}})}var pge=c(U(),1),Y9e=(0,pge.createSlotFill)(Symbol("NoteIconSlotFill")),SL=Y9e;var mge=c(G(),1),hge=c(U(),1),kL=c(ue(),1),_L=c(Q(),1);var gge=c(E(),1);function q9e({clientId:e}){let t=(0,_L.useSelect)(r=>r(C).getBlock(e),[e]),{replaceBlocks:o}=(0,_L.useDispatch)(C);return!t||t.name!=="core/html"?null:(0,gge.jsx)(hge.MenuItem,{onClick:()=>o(e,(0,kL.rawHandler)({HTML:(0,kL.getBlockContent)(t)})),children:(0,mge.__)("Convert to Blocks")})}var bge=q9e;var yge=c(U(),1),{Fill:vge,Slot:Z9e}=(0,yge.createSlotFill)("__unstableBlockSettingsMenuFirstItem");vge.Slot=Z9e;var xL=vge;var Ek=c(U(),1),jge=c(ue(),1),Hge=c(Q(),1);var N9=c(U(),1),D9=c(G(),1),CL=c(Q(),1),xge=c(io(),1);var Sge=c(ue(),1),kge=c(Q(),1);function sE(e){return(0,kge.useSelect)(t=>{let{getBlocksByClientId:o,getSelectedBlockClientIds:r,isUngroupable:n,isGroupable:i}=t(C),{getGroupingBlockName:s,getBlockType:a}=t(Sge.store),l=e?.length?e:r(),u=o(l),[d]=u,f=l.length===1&&n(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:f,blocksSelection:u,groupingBlockName:s(),onUngroup:f&&a(d.name)?.transforms?.ungroup}},[e])}var wL=c(Q(),1),_ge=c(ue(),1),Ob=c(U(),1);var aE=c(G(),1);var Ab=c(E(),1),X9e={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function Q9e(){let{blocksSelection:e,clientIds:t,groupingBlockName:o,isGroupable:r}=sE(),{replaceBlocks:n}=(0,wL.useDispatch)(C),{canRemove:i,variations:s}=(0,wL.useSelect)(m=>{let{canRemoveBlocks:g}=m(C),{getBlockVariations:b}=m(_ge.store);return{canRemove:g(t),variations:b(o,"transform")}},[t,o]),a=m=>{let g=ol(e,o);typeof m!="string"&&(m="group"),g&&g.length>0&&(g[0].attributes.layout=X9e[m],n(t,g))},l=()=>a("row"),u=()=>a("stack"),d=()=>a("grid");if(!r||!i)return null;let f=!!s.find(({name:m})=>m==="group-row"),p=!!s.find(({name:m})=>m==="group-stack"),h=!!s.find(({name:m})=>m==="group-grid");return(0,Ab.jsxs)(Ob.ToolbarGroup,{children:[(0,Ab.jsx)(Ob.ToolbarButton,{icon:Wx,label:(0,aE._x)("Group","action: convert blocks to group"),onClick:a}),f&&(0,Ab.jsx)(Ob.ToolbarButton,{icon:X4,label:(0,aE._x)("Row","action: convert blocks to row"),onClick:l}),p&&(0,Ab.jsx)(Ob.ToolbarButton,{icon:f6,label:(0,aE._x)("Stack","action: convert blocks to stack"),onClick:u}),h&&(0,Ab.jsx)(Ob.ToolbarButton,{icon:Gx,label:(0,aE._x)("Grid","action: convert blocks to grid"),onClick:d})]})}var M9=Q9e;var Lb=c(E(),1);function wge({clientIds:e,isGroupable:t,isUngroupable:o,onUngroup:r,blocksSelection:n,groupingBlockName:i,onClose:s=()=>{}}){let{getSelectedBlockClientIds:a}=(0,CL.useSelect)(C),{replaceBlocks:l}=(0,CL.useDispatch)(C),u=()=>{let p=ol(n,i);p&&l(e,p)},d=()=>{let p=n[0].innerBlocks;p.length&&(r&&(p=r(n[0].attributes,n[0].innerBlocks)),l(e,p))};if(!t&&!o)return null;let f=a();return(0,Lb.jsxs)(Lb.Fragment,{children:[t&&(0,Lb.jsx)(N9.MenuItem,{shortcut:f.length>1?xge.displayShortcut.primary("g"):void 0,onClick:()=>{u(),s()},children:(0,D9._x)("Group","verb")}),o&&(0,Lb.jsx)(N9.MenuItem,{onClick:()=>{d(),s()},children:(0,D9._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var V9=c(G(),1),Tge=c(F(),1),Rge=c(U(),1);var Cge=c(Q(),1);function oa(e){return(0,Cge.useSelect)(t=>{let{canLockBlockType:o,getBlockName:r,isEditLockedBlock:n,isMoveLockedBlock:i,isRemoveLockedBlock:s,isLockedBlock:a}=H(t(C));return{isEditLocked:n(e),isMoveLocked:i(e),isRemoveLocked:s(e),canLock:o(r(e)),isLocked:a(e)}},[e])}var rl=c(G(),1),lE=c(F(),1),Hr=c(U(),1);var EL=c(Q(),1),Ege=c(ue(),1);var Vo=c(E(),1),J9e=["core/navigation"];function eGe(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function TL({clientId:e,onClose:t}){let[o,r]=(0,lE.useState)({move:!1,remove:!1}),{isEditLocked:n,isMoveLocked:i,isRemoveLocked:s}=oa(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:u}=(0,EL.useSelect)(v=>{let{getBlockName:y,getBlockAttributes:k}=v(C),S=y(e),_=(0,Ege.getBlockType)(S);return{allowsEditLocking:J9e.includes(S),templateLock:k(e)?.templateLock,hasTemplateLock:!!_?.attributes?.templateLock}},[e]),[d,f]=(0,lE.useState)(!!l),{updateBlockAttributes:p}=(0,EL.useDispatch)(C),h=Do(e);(0,lE.useEffect)(()=>{r({move:i,remove:s,...a?{edit:n}:{}})},[n,i,s,a]);let m=Object.values(o).every(Boolean),g=Object.values(o).some(Boolean)&&!m,b=o.move!==i||o.remove!==s||a&&o.edit!==n||u&&d!==!!l;return(0,Vo.jsx)(Hr.Modal,{title:(0,rl.sprintf)((0,rl.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,Vo.jsxs)("form",{onSubmit:v=>{v.preventDefault(),b&&(p([e],{lock:o,templateLock:d?eGe(o):void 0}),t())},children:[(0,Vo.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,Vo.jsx)("legend",{children:(0,rl.__)("Select the features you want to lock")}),(0,Vo.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,Vo.jsxs)("li",{children:[(0,Vo.jsx)(Hr.CheckboxControl,{className:"block-editor-block-lock-modal__options-all",label:(0,rl.__)("Lock all"),checked:m,indeterminate:g,onChange:v=>r({move:v,remove:v,...a?{edit:v}:{}})}),(0,Vo.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock editing"),checked:!!o.edit,onChange:v=>r(y=>({...y,edit:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?lg:ad})]}),(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock movement"),checked:o.move,onChange:v=>r(y=>({...y,move:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?lg:ad})]}),(0,Vo.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Vo.jsx)(Hr.CheckboxControl,{label:(0,rl.__)("Lock removal"),checked:o.remove,onChange:v=>r(y=>({...y,remove:v}))}),(0,Vo.jsx)(Hr.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?lg:ad})]})]})]})}),u&&(0,Vo.jsx)(Hr.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,rl.__)("Apply to all blocks inside"),checked:d,disabled:o.move&&!o.remove,onChange:()=>f(!d)})]}),(0,Vo.jsxs)(Hr.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Vo.jsx)(Hr.FlexItem,{children:(0,Vo.jsx)(Hr.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,rl.__)("Cancel")})}),(0,Vo.jsx)(Hr.FlexItem,{children:(0,Vo.jsx)(Hr.Button,{variant:"primary",type:"submit",disabled:!b,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,rl.__)("Apply")})})]})]})})}var Mb=c(E(),1);function F9({clientId:e}){let{canLock:t,isLocked:o}=oa(e),[r,n]=(0,Tge.useReducer)(s=>!s,!1);if(!t)return null;let i=o?(0,V9.__)("Unlock"):(0,V9.__)("Lock");return(0,Mb.jsxs)(Mb.Fragment,{children:[(0,Mb.jsx)(Rge.MenuItem,{icon:o?ad:C4,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Mb.jsx)(TL,{clientId:e,onClose:n})]})}var RL=c(G(),1),BL=c(U(),1),Ck=c(F(),1);var Pm=c(E(),1);function z9({clientId:e}){let{canLock:t,isLocked:o}=oa(e),[r,n]=(0,Ck.useReducer)(a=>!a,!1),i=(0,Ck.useRef)(!1);if((0,Ck.useEffect)(()=>{o&&(i.current=!0)},[o]),!o&&!i.current)return null;let s=o?(0,RL.__)("Unlock"):(0,RL.__)("Lock");return!t&&o&&(s=(0,RL.__)("Locked")),(0,Pm.jsxs)(Pm.Fragment,{children:[(0,Pm.jsx)(BL.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,Pm.jsx)(BL.ToolbarButton,{disabled:!t,icon:o?lg:ad,label:s,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,Pm.jsx)(TL,{clientId:e,onClose:n})]})}var j9=c(G(),1),Bge=c(U(),1),PL=c(ue(),1),IL=c(Q(),1);var Pge=c(E(),1),tGe=()=>{};function Ige({clientId:e,onToggle:t=tGe}){let{blockType:o,mode:r,enabled:n}=(0,IL.useSelect)(a=>{let{getBlock:l,getBlockMode:u,getSettings:d}=a(C),f=l(e);return{mode:u(e),blockType:f?(0,PL.getBlockType)(f.name):null,enabled:d().codeEditingEnabled&&!!f?.isValid}},[e]),{toggleBlockMode:i}=(0,IL.useDispatch)(C);if(!o||!(0,PL.hasBlockSupport)(o,"html",!0)||!n)return null;let s=r==="visual"?(0,j9.__)("Edit as HTML"):(0,j9.__)("Edit visually");return(0,Pge.jsx)(Bge.MenuItem,{onClick:()=>{i(e),t()},children:s})}var Mge=c(U(),1),Nge=c(G(),1),Dge=c(F(),1),Vge=c(Q(),1),Fge=c(Yl(),1);var mc=c(U(),1),pc=c(G(),1),Age=c(F(),1),Lge=c(Qr(),1),OL=c(Q(),1);function Oge(e){return e?.trim()?.length===0}var Zd=c(E(),1);function Nb({clientId:e,onClose:t}){let[o,r]=(0,Age.useState)(),n=Do(e),{metadata:i}=(0,OL.useSelect)(b=>{let{getBlockAttributes:v}=b(C);return{metadata:v(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,OL.useDispatch)(C),a=i?.name||"",l=n?.title,u=!!a&&!!i?.bindings&&Object.values(i.bindings).some(b=>b.source==="core/pattern-overrides"),d=o!==void 0&&o!==a,f=o===l,p=Oge(o),h=d||f,m=b=>b.target.select(),g=()=>{let b=f||p?void 0:o,v=f||p?(0,pc.sprintf)((0,pc.__)('Block name reset to: "%s".'),o):(0,pc.sprintf)((0,pc.__)('Block name changed to: "%s".'),o);(0,Lge.speak)(v,"assertive"),s([e],{metadata:Ge({...i,name:b})}),t()};return(0,Zd.jsx)(mc.Modal,{title:(0,pc.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,Zd.jsx)("form",{onSubmit:b=>{b.preventDefault(),h&&g()},children:(0,Zd.jsxs)(mc.__experimentalVStack,{spacing:"3",children:[(0,Zd.jsx)(mc.TextControl,{value:o??a,label:(0,pc.__)("Name"),help:u?(0,pc.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:l,onChange:r,onFocus:m}),(0,Zd.jsxs)(mc.__experimentalHStack,{justify:"right",children:[(0,Zd.jsx)(mc.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,pc.__)("Cancel")}),(0,Zd.jsx)(mc.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!h,variant:"primary",type:"submit",children:(0,pc.__)("Save")})]})]})})})}var Db=c(E(),1);function H9({clientId:e}){let[t,o]=(0,Dge.useState)(!1),r=(0,Vge.useSelect)(n=>n(Fge.store).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Db.jsxs)(Db.Fragment,{children:[(0,Db.jsx)(Mge.MenuItem,{onClick:()=>{o(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:r,children:(0,Nge.__)("Rename")}),t&&(0,Db.jsx)(Nb,{clientId:e,onClose:()=>o(!1)})]})}var zge=c(ue(),1);function Vb(e){return{canRename:!!e&&(0,zge.getBlockSupport)(e,"renaming",!0)}}var hc=c(E(),1),{Fill:oGe,Slot:rGe}=(0,Ek.createSlotFill)("BlockSettingsMenuControls"),nGe=({fillProps:e,clientIds:t=null})=>{let{selectedBlocks:o,selectedClientIds:r,isContentOnly:n,canToggleSelectedBlocksVisibility:i,canEdit:s}=(0,Hge.useSelect)(b=>{let{getBlocksByClientId:v,getBlockNamesByClientId:y,getSelectedBlockClientIds:k,getBlockEditingMode:S,canEditBlock:_}=b(C),x=t!==null?t:k();return{selectedBlocks:y(x),selectedClientIds:x,isContentOnly:S(x[0])==="contentOnly",canToggleSelectedBlocksVisibility:v(x).every(w=>(0,jge.hasBlockSupport)(w.name,"visibility",!0)),canEdit:_(x[0])}},[t]),{canLock:a}=oa(r[0]),{canRename:l}=Vb(o[0]),u=r.length===1&&a&&!n,d=r.length===1&&l&&!n,f=i&&!n,p=sE(r),{isGroupable:h,isUngroupable:m}=p,g=(h||m)&&!n;return(0,hc.jsx)(rGe,{fillProps:{...e,canEdit:s,selectedBlocks:o,selectedClientIds:r},children:b=>!b?.length>0&&!g&&!u?null:(0,hc.jsxs)(Ek.MenuGroup,{children:[g&&(0,hc.jsx)(wge,{...p,onClose:e?.onClose}),s&&u&&(0,hc.jsx)(F9,{clientId:r[0]}),s&&d&&(0,hc.jsx)(H9,{clientId:r[0]}),s&&f&&(0,hc.jsx)(Wj,{clientIds:r}),b,s&&e?.count===1&&!n&&(0,hc.jsx)(Ige,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function Uge({...e}){return(0,hc.jsx)(Ek.__experimentalStyleProvider,{document,children:(0,hc.jsx)(oGe,{...e})})}Uge.Slot=nGe;var AL=Uge;var Gge=c(F(),1),Wge=c(U(),1),$ge=c(fe(),1),Kge=c(Q(),1),LL=c(G(),1);var U9=c(E(),1);function Yge({parentClientId:e,parentBlockType:t}){let o=(0,$ge.useViewportMatch)("medium","<"),{selectBlock:r}=(0,Kge.useDispatch)(C),n=(0,Gge.useRef)(),i=Sk({ref:n,highlightParent:!0});return o?(0,U9.jsx)(Wge.MenuItem,{...i,ref:n,icon:(0,U9.jsx)(Et,{icon:t.icon}),onClick:()=>r(e),children:(0,LL.sprintf)((0,LL.__)("Select parent block (%s)"),t.title)}):null}var eo=c(E(),1),iGe={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function G9({clientIds:e,onCopy:t,label:o,shortcut:r,eventType:n="copy",__experimentalUpdateSelection:i=!1}){let{getBlocksByClientId:s}=(0,Im.useSelect)(C),{removeBlocks:a}=(0,Im.useDispatch)(C),l=PS(),u=(0,Xd.useCopyToClipboard)(()=>(0,Tk.serialize)(s(e)),()=>{switch(n){case"copy":case"copyStyles":t(),l(n,e);break;case"cut":l(n,e),a(e,i);break;default:break}}),d=o||(0,nl.__)("Copy");return(0,eo.jsx)(Ui.MenuItem,{ref:u,shortcut:r,children:d})}function W9({block:e,clientIds:t,children:o,__experimentalSelectBlock:r,isContentOnlyListView:n,...i}){let s=t.length,a=t[0],{firstParentClientId:l,parentBlockType:u,previousBlockClientId:d,selectedBlockClientIds:f,isContentOnly:p,isZoomOut:h,canEdit:m,canMove:g,isFirst:b,isLast:v}=(0,Im.useSelect)(A=>{let{getBlockName:P,getBlockRootClientId:O,getPreviousBlockClientId:N,getSelectedBlockClientIds:z,getBlockAttributes:V,getBlockEditingMode:M,isZoomOut:D,canEditBlock:L,canMoveBlocks:j,getBlockIndex:q,getBlockCount:J}=H(A(C)),{getActiveBlockVariation:te}=A(Tk.store),ee=O(a),$=ee&&P(ee);return{firstParentClientId:ee,parentBlockType:ee&&(te($,V(ee))||(0,Tk.getBlockType)($)),previousBlockClientId:N(a),selectedBlockClientIds:z(),isContentOnly:M(a)==="contentOnly",isZoomOut:D(),canEdit:L(a),canMove:j(t),isFirst:q(a)===0,isLast:q(a)===J(ee)-1}},[a,t]),{getBlockOrder:y,getSelectedBlockClientIds:k}=(0,Im.useSelect)(C),{moveBlocksDown:S,moveBlocksUp:_}=(0,Im.useDispatch)(C),x=(0,Im.useSelect)(A=>{let{getShortcutRepresentation:P}=A(qge.store);return{copy:P("core/block-editor/copy"),cut:P("core/block-editor/cut"),duplicate:P("core/block-editor/duplicate"),remove:P("core/block-editor/remove"),insertAfter:P("core/block-editor/insert-after"),insertBefore:P("core/block-editor/insert-before")}},[]),w=f.length>0;async function T(A){if(!r)return;let P=await A;P&&P[0]&&r(P[0],!1)}function B(){if(!r)return;let A=d||l;A||(A=y()[0]);let P=w&&k().length===0;r(A,P)}let I=!f?.includes(l)&&!!l;return(0,eo.jsx)(fge,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:A,canDuplicate:P,canInsertBlock:O,canRemove:N,onDuplicate:z,onInsertAfter:V,onInsertBefore:M,onRemove:D,onCopy:L,onPasteStyles:j})=>!N&&!P&&!O&&p?null:(0,eo.jsx)(Ui.DropdownMenu,{icon:zs,label:(0,nl.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:iGe,noIcons:!0,...i,children:({onClose:J})=>(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsxs)(Ui.MenuGroup,{children:[(0,eo.jsx)(xL.Slot,{fillProps:{onClose:J}}),I&&(0,eo.jsx)(Yge,{parentClientId:l,parentBlockType:u}),g&&n&&(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(Ui.MenuItem,{icon:eg,disabled:b,accessibleWhenDisabled:!0,onClick:(0,Xd.pipe)(J,()=>{_(t,l)}),children:(0,nl.__)("Move up")}),(0,eo.jsx)(Ui.MenuItem,{icon:cn,disabled:v,accessibleWhenDisabled:!0,onClick:(0,Xd.pipe)(J,()=>{S(t,l)}),children:(0,nl.__)("Move down")})]}),m&&s===1&&(0,eo.jsx)(bge,{clientId:a}),!p&&(0,eo.jsx)(G9,{clientIds:t,onCopy:L,shortcut:x.copy}),N&&!p&&(0,eo.jsx)(G9,{clientIds:t,label:(0,nl.__)("Cut"),eventType:"cut",shortcut:x.cut,__experimentalUpdateSelection:!r}),P&&(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,z,T),shortcut:x.duplicate,children:(0,nl.__)("Duplicate")}),O&&!h&&(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,M),shortcut:x.insertBefore,children:(0,nl.__)("Add before")}),(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,V),shortcut:x.insertAfter,children:(0,nl.__)("Add after")})]}),m&&s===1&&(0,eo.jsx)(SL.Slot,{fillProps:{clientId:a,onClose:J}})]}),A&&!p&&(0,eo.jsxs)(Ui.MenuGroup,{children:[(0,eo.jsx)(G9,{clientIds:t,onCopy:L,label:(0,nl.__)("Copy styles"),eventType:"copyStyles"}),m&&(0,eo.jsx)(Ui.MenuItem,{onClick:j,children:(0,nl.__)("Paste styles")})]}),!p&&(0,eo.jsx)(AL.Slot,{fillProps:{onClose:J,count:s,firstBlockClientId:a},clientIds:t}),typeof o=="function"?o({onClose:J}):ML.Children.map(te=>(0,ML.cloneElement)(te,{onClose:J})),N&&(0,eo.jsx)(Ui.MenuGroup,{children:(0,eo.jsx)(Ui.MenuItem,{onClick:(0,Xd.pipe)(J,D,B),shortcut:x.remove,children:(0,nl.__)("Delete")})})]})})})}var Zge=W9;var Xge=c(U(),1),sGe=(0,Xge.createSlotFill)(Symbol("NoteIconToolbarSlotFill")),NL=sGe;var Rk=c(E(),1);function aGe({clientIds:e,...t}){return(0,Rk.jsxs)(DL.ToolbarGroup,{children:[(0,Rk.jsx)(NL.Slot,{}),(0,Rk.jsx)(DL.ToolbarItem,{children:o=>(0,Rk.jsx)(Zge,{clientIds:e,toggleProps:o,...t})})]})}var VL=aGe;var FL=c(U(),1),Qge=c(G(),1),zL=c(Q(),1);var $9=c(E(),1);function Jge({clientIds:e}){let t=e.length===1?e[0]:void 0,o=(0,zL.useSelect)(n=>!!t&&n(C).getBlockMode(t)==="html",[t]),{toggleBlockMode:r}=(0,zL.useDispatch)(C);return o?(0,$9.jsx)(FL.ToolbarGroup,{children:(0,$9.jsx)(FL.ToolbarButton,{onClick:()=>{r(t)},children:(0,Qge.__)("Edit visually")})}):null}var jL=c(U(),1),Gi=c(F(),1),obe=c(Q(),1),rbe=c(Rt(),1),Y9=c(Tt(),1),nbe=c(Yl(),1),ibe=c(io(),1);var K9=c(E(),1);function lGe(e){let t="toolbarItem";return!e.some(o=>!(t in o.dataset))}function ebe(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function tbe(e){return e.contains(e.ownerDocument.activeElement)}function cGe(e){let[t]=Y9.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}function uGe(e){let[o,r]=(0,Gi.useState)(!0),n=(0,Gi.useCallback)(()=>{let i=Y9.focus.tabbable.find(e.current),s=lGe(i);s||(0,rbe.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),r(s)},[e]);return(0,Gi.useLayoutEffect)(()=>{let i=new window.MutationObserver(n);return i.observe(e.current,{childList:!0,subtree:!0}),()=>i.disconnect()},[n,o,e]),o}function dGe({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:o,defaultIndex:r,onIndexChange:n,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){let[a]=(0,Gi.useState)(t),[l]=(0,Gi.useState)(r),u=(0,Gi.useCallback)(()=>{cGe(e.current)},[e]);(0,nbe.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&u()}),(0,Gi.useEffect)(()=>{a&&u()},[o,a,u]),(0,Gi.useEffect)(()=>{let p=e.current,h=0;return!a&&!tbe(p)&&(h=window.requestAnimationFrame(()=>{let m=ebe(p),g=l||0;m[g]&&tbe(p)&&m[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(h),!n||!p)return;let g=ebe(p).findIndex(b=>b.tabIndex===0);n(g)}},[l,a,n,e]);let{getLastFocus:f}=H((0,obe.useSelect)(C));(0,Gi.useEffect)(()=>{let p=e.current;if(s){let h=m=>{let g=f();m.keyCode===ibe.ESCAPE&&g?.current&&(m.preventDefault(),g.current.focus())};return p.addEventListener("keydown",h),()=>{p.removeEventListener("keydown",h)}}},[s,f,e])}function Bk({children:e,focusOnMount:t,focusEditorOnEscape:o=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,orientation:s="horizontal",...a}){let l=(0,Gi.useRef)(),u=uGe(l);return dGe({toolbarRef:l,focusOnMount:t,defaultIndex:n,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:o}),u?(0,K9.jsx)(jL.Toolbar,{label:a["aria-label"],ref:l,orientation:s,...a,children:e}):(0,K9.jsx)(jL.NavigableMenu,{orientation:s,role:"toolbar",ref:l,...a,children:e})}var sbe=c(Q(),1),HL=c(ue(),1);function UL(){return(0,sbe.useSelect)(t=>{let{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:n}=t(C),i=n(),s=i&&(0,HL.getBlockType)(r(i));return s&&(0,HL.hasBlockSupport)(s,"__experimentalToolbar",!0)&&o(i)!=="disabled"},[])}var Om=c(U(),1),abe=c(G(),1),lbe=c(ue(),1),cbe=c(F(),1),GL=c(Q(),1);var Pk=c(E(),1),q9=[],fGe=6,pGe={placement:"bottom-start"};function ube({clientId:e}){let{categories:t,currentPatternName:o,patterns:r}=(0,GL.useSelect)(a=>{let{getBlockAttributes:l,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=a(C),f=l(e),p=f?.metadata?.categories||q9,h=u(e),m=p.length>0?d(h):q9;return{categories:p,currentPatternName:f?.metadata?.patternName,patterns:m}},[e]),{replaceBlocks:n}=(0,GL.useDispatch)(C),i=(0,cbe.useMemo)(()=>t.length===0||!r||r.length===0?q9:r.filter(a=>{let l=a.source==="core"||a.source?.startsWith("pattern-directory")&&a.source!=="pattern-directory/theme";return a.blocks.length===1&&!l&&o!==a.name&&a.categories?.some(u=>t.includes(u))&&(a.syncStatus==="unsynced"||!a.id)}).slice(0,fGe),[t,o,r]);if(i.length<2)return null;let s=a=>{let l=(a.blocks??[]).map(u=>(0,lbe.cloneBlock)(u));l[0].attributes.metadata={...l[0].attributes.metadata,categories:t},n(e,l)};return(0,Pk.jsx)(Om.Dropdown,{popoverProps:pGe,renderToggle:({onToggle:a,isOpen:l})=>(0,Pk.jsx)(Om.ToolbarGroup,{children:(0,Pk.jsx)(Om.ToolbarButton,{onClick:()=>a(!l),"aria-expanded":l,children:(0,abe.__)("Change design")})}),renderContent:()=>(0,Pk.jsx)(Om.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Pk.jsx)(gu,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}var gc=c(U(),1),gbe=c(G(),1),YL=c(Q(),1);var KL=c(Q(),1),Lm=c(ue(),1),hbe=c(F(),1);var Z9=c(WL(),1),fbe=c(G(),1);function pbe(e,t){for(let o of new Z9.default(t).values()){if(o.indexOf("is-style-")===-1)continue;let r=o.substring(9),n=e?.find(({name:i})=>i===r);if(n)return n}return $L(e)}function Am(e,t,o){let r=new Z9.default(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+o.name),r.value}function mbe(e){return!e||e.length===0?[]:$L(e)?e:[{name:"default",label:(0,fbe._x)("Default","block style"),isDefault:!0},...e]}function $L(e){return e?.find(t=>t.isDefault)}function mGe(e,t){return(0,hbe.useMemo)(()=>{let o=t?.example,r=t?.name;if(o&&r)return(0,Lm.getBlockFromExample)(r,{attributes:o.attributes,innerBlocks:o.innerBlocks,innerContent:o.innerContent});if(e)return(0,Lm.cloneBlock)(e)},[e,t?.example,t?.name])}function Ik({clientId:e,onSwitch:t}){let o=p=>{let{getBlock:h}=p(C),m=h(e);if(!m)return{};let g=(0,Lm.getBlockType)(m.name),{getBlockStyles:b}=p(Lm.store);return{block:g?.example?null:m,blockType:g,styles:b(m.name),className:m.attributes.className||""}},{styles:r,block:n,blockType:i,className:s}=(0,KL.useSelect)(o,[e]),{updateBlockAttributes:a}=(0,KL.useDispatch)(C),l=mbe(r),u=pbe(l,s),d=mGe(n,i);return{onSelect:p=>{let h=Am(s,u,p);a(e,{className:h}),t()},stylesToRender:l,activeStyle:u,genericPreviewBlock:d,className:s}}var Mm=c(E(),1),{getVariationStyle:hGe}=H(Sr),gGe=(0,Mm.jsxs)(gc.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Mm.jsx)(gc.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,Mm.jsx)(gc.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function bGe({clientId:e}){let{stylesToRender:t,activeStyle:o,className:r}=Ik({clientId:e}),{updateBlockAttributes:n}=(0,YL.useDispatch)(C),{globalSettings:i,globalStyles:s,blockName:a}=(0,YL.useSelect)(d=>{let f=d(C).getSettings();return{globalSettings:f.__experimentalFeatures,globalStyles:f[rs],blockName:d(C).getBlockName(e)}},[e]),l=o?.name?hGe({settings:i,styles:s},a,o.name)?.color?.background:void 0;return!t||t.length===0?null:(0,Mm.jsx)(gc.ToolbarGroup,{children:(0,Mm.jsx)(gc.ToolbarButton,{onClick:()=>{let f=(t.findIndex(m=>m.name===o.name)+1)%t.length,p=t[f],h=Am(r,o,p);n(e,{className:h})},label:(0,gbe.__)("Shuffle styles"),children:(0,Mm.jsx)(gc.Icon,{icon:gGe,style:{fill:l||"transparent"}})})})}var bbe=bGe;var XL=c(U(),1),X9=c(G(),1),ybe=c(Q(),1),QL=c(ue(),1);var qL=c(Q(),1);function ZL(e){let{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i}=(0,qL.useSelect)(u=>{let{isSectionBlock:d,getParentSectionBlock:f,getEditedContentOnlySection:p,isWithinEditedContentOnlySection:h}=H(u(C)),m=p();return{isSectionBlock:d(e),isWithinSection:d(e)||!!f(e),isWithinEditedSection:h(e),isEditingContentOnlySection:m===e,editedContentOnlySection:m}},[e]),s=(0,qL.useDispatch)(C),{editContentOnlySection:a,stopEditingContentOnlySection:l}=H(s);return{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i,editContentOnlySection:a,stopEditingContentOnlySection:l}}var Q9=c(E(),1);function vbe({clientId:e}){let{isSectionBlock:t,isEditingContentOnlySection:o,editContentOnlySection:r,stopEditingContentOnlySection:n}=ZL(e),i=(0,ybe.useSelect)(l=>{if(!e)return null;let{getBlockName:u}=l(C),d=u(e);return d?{name:d}:null},[e]);if(!e||!t&&!o||(0,QL.isReusableBlock)(i)||(0,QL.isTemplatePart)(i))return null;let s=o;return(0,Q9.jsx)(XL.ToolbarGroup,{children:(0,Q9.jsx)(XL.ToolbarButton,{onClick:()=>{s?n():r(e)},children:s?(0,X9.__)("Exit pattern"):(0,X9.__)("Edit pattern")})})}var $be=c(U(),1),Kbe=c(G(),1),Ybe=c(Q(),1);var pE=c(ue(),1),qbe=c(dv(),1);var xu=c(G(),1),wu=c(U(),1),Dm=c(ue(),1),sM=c(Q(),1);var Ebe=c(G(),1),uE=c(U(),1),eM=c(ue(),1),tM=c(F(),1);var Sbe=c(U(),1),kbe=c(fe(),1);var cE=c(E(),1);function Nm({blocks:e,placement:t="right-start",offset:o=16,anchor:r}){return(0,kbe.useViewportMatch)("medium","<")?null:(0,cE.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,cE.jsx)(Sbe.Popover,{className:"block-editor-block-switcher__popover-preview",placement:t,focusOnMount:!1,offset:o,anchor:r,children:(0,cE.jsx)("div",{className:"block-editor-block-switcher__preview",children:(0,cE.jsx)(bs,{viewportWidth:601,blocks:e})})})})}var _be=c(U(),1),Ok=c(ue(),1),xbe=c(Q(),1),JL=c(F(),1);var Qd=c(E(),1),yGe={};function wbe({clientIds:e,blocks:t}){let{activeBlockVariation:o,blockVariationTransformations:r}=(0,xbe.useSelect)(i=>{let{getBlockAttributes:s,canRemoveBlocks:a}=i(C),{getActiveBlockVariation:l,getBlockVariations:u}=i(Ok.store),d=a(e);if(t.length!==1||!d)return yGe;let[f]=t;return{blockVariationTransformations:u(f.name,"transform"),activeBlockVariation:l(f.name,s(f.clientId))}},[e,t]);return(0,JL.useMemo)(()=>r?.filter(({name:i})=>i!==o?.name),[r,o])}var vGe=({transformations:e,onSelect:t,blocks:o})=>{let[r,n]=(0,JL.useState)();return(0,Qd.jsxs)(Qd.Fragment,{children:[r&&(0,Qd.jsx)(Nm,{blocks:(0,Ok.cloneBlock)(o[0],e.find(({name:i})=>i===r).attributes)}),e?.map(i=>(0,Qd.jsx)(SGe,{item:i,onSelect:t,setHoveredTransformItemName:n},i.name))]})};function SGe({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i}=e;return(0,Qd.jsxs)(_be.MenuItem,{className:(0,Ok.getBlockMenuDefaultClassName)(r),onClick:s=>{s.preventDefault(),t(r)},onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,Qd.jsx)(Et,{icon:n,showColors:!0}),i]})}var Cbe=vGe;var xs=c(E(),1);function kGe(e){let t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},o=(0,tM.useMemo)(()=>{let r=Object.keys(t),n=e.reduce((i,s)=>{let{name:a}=s;return r.includes(a)?i.priorityTextTransformations.push(s):i.restTransformations.push(s),i},{priorityTextTransformations:[],restTransformations:[]});if(n.priorityTextTransformations.length===1&&n.priorityTextTransformations[0].name==="core/quote"){let i=n.priorityTextTransformations.pop();n.restTransformations.push(i)}return n},[e]);return o.priorityTextTransformations.sort(({name:r},{name:n})=>t[r]{let[s,a]=(0,tM.useState)(),{priorityTextTransformations:l,restTransformations:u}=kGe(t),d=l.length&&u.length,f=!!u.length&&(0,xs.jsx)(xGe,{restTransformations:u,onSelect:r,setHoveredTransformItem:a});return(0,xs.jsxs)(xs.Fragment,{children:[(0,xs.jsxs)(uE.MenuGroup,{label:(0,Ebe.__)("Transform to"),className:e,children:[s&&(0,xs.jsx)(Nm,{blocks:(0,eM.switchToBlockType)(i,s.name,s.variationName)}),!!o?.length&&(0,xs.jsx)(Cbe,{transformations:o,blocks:i,onSelect:n}),l.map(p=>(0,xs.jsx)(Tbe,{item:p,onSelect:r,setHoveredTransformItem:a},p.id||p.name)),!d&&f]}),!!d&&(0,xs.jsx)(uE.MenuGroup,{className:e,children:f})]})};function xGe({restTransformations:e,onSelect:t,setHoveredTransformItem:o}){return e.map(r=>(0,xs.jsx)(Tbe,{item:r,onSelect:t,setHoveredTransformItem:o},r.id||r.name))}function Tbe({item:e,onSelect:t,setHoveredTransformItem:o}){let{name:r,icon:n,title:i,isDisabled:s}=e;return(0,xs.jsxs)(uE.MenuItem,{className:(0,eM.getBlockMenuDefaultClassName)(r),onClick:a=>{a.preventDefault(),t(r,e.variationName)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(e),onFocus:()=>o(e),onBlur:()=>o(null),children:[(0,xs.jsx)(Et,{icon:n,showColors:!0}),i]})}var Rbe=_Ge;var Ibe=c(G(),1),Obe=c(U(),1),rM=c(F(),1);var oM=c(U(),1);var Ak=c(E(),1),Bbe=()=>{};function Pbe({stylesToRender:e,activeStyle:t,onSelect:o=Bbe,onHoverStyle:r=Bbe}){return!e||e.length===0?null:(0,Ak.jsx)(Ak.Fragment,{children:e.map(n=>{let i=n.label||n.name;return(0,Ak.jsx)(oM.MenuItem,{icon:t.name===n.name?ns:null,onClick:()=>o(n),onFocus:()=>r(n),onBlur:()=>r(null),onMouseEnter:()=>r(n),onMouseLeave:()=>r(null),children:(0,Ak.jsx)(oM.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:i})},n.name)})})}var dE=c(E(),1);function nM({hoveredBlock:e,onSwitch:t}){let{clientId:o}=e,[r,n]=(0,rM.useState)(null),{onSelect:i,stylesToRender:s,activeStyle:a,genericPreviewBlock:l,className:u}=Ik({clientId:o,onSwitch:t}),d=(0,rM.useMemo)(()=>{if(!r||!l)return null;let f=Am(u,a,r);return[{...l,attributes:{...l.attributes||{},className:f}}]},[r,l,u,a]);return!s||s.length===0?null:(0,dE.jsxs)(Obe.MenuGroup,{label:(0,Ibe.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:[d&&(0,dE.jsx)(Nm,{blocks:d}),(0,dE.jsx)(Pbe,{stylesToRender:s,activeStyle:a,onSelect:i,onHoverStyle:n})]})}var eG=c(G(),1),Vbe=c(F(),1),iM=c(fe(),1);var Jd=c(U(),1);var Mbe=c(F(),1),Nbe=c(ue(),1);var Abe=c(ue(),1),J9=(e,t,o=new Set)=>{let{clientId:r,name:n,innerBlocks:i=[]}=e;if(!o.has(r)){if(n===t)return e;for(let s of i){let a=J9(s,t,o);if(a)return a}}},Lbe=(e,t)=>{let o=(0,Abe.getBlockAttributesNamesByRole)(e,"content");return o?.length?o.reduce((r,n)=>(t[n]&&(r[n]=t[n]),r),{}):t};var wGe=(e,t)=>{let o=Lbe(t.name,t.attributes);e.attributes={...e.attributes,...o}},CGe=(e,t)=>{let o=t.map(n=>(0,Nbe.cloneBlock)(n)),r=new Set;for(let n of e){let i=!1;for(let s of o){let a=J9(s,n.name,r);if(a){i=!0,r.add(a.clientId),wGe(a,n);break}}if(!i)return}return o},EGe=(e,t)=>(0,Mbe.useMemo)(()=>e.reduce((o,r)=>{let n=CGe(t,r.blocks);return n&&o.push({...r,transformedBlocks:n}),o},[]),[e,t]),Dbe=EGe;var qn=c(E(),1);function TGe({blocks:e,patterns:t,onSelect:o}){let[r,n]=(0,Vbe.useState)(!1),i=Dbe(t,e);return i.length?(0,qn.jsxs)(Jd.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,qn.jsx)(RGe,{patterns:i,onSelect:o}),(0,qn.jsx)(Jd.MenuItem,{onClick:s=>{s.preventDefault(),n(!r)},icon:un,children:(0,eG.__)("Patterns")})]}):null}function RGe({patterns:e,onSelect:t}){let o=(0,iM.useViewportMatch)("medium","<");return(0,qn.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,qn.jsx)(Jd.Popover,{className:"block-editor-block-switcher__popover-preview",placement:o?"bottom":"right-start",offset:16,children:(0,qn.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,qn.jsx)(BGe,{patterns:e,onSelect:t})})})})}function BGe({patterns:e,onSelect:t}){return(0,qn.jsx)(Jd.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,eG.__)("Patterns list"),children:e.map(o=>(0,qn.jsx)(Fbe,{pattern:o,onSelect:t},o.name))})}function Fbe({pattern:e,onSelect:t}){let o="block-editor-block-switcher__preview-patterns-container",r=(0,iM.useInstanceId)(Fbe,`${o}-list__item-description`);return(0,qn.jsxs)("div",{className:`${o}-list__list-item`,children:[(0,qn.jsxs)(Jd.Composite.Item,{render:(0,qn.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,qn.jsx)(bs,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,qn.jsx)("div",{className:`${o}-list__item-title`,children:e.title})]}),!!e.description&&(0,qn.jsx)(bt,{id:r,children:e.description})]})}var zbe=TGe;var ra=c(E(),1);function PGe({onClose:e,clientIds:t}){let{replaceBlocks:o,multiSelect:r,updateBlockAttributes:n}=(0,sM.useDispatch)(C),{possibleBlockTransformations:i,patterns:s,blocks:a,isUsingBindings:l,canRemove:u,hasBlockStyles:d}=(0,sM.useSelect)(T=>{let{getBlockAttributes:B,getBlocksByClientId:R,getBlockRootClientId:I,getBlockTransformItems:A,__experimentalGetPatternTransformItems:P,canRemoveBlocks:O,getBlockName:N}=T(C),{getBlockStyles:z}=T(Dm.store),V=I(t[0]),M=R(t),D=t.length===1,L=D&&N(t[0]),j=D&&!!z(L)?.length;return{blocks:M,possibleBlockTransformations:A(M,V),patterns:P(M,V),isUsingBindings:t.every(q=>!!B(q)?.metadata?.bindings),canRemove:O(t),hasBlockStyles:j}},[t]),f=wbe({clientIds:t,blocks:a});function p(T){T.length>1&&r(T[0].clientId,T[T.length-1].clientId)}function h(T,B){let R=(0,Dm.switchToBlockType)(a,T,B);o(t,R),p(R)}function m(T){n(a[0].clientId,{...f.find(({name:B})=>B===T).attributes})}function g(T){o(t,T),p(T)}let b=a.length===1,v=b&&((0,Dm.isTemplatePart)(a[0])||(0,Dm.isReusableBlock)(a[0])),y=!!i?.length&&u&&!v,k=!!f?.length,S=!!s?.length&&u,_=y||k;if(!(d||_||S))return(0,ra.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,xu.__)("No transforms.")});let w=b?(0,xu._x)("This block is connected.","block toolbar button label and description"):(0,xu._x)("These blocks are connected.","block toolbar button label and description");return(0,ra.jsxs)("div",{className:"block-editor-block-switcher__container",children:[S&&(0,ra.jsx)(zbe,{blocks:a,patterns:s,onSelect:T=>{g(T),e()}}),_&&(0,ra.jsx)(Rbe,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:f,blocks:a,onSelect:(T,B)=>{h(T,B),e()},onSelectVariation:T=>{m(T),e()}}),d&&(0,ra.jsx)(nM,{hoveredBlock:a[0],onSwitch:e}),l&&(0,ra.jsx)(wu.MenuGroup,{children:(0,ra.jsx)(wu.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:w})})]})}var IGe=({children:e,clientIds:t,label:o,text:r})=>{let i=t.length===1?(0,xu.__)("Change block type or style"):(0,xu.sprintf)((0,xu._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,ra.jsx)(wu.ToolbarGroup,{children:(0,ra.jsx)(wu.ToolbarItem,{children:s=>(0,ra.jsx)(wu.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:r,toggleProps:{description:i,...s},menuProps:{orientation:"both"},children:({onClose:a})=>(0,ra.jsx)(PGe,{onClose:a,clientIds:t})})})})},jbe=IGe;var Hbe=c(G(),1),Mk=c(U(),1);var Lk=c(E(),1);function Ube({clientIds:e,children:t,label:o,text:r}){return(0,Lk.jsx)(Mk.ToolbarGroup,{children:(0,Lk.jsx)(Mk.ToolbarItem,{children:n=>(0,Lk.jsx)(Mk.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:r,toggleProps:{description:(0,Hbe.__)("Change block style"),...n},menuProps:{orientation:"both"},children:({onClose:i})=>(0,Lk.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Lk.jsx)(nM,{hoveredBlock:{clientId:e[0]},onSwitch:i})})})})})}var Nk=c(U(),1),fE=c(G(),1),aM=c(F(),1),Gbe=c(Q(),1);var ef=c(E(),1);function OGe({clientIds:e,blockTitle:t}){let o=(0,Gbe.useSelect)(i=>{let{getBlockAttributes:s}=i(C);return s(e?.[0])?.metadata?.name},[e]),r=e.length===1,n;return r&&o?n=(0,fE.sprintf)((0,fE.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),o):n=(0,fE.__)("These blocks are editable using overrides."),(0,ef.jsx)(Nk.__experimentalText,{children:n})}function Wbe({icon:e,clientIds:t,blockTitle:o,label:r}){let[n,i]=(0,aM.useState)(!1),s=(0,aM.useRef)();return(0,ef.jsxs)(ef.Fragment,{children:[(0,ef.jsx)(Nk.ToolbarButton,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:r,onClick:()=>i(!n),"aria-expanded":n}),n&&(0,ef.jsx)(Nk.Popover,{anchor:s.current,onClose:()=>i(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,ef.jsx)(OGe,{clientIds:t,blockTitle:o})})]})}var Dk=c(E(),1);function AGe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlockParentsByBlockName:n,canRemoveBlocks:i,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:l,isSectionBlock:u}=H(e(C)),{getBlockStyles:d}=e(pE.store),f=t.some(R=>s(R)==="contentOnly"),p=t.length===1,h=p&&o(t[0]),m=p&&!!d(h)?.length,g=t.some(R=>!!r(R)?.metadata?.patternName&&u(R)),b=t.every(R=>Ox(r(R)?.metadata?.bindings)),v=t.every(R=>n(R,"core/block",!0).length>0),y=i(t),k=t.every(R=>l(R)),S=a(t[0]),_=S==="default",x=S==="contentOnly",T=!g&&_&&(m||y)&&!f&&k,B=b&&v;return T?"switcher":x&&m&&!b&&k?"styles-only":B?"pattern-overrides":"default"}function LGe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlock:n,isSectionBlock:i}=H(e(C)),s=t.length===1,a=t[0],l=r(a);if(s&&l?.metadata?.patternName&&i(a))return Hc;let u=o(a),d=(0,pE.getBlockType)(u);if(s){let{getActiveBlockVariation:h}=e(pE.store);return h(u,l,void 0,n?.(a)?.innerContent)?.icon||d?.icon}let f=t.map(h=>o(h));return new Set(f).size===1?d?.icon:og}function Zbe({clientIds:e,isSynced:t}){let{icon:o,showIconLabels:r,variant:n}=(0,Ybe.useSelect)(f=>({icon:LGe({select:f,clientIds:e}),showIconLabels:f(qbe.store).get("core","showIconLabels"),variant:AGe({select:f,clientIds:e})}),[e]),i=jn({clientId:e?.[0],maximumLength:35}),s=e.length===1,a=s&&t&&!r,l=s?i:(0,Kbe.__)("Multiple blocks selected"),u=a&&i?i:void 0,d=(0,Dk.jsx)(Et,{className:"block-editor-block-toolbar__block-icon",icon:o});return n==="switcher"?(0,Dk.jsx)(jbe,{clientIds:e,label:l,text:u,children:d}):n==="styles-only"?(0,Dk.jsx)(Ube,{clientIds:e,label:l,text:u,children:d}):n==="pattern-overrides"?(0,Dk.jsx)(Wbe,{icon:d,clientIds:e,blockTitle:i,label:l}):(0,Dk.jsx)($be.ToolbarButton,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:l,icon:d,text:u})}var At=c(E(),1);function oG({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,variant:n="unstyled"}){let{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:l,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:f,isUsingBindings:p,isSectionContainer:h,hasContentOnlyLocking:m,showShuffleButton:g,showSlots:b,showGroupButtons:v,showLockButtons:y,showBlockVisibilityButton:k,showSwitchSectionStyleButton:S,areSelectedBlocksHiddenOnViewport:_,showStyleStateSlot:x,canEdit:w}=(0,Qbe.useSelect)(V=>{let{canEditBlock:M}=V(C),{getBlockName:D,getBlockMode:L,getBlockParents:j,getSelectedBlockClientIds:q,isBlockValid:J,getBlockEditingMode:te,getBlockAttributes:ee,getSettings:$,getTemplateLock:W,getParentSectionBlock:Y,isZoomOut:Z,isSectionBlock:oe,isBlockHiddenAtViewport:ne,getSelectedBlockStyleState:X,isResponsiveEditing:re}=H(V(C)),ae=q(),ve=ae[0],xe=j(ve),be=Y(ve)??xe[xe.length-1],he=D(be),ke=(0,tf.getBlockType)(he),_e=te(ve),we=_e==="default",Re=D(ve),se=ae.every(ut=>J(ut)),ie=ae.every(ut=>L(ut)==="visual"),Ae=ae.every(ut=>!!ee(ut)?.metadata?.bindings),ye=ae.some(ut=>W(ut)==="contentOnly"),Ee=Z(),qe=oe(ve),pt=M(ve),at=pt&&(Ee||qe),Ct=$()?.[wa]?.toLowerCase()||"desktop",rt=ae.length>0&&ae.every(ut=>ne(ut,Ct)),Ot=re()&&Hi(X(ve));return{blockClientId:ve,blockClientIds:ae,isDefaultEditingMode:we,blockType:ve&&(0,tf.getBlockType)(Re),shouldShowVisualToolbar:se&&ie,toolbarKey:`${ve}${be}`,showParentSelector:!Ee&&ke&&_e!=="contentOnly"&&te(be)!=="disabled"&&(0,tf.hasBlockSupport)(ke,"__experimentalParentSelector",!0)&&ae.length===1,isUsingBindings:Ae,isSectionContainer:qe,hasContentOnlyLocking:ye,showShuffleButton:Ee,showSlots:!Ee&&!Ot,showStyleStateSlot:!Ee&&Ot,showGroupButtons:!Ee,showLockButtons:!Ee,showBlockVisibilityButton:!Ee,showSwitchSectionStyleButton:at,areSelectedBlocksHiddenOnViewport:rt,canEdit:pt}},[]),T=(0,tG.useRef)(null),B=(0,tG.useRef)(),R=Sk({ref:B}),I=!(0,Jbe.useViewportMatch)("medium","<");if(!UL())return null;let P=s.length>1,O=(0,tf.isReusableBlock)(l)||(0,tf.isTemplatePart)(l),N=K("block-editor-block-contextual-toolbar",{"has-parent":f}),z=K("block-editor-block-toolbar",{"is-synced":O,"is-connected":p});return(0,At.jsx)(Bk,{focusEditorOnEscape:!0,className:N,"aria-label":(0,Xbe.__)("Block tools"),variant:n==="toolbar"?void 0:n,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,children:(0,At.jsxs)("div",{ref:T,className:z,children:[f&&!P&&I&&(0,At.jsx)(Hhe,{}),(d||P)&&(0,At.jsx)("div",{ref:B,...R,children:(0,At.jsxs)(eye.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,At.jsx)(Zbe,{clientIds:s,isSynced:O}),a&&k&&(0,At.jsx)(Uj,{clientIds:s}),!P&&a&&y&&(0,At.jsx)(z9,{clientId:i}),(0,At.jsx)(pL,{clientIds:s,hideDragHandle:e})]})}),!_&&!m&&d&&P&&v&&(0,At.jsx)(M9,{}),!P&&w&&(0,At.jsx)(vbe,{clientId:s[0]}),!_&&g&&(0,At.jsx)(ube,{clientId:s[0]}),!_&&S&&(0,At.jsx)(bbe,{clientId:s[0]}),!_&&d&&(0,At.jsxs)(At.Fragment,{children:[!h&&(0,At.jsxs)(At.Fragment,{children:[b&&(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(No.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(No.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),x&&(0,At.jsx)(No.Slot,{group:"style-state",className:"block-editor-block-toolbar__slot"})]}),b&&(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(No.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,At.jsx)(yL.Slot,{})]})]}),(0,At.jsx)(Jge,{clientIds:s}),(0,At.jsx)(VL,{clientIds:s})]})},u)}function tye({hideDragHandle:e,variant:t}){return(0,At.jsx)(oG,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}var rG=c(E(),1);function nye({clientId:e,isTyping:t,__unstableContentRef:o}){let{capturingClientId:r,isInsertionPointVisible:n,lastClientId:i}=iL(e),s=(0,Vk.useRef)();(0,Vk.useEffect)(()=>{s.current=void 0},[e]);let{stopTyping:a}=(0,oye.useDispatch)(C),l=(0,Vk.useRef)(!1);(0,rye.useShortcut)("core/block-editor/focus-toolbar",()=>{l.current=!0,a(!0)}),(0,Vk.useEffect)(()=>{l.current=!1});let u=r||e,d=nL({contentElement:o?.current,clientId:u});return!t&&(0,rG.jsx)(kb,{clientId:u,bottomClientId:i,className:K("block-editor-block-list__block-popover",{"is-insertion-point-visible":n}),resize:!1,...d,__unstableContentRef:o,children:(0,rG.jsx)(oG,{focusOnMount:l.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:f=>{s.current=f},variant:"toolbar"})})}var lM=c(Q(),1),cM=c(F(),1);var iye=c(U(),1);var sye=c(G(),1),aye=c(E(),1);function MGe({onClick:e}){return(0,aye.jsx)(iye.Button,{variant:"primary",icon:Ca,size:"compact",className:K("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,sye._x)("Add pattern","Generic label for pattern inserter button")})}var lye=MGe;var nG=c(E(),1);function NGe(){let[e,t]=(0,cM.useState)(!1),{hasSelection:o,blockOrder:r,setInserterIsOpened:n,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:l}=(0,lM.useSelect)(m=>{let{getSettings:g,getBlockOrder:b,getSelectionStart:v,getSelectedBlockClientId:y,getSectionRootClientId:k,getBlockInsertionPoint:S,isBlockInsertionPointVisible:_}=H(m(C)),x=k();return{hasSelection:!!v().clientId,blockOrder:b(x),sectionRootClientId:x,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:y(),blockInsertionPoint:S(),insertionPointVisible:_()}},[]),{showInsertionPoint:u}=H((0,lM.useDispatch)(C));if((0,cM.useEffect)(()=>{let m=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(m)}},[]),!e||!o)return null;let d=s,p=r.findIndex(m=>s===m)+1,h=r[p];return l&&a?.index===p?null:(0,nG.jsx)(O2,{previousClientId:d,nextClientId:h,children:(0,nG.jsx)(lye,{onClick:()=>{n({rootClientId:i,insertionIndex:p,tab:"patterns",category:"all"}),u(i,p,{operation:"insert"})}})})}var cye=NGe;var uye=c(Q(),1),dye=c(ue(),1);function fye(){return(0,uye.useSelect)(e=>{let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getBlock:r,getBlockMode:n,getSettings:i,isTyping:s,isBlockInterfaceHidden:a}=H(e(C)),l=t()||o(),u=r(l),d=!!l&&!!u,f=d&&(0,dye.isUnmodifiedDefaultBlock)(u,"content")&&n(l)!=="html",p=l&&!s()&&f,h=!a()&&!i().hasFixedToolbar&&!p&&d&&!f;return{showEmptyBlockSideInserter:p,showBlockToolbarPopover:h}},[])}var il=c(E(),1);function DGe(e){let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getSettings:r,isTyping:n,isDragging:i,isZoomOut:s,getViewportModalClientIds:a}=H(e(C));return{clientId:t()||o(),hasFixedToolbar:r().hasFixedToolbar,isTyping:n(),isZoomOutMode:s(),isDragging:i(),viewportModalClientIds:a(),blockVisibilitySetting:e(C).getSettings().__experimentalFeatures?.blockVisibility?.allowEditing}}function mE({children:e,__unstableContentRef:t,...o}){let{clientId:r,hasFixedToolbar:n,isTyping:i,isZoomOutMode:s,isDragging:a,viewportModalClientIds:l,blockVisibilitySetting:u}=(0,Fk.useSelect)(DGe,[]),d=(0,pye.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:f,getSelectedBlockClientIds:p,getBlockRootClientId:h,getBlockEditingMode:m,getBlockName:g,isGroupable:b,getEditedContentOnlySection:v,canEditBlock:y}=H((0,Fk.useSelect)(C)),{getGroupingBlockName:k}=(0,Fk.useSelect)(dM.store),{showEmptyBlockSideInserter:S,showBlockToolbarPopover:_}=fye(),x=kk(),[w,T]=(0,uM.useState)(null),{canRename:B}=Vb(g(p()[0])),{duplicateBlocks:R,removeBlocks:I,replaceBlocks:A,insertAfterBlock:P,insertBeforeBlock:O,selectBlock:N,moveBlocksUp:z,moveBlocksDown:V,expandBlock:M,stopEditingContentOnlySection:D,showViewportModal:L,hideViewportModal:j}=H((0,Fk.useDispatch)(C));function q(ee){if(!ee.defaultPrevented){if(d("core/block-editor/move-up",ee)||d("core/block-editor/move-down",ee)){let $=p();if($.length){ee.preventDefault();let W=h($[0]);(d("core/block-editor/move-up",ee)?"up":"down")==="up"?z($,W):V($,W);let Z=Array.isArray($)?$.length:1,oe=(0,zk.sprintf)((0,zk._n)("%d block moved.","%d blocks moved.",$.length),Z);(0,aG.speak)(oe)}}else if(d("core/block-editor/duplicate",ee)){let $=p();$.length&&(ee.preventDefault(),R($))}else if(d("core/block-editor/remove",ee)){let $=p();$.length&&(ee.preventDefault(),I($))}else if(d("core/block-editor/paste-styles",ee)){let $=p();if($.length){ee.preventDefault();let W=f($);x(W)}}else if(d("core/block-editor/insert-after",ee)){let $=p();$.length&&(ee.preventDefault(),P($[$.length-1]))}else if(d("core/block-editor/insert-before",ee)){let $=p();$.length&&(ee.preventDefault(),O($[0]))}else if(d("core/block-editor/unselect",ee)){if(ee.target.closest("[role=toolbar]"))return;let $=p();$.length>1&&(ee.preventDefault(),N($[0]))}else if(d("core/block-editor/collapse-list-view",ee)){if((0,iG.isTextField)(ee.target)||(0,iG.isTextField)(ee.target?.contentWindow?.document?.activeElement))return;ee.preventDefault(),M(r)}else if(d("core/block-editor/group",ee)){let $=p();if($.length>1&&b($)){ee.preventDefault();let W=f($),Y=k(),Z=ol(W,Y);A($,Z),(0,aG.speak)((0,zk.__)("Selected blocks are grouped."))}}else if(d("core/block-editor/rename",ee)){let $=p();if($.length===1){let W=m($[0])==="contentOnly";B&&!W&&y($[0])&&(ee.preventDefault(),T($[0]))}}else if(d("core/block-editor/toggle-block-visibility",ee)){if(u===!1)return;let $=p();if($.length){if(ee.preventDefault(),!f($).every(Z=>(0,dM.hasBlockSupport)(Z.name,"visibility",!0))||$.some(Z=>m(Z)!=="default"||!y(Z)))return;L($)}}d("core/block-editor/stop-editing-as-blocks",ee)&&v()&&D()}}let J=Sb(t),te=Sb(t);return(0,il.jsxs)("div",{...o,onKeyDown:q,className:K(o.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,il.jsxs)(pk.Provider,{value:(0,uM.useRef)(!1),children:[!i&&!s&&(0,il.jsx)(lme,{__unstableContentRef:t}),S&&(0,il.jsx)(Che,{__unstableContentRef:t,clientId:r}),_&&(0,il.jsx)(nye,{__unstableContentRef:t,clientId:r,isTyping:i}),!s&&!n&&(0,il.jsx)(sG.Popover.Slot,{name:"block-toolbar",ref:J}),e,(0,il.jsx)(sG.Popover.Slot,{name:"__unstable-block-tools-after",ref:te}),s&&!a&&(0,il.jsx)(cye,{__unstableContentRef:t})]}),w&&(0,il.jsx)(Nb,{clientId:w,onClose:()=>T(null)}),l&&(0,il.jsx)(Fj,{clientIds:l,onClose:j})]})}var hE=c(fe(),1),jk=c(Q(),1),lG=c(Tt(),1),yi=c(io(),1);var mye=c(E(),1),VGe=new Set([yi.UP,yi.RIGHT,yi.DOWN,yi.LEFT,yi.ENTER,yi.BACKSPACE]);function FGe(e){let{keyCode:t,shiftKey:o}=e;return!o&&VGe.has(t)}function gE(){let e=(0,jk.useSelect)(o=>o(C).isTyping(),[]),{stopTyping:t}=(0,jk.useDispatch)(C);return(0,hE.useRefEffect)(o=>{if(!e)return;let{ownerDocument:r}=o,n,i;function s(a){let{clientX:l,clientY:u}=a;n&&i&&(n!==l||i!==u)&&t(),n=l,i=u}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}},[e,t])}function bE(){let e=(0,jk.useSelect)(i=>i(C).isTyping(),[]),{startTyping:t,stopTyping:o}=(0,jk.useDispatch)(C),r=gE(),n=(0,hE.useRefEffect)(i=>{if(e){let d=function(g){let{target:b}=g;h=m.setTimeout(()=>{(0,lG.isTextField)(b)||o()})},f=function(g){let{keyCode:b}=g;(b===yi.ESCAPE||b===yi.TAB)&&o()},p=function(){m.getSelection().isCollapsed||o()};var s=d,a=f,l=p;let h,{defaultView:m}=i.ownerDocument;return i.addEventListener("focus",d),i.addEventListener("keydown",f),i.ownerDocument.addEventListener("selectionchange",p),()=>{m.clearTimeout(h),i.removeEventListener("focus",d),i.removeEventListener("keydown",f),i.ownerDocument.removeEventListener("selectionchange",p)}}function u(d){let{type:f,target:p}=d;!(0,lG.isTextField)(p)||!i.contains(p)||f==="keydown"&&!FGe(d)||t()}return i.addEventListener("keypress",u),i.addEventListener("keydown",u),()=>{i.removeEventListener("keypress",u),i.removeEventListener("keydown",u)}},[e,t,o]);return(0,hE.useMergeRefs)([r,n])}function zGe({children:e}){return(0,mye.jsx)("div",{ref:bE(),children:e})}var hye=zGe;var sl=c(G(),1),rf=c(ue(),1),of=c(Q(),1),cG=c(bye(),1);var jGe=()=>function(){let{replaceBlocks:t,multiSelect:o}=(0,of.useDispatch)(C),{blocks:r,clientIds:n,canRemove:i,possibleBlockTransformations:s,invalidSelection:a}=(0,of.useSelect)(h=>{let{getBlockRootClientId:m,getBlockTransformItems:g,getSelectedBlockClientIds:b,getBlocksByClientId:v,canRemoveBlocks:y}=h(C),k=b(),S=v(k);if(S.filter(x=>!x).length>0)return{invalidSelection:!0};let _=m(k[0]);return{blocks:S,clientIds:k,possibleBlockTransformations:g(S,_),canRemove:y(k),invalidSelection:!1}},[]);if(a)return{isLoading:!1,commands:[]};let l=r.length===1&&(0,rf.isTemplatePart)(r[0]);function u(h){h.length>1&&o(h[0].clientId,h[h.length-1].clientId)}function d(h,m){let g=(0,rf.switchToBlockType)(r,h,m);t(n,g),u(g)}let f=!!s.length&&i&&!l;return!n||n.length<1||!f?{isLoading:!1,commands:[]}:{isLoading:!1,commands:s.map(h=>{let{id:m,name:g,title:b,icon:v,variationName:y}=h,k=!v?.src||v?.src==="block-default"?{src:zx}:v;return{name:"core/block-editor/transform-to-"+(m||g).replace(/\//g,"-"),label:(0,sl.sprintf)((0,sl.__)("Transform to %s"),b),icon:k?.src,category:"command",callback:({close:S})=>{d(g,y),S()}}})}},HGe=()=>function(){let{clientIds:t,isUngroupable:o,isGroupable:r,blockVisibilitySetting:n}=(0,of.useSelect)(O=>{let{getSelectedBlockClientIds:N,getSettings:z,isUngroupable:V,isGroupable:M}=O(C);return{clientIds:N(),isUngroupable:V(),isGroupable:M(),blockVisibilitySetting:z().__experimentalFeatures?.blockVisibility?.allowEditing}},[]),{canInsertBlockType:i,getBlockRootClientId:s,getBlocksByClientId:a,canRemoveBlocks:l,isBlockHiddenAnywhere:u}=H((0,of.useSelect)(C)),{getBlockEditingMode:d}=(0,of.useSelect)(C),{getDefaultBlockName:f,getGroupingBlockName:p}=(0,of.useSelect)(rf.store),h=a(t),m=(0,of.useDispatch)(C),{removeBlocks:g,replaceBlocks:b,duplicateBlocks:v,insertAfterBlock:y,insertBeforeBlock:k}=m,S=()=>{if(!h.length)return;let O=p(),N=ol(h,O);N&&b(t,N)},_=()=>{if(!h.length)return;let O=h[0].innerBlocks;O.length&&b(t,O)};if(!t||t.length<1)return{isLoading:!1,commands:[]};let{showViewportModal:x}=H(m),w=s(t[0]),T=i(f(),w),B=h.every(O=>!!O&&(0,rf.hasBlockSupport)(O.name,"multiple",!0)&&i(O.name,w)),R=l(t),I=[];B&&I.push({name:"duplicate",label:(0,sl.__)("Duplicate"),callback:()=>v(t,!0),icon:og}),T&&I.push({name:"add-before",label:(0,sl.__)("Add before"),callback:()=>{let O=Array.isArray(t)?t[0]:O;k(O)},icon:Ca},{name:"add-after",label:(0,sl.__)("Add after"),callback:()=>{let O=Array.isArray(t)?t[t.length-1]:O;y(O)},icon:Ca}),r&&I.push({name:"Group",label:(0,sl.__)("Group"),callback:S,icon:Wx}),o&&I.push({name:"ungroup",label:(0,sl.__)("Ungroup"),callback:_,icon:B6}),R&&I.push({name:"remove",label:(0,sl.__)("Delete"),callback:()=>g(t,!0),icon:T6});let A=h.every(O=>!!O&&(0,rf.hasBlockSupport)(O.name,"visibility",!0)),P=t.every(O=>d(O)==="default");if(A&&P&&n!==!1){let O=t.some(N=>u(N));I.push({name:"toggle-visibility",label:O?(0,sl.__)("Show"):(0,sl.__)("Hide"),callback:()=>x(t),icon:O?dg:Vl})}return{isLoading:!1,commands:I.map(O=>({...O,name:"core/block-editor/action-"+O.name,category:"command",callback:({close:N})=>{O.callback(),N()}}))}},fM=()=>{(0,cG.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:jGe()}),(0,cG.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:HGe(),context:"block-selection-edit"})};var Wi=c(E(),1),pM=(0,kye.createSlotFill)(Symbol("BlockCanvasCover"));function yye({children:e}){return(0,Wi.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var UGe={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function uG({shouldIframe:e=!0,height:t="300px",children:o=(0,Wi.jsx)(HS,{}),styles:r,contentRef:n,iframeProps:i}){fM();let s=(0,mM.useViewportMatch)("medium","<"),a=gE(),l=_b(),u=(0,vye.useRef)(),d=(0,mM.useMergeRefs)([n,l,u,bE()]),f=(0,Sye.useSelect)(h=>H(h(C)).getZoomLevel(),[]),p=f!==100&&!s?{scale:f,frameSize:"40px"}:{};return e?(0,Wi.jsx)(mE,{__unstableContentRef:u,style:{height:t,display:"flex"},children:(0,Wi.jsxs)(LS,{...i,...p,ref:a,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,Wi.jsx)(pM.Slot,{fillProps:{containerRef:u},children:h=>h.map((m,g)=>(0,Wi.jsx)(yye,{children:m},g))}),(0,Wi.jsx)(Ld,{styles:r}),o]})}):(0,Wi.jsxs)(mE,{__unstableContentRef:u,style:{height:t,display:"flex"},children:[(0,Wi.jsx)(pM.Slot,{fillProps:{containerRef:u},children:h=>h.map((m,g)=>(0,Wi.jsx)(yye,{children:m},g))}),(0,Wi.jsx)(Ld,{styles:r,scope:":where(.editor-styles-wrapper)",transformOptions:UGe}),(0,Wi.jsx)(BA,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:o})]})}function GGe({children:e,height:t,styles:o}){return(0,Wi.jsx)(uG,{height:t,styles:o,children:e})}var _ye=GGe;var Cu=c(U(),1),xye=c(G(),1),wye=c(io(),1),Cye=c(Rt(),1),al=c(E(),1),WGe=()=>(0,al.jsx)(Cu.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,al.jsx)(Cu.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})}),$Ge=({style:e,className:t})=>(0,al.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,al.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,al.jsx)(WGe,{})})}),KGe=({TextColor:e,BackgroundColor:t})=>function({onToggle:r,isOpen:n}){let i=s=>{!n&&s.keyCode===wye.DOWN&&(s.preventDefault(),r())};return(0,al.jsx)(Cu.ToolbarGroup,{children:(0,al.jsx)(Cu.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,xye.__)("Open Colors Selector"),onClick:r,onKeyDown:i,icon:(0,al.jsx)(t,{children:(0,al.jsx)(e,{children:(0,al.jsx)($Ge,{})})})})})},YGe=({children:e,...t})=>((0,Cye.default)("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,al.jsx)(Cu.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:KGe(t),renderContent:()=>e})),Eye=YGe;var Ove=c(Rt(),1),PM=c(U(),1),gG=c(G(),1),Ave=c(Q(),1),Lve=c(F(),1);var Zk=c(fe(),1),Bve=c(U(),1);var SE=c(Q(),1),Pve=c(Rt(),1),Wr=c(F(),1),hG=c(G(),1);var wM=c(U(),1),CM=c(F(),1),EM=c(Q(),1);var Rye=c(fe(),1),Bye=c(Qr(),1),Pye=c(Q(),1),vM=c(F(),1),Hk=c(G(),1);var hM=c(F(),1),gM=(0,hM.createContext)({});gM.displayName="ListViewContext";var Vm=()=>(0,hM.useContext)(gM);var bM=c(F(),1),Tye=c(E(),1);function yM({children:e,...t}){let o=(0,bM.useRef)();return(0,bM.useEffect)(()=>{o.current&&(o.current.textContent=o.current.textContent)},[e]),(0,Tye.jsx)("div",{hidden:!0,...t,ref:o,children:e})}var yE=c(E(),1),dG=(0,vM.forwardRef)(({nestingLevel:e,blockCount:t,clientId:o,...r},n)=>{let{insertedBlock:i,setInsertedBlock:s}=Vm(),a=(0,Rye.useInstanceId)(dG),{directInsert:l,hideInserter:u}=(0,Pye.useSelect)(m=>{let{getBlockListSettings:g,getTemplateLock:b,isZoomOut:v}=H(m(C)),k=g(o)?.directInsert||!1,S=!!b(o)||v();return{directInsert:k,hideInserter:S}},[o]),d=jn({clientId:o,context:"list-view"}),f=jn({clientId:i?.clientId,context:"list-view"});if((0,vM.useEffect)(()=>{f?.length&&(0,Bye.speak)((0,Hk.sprintf)((0,Hk.__)("%s block inserted"),f),"assertive")},[f]),u)return null;let p=`list-view-appender__${a}`,h=(0,Hk.sprintf)((0,Hk.__)("Append to %1$s block at position %2$d, Level %3$d"),d,t+1,e);return(0,yE.jsxs)("div",{className:"list-view-appender",children:[(0,yE.jsx)(Za,{ref:n,rootClientId:o,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:l,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":p},onSelectOrClose:m=>{m?.clientId&&s(m)}}),(0,yE.jsx)(yM,{id:p,children:h})]})});var Wk=c(ue(),1),zb=c(U(),1),_M=c(fe(),1);var Gr=c(F(),1),$k=c(Q(),1),pG=c(G(),1),xM=c(io(),1),eve=c(GC(),1),tve=c(Yl(),1),ove=c(Qr(),1);var Iye=c(U(),1),Oye=c(fe(),1),Aye=c(F(),1);var Lye=c(E(),1),qGe=_ee(Iye.__experimentalTreeGridRow),ZGe=(0,Aye.forwardRef)(({isDragged:e,isSelected:t,position:o,level:r,rowCount:n,children:i,className:s,path:a,...l},u)=>{let d=QP({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),f=(0,Oye.useMergeRefs)([u,d]);return(0,Lye.jsx)(qGe,{ref:f,className:K("block-editor-list-view-leaf",s),level:r,positionInSet:o,setSize:n,isExpanded:void 0,...l,children:i})}),Mye=ZGe;var Nye=c(Tt(),1),Dye=c(F(),1);function Vye({isSelected:e,selectedClientIds:t,rowItemRef:o}){let r=t.length===1;(0,Dye.useLayoutEffect)(()=>{if(!e||!r||!o.current)return;let n=(0,Nye.getScrollContainer)(o.current),{ownerDocument:i}=o.current;if(n===i.body||n===i.documentElement||!n)return;let a=o.current.getBoundingClientRect(),l=n.getBoundingClientRect();(a.topl.bottom)&&o.current.scrollIntoView()},[e,r,o])}var $ye=c(F(),1);var Uk=c(U(),1),Gye=c(F(),1);var kM=c(io(),1);var Fye=c(G(),1),fG=c(E(),1);function SM({onClick:e}){return(0,fG.jsx)("span",{className:"block-editor-list-view__expander",onClick:e?t=>e(t,{forceToggle:!0}):void 0,"aria-hidden":"true","data-testid":"list-view-expander",children:(0,fG.jsx)(gt,{icon:(0,Fye.isRTL)()?jx:rp})})}var zye=c(F(),1),jye=c(Q(),1);var XGe=3,Hye={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if(t.backgroundType==="image"&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if(t.mediaType==="image"&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{let t=[],o=e?.length?Hye[e[0].name]:void 0;if(!o)return t;for(let r of e){let n=o(r);if(n&&t.push(n),t.length>=XGe)return t}return t}};function QGe(e,t){let o=Hye[e.name],r=o?o(e):void 0;return r?Array.isArray(r)?t?[]:r:[r]:[]}function Uye({clientId:e,isExpanded:t}){let{block:o}=(0,jye.useSelect)(n=>({block:n(C).getBlock(e)}),[e]);return(0,zye.useMemo)(()=>QGe(o,t),[o,t])}var Ur=c(E(),1),{Badge:JGe}=H(Uk.privateApis);function eWe({className:e,block:{clientId:t},onClick:o,onContextMenu:r,onMouseDown:n,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:l,onDragEnd:u,draggable:d,isExpanded:f,ariaDescribedBy:p,visibilityLabel:h,isDisabled:m=!1},g){let b=Do(t),v=jn({clientId:t,context:"list-view"}),{isLocked:y}=oa(t),k=y,S=b?.positionType==="sticky",_=Uye({clientId:t,isExpanded:f}),x=T=>{T.dataTransfer.clearData(),l?.(T)};function w(T){(T.keyCode===kM.ENTER||T.keyCode===kM.SPACE)&&o(T)}return(0,Ur.jsxs)("a",{className:K("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:w,onMouseDown:n,ref:g,tabIndex:s,onFocus:a,onDragStart:x,onDragEnd:u,draggable:d,href:m?void 0:`#block-${t}`,"aria-disabled":m?!0:void 0,"aria-describedby":p,"aria-expanded":f,children:[(0,Ur.jsx)(SM,{onClick:i}),(0,Ur.jsx)(Et,{icon:b?.icon,showColors:!0,context:"list-view"}),(0,Ur.jsxs)(Uk.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Ur.jsx)(Uk.__experimentalTruncate,{ellipsizeMode:"auto",children:v})}),b?.anchor&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,Ur.jsx)(JGe,{className:"block-editor-list-view-block-select-button__anchor",children:b.anchor})}),S&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,Ur.jsx)(gt,{icon:M4})}),_.length?(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:_.map((T,B)=>(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${T.url})`,zIndex:_.length-B}},T.clientId))}):null,!!h&&(0,Ur.jsxs)(kt.Root,{children:[(0,Ur.jsx)(kt.Trigger,{render:(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,Ur.jsx)(gt,{icon:Vl})})}),(0,Ur.jsx)(kt.Popup,{children:h})]}),k&&(0,Ur.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,Ur.jsx)(gt,{icon:T4})})]})]})}var Wye=(0,Gye.forwardRef)(eWe);var Fm=c(E(),1),tWe=(0,$ye.forwardRef)(({onClick:e,onToggleExpanded:t,block:o,isSelected:r,position:n,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:l,...u},d)=>{let{clientId:f}=o,{AdditionalBlockContent:p,insertedBlock:h,setInsertedBlock:m}=Vm(),g=l.includes(f)?l:[f];return(0,Fm.jsxs)(Fm.Fragment,{children:[p&&(0,Fm.jsx)(p,{block:o,insertedBlock:h,setInsertedBlock:m}),(0,Fm.jsx)(lL,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:b,onDragStart:v,onDragEnd:y})=>(0,Fm.jsx)(Wye,{ref:d,className:"block-editor-list-view-block-contents",block:o,onClick:e,onToggleExpanded:t,isSelected:r,position:n,siblingBlockCount:i,level:s,draggable:b,onDragStart:v,onDragEnd:y,isExpanded:a,...u})})]})}),Kye=tWe;var Fb=c(G(),1),Yye=c(Tt(),1),qye=(e,t,o)=>(0,Fb.sprintf)((0,Fb.__)("Block %1$d of %2$d, Level %3$d."),e,t,o),Zye=(e,t)=>[e?.positionLabel?`${(0,Fb.sprintf)((0,Fb.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Fb.__)("This block is locked."):void 0].filter(Boolean).join(" "),Xye=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function Qye(e,t,o,r){let n=[...o,e],i=[...r,t],s=Math.min(n.length,i.length)-1,a=n[s],l=i[s];return{start:a,end:l}}function Gk(e,t){if(!t)return;let o=`[role=row][data-block="${e}"]`;return new Promise(r=>{if(t.querySelector(o))return r(t.querySelector(o));let n=null,i=new window.MutationObserver(()=>{t.querySelector(o)&&(clearTimeout(n),i.disconnect(),r(t.querySelector(o)))});i.observe(t,{childList:!0,subtree:!0}),n=setTimeout(()=>{i.disconnect(),r(null)},3e3)}).then(r=>{r&&r.isConnected&&Yye.focus.focusable.find(r)?.[0]?.focus()})}function Jye({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:o,clientId:r,firstDraggedBlockIndex:n,isDragged:i}){let s,a,l;if(!i){a=!1;let u=e[r];l=u>n,t!=null&&n!==void 0?u!==void 0&&(u>=n&&u=t?s="down":s="normal",a=typeof t=="number"&&t-1===u&&o==="inside"):t===null&&n!==void 0?u!==void 0&&u>=n?s="up":s="normal":t!=null&&n===void 0?u!==void 0&&(u{let{getBlock:Ft,getBlockName:nt,getBlockEditingMode:zt,getSettings:Ir,getEditedContentOnlySection:$o}=H(Be(C)),Sn=Ir();return{block:Ft(e),blockName:nt(e),blockEditingMode:zt(e),allowRightClickOverrides:Sn.allowRightClickOverrides,editedSection:$o(),viewportSettings:Sn.__experimentalFeatures?.viewport,blockVisibilitySetting:Sn.__experimentalFeatures?.blockVisibility?.allowEditing}},[e]),ie=ke==="disabled",{canRename:Ae}=Vb(he),ye=(0,Wk.hasBlockSupport)(he,"__experimentalToolbar",!0),qe=`list-view-block-select-button__description-${(0,_M.useInstanceId)(rve)}`,{expand:pt,collapse:at,collapseAll:Ct,BlockSettingsMenu:rt,listViewInstanceId:Ot,expandedState:ut,setInsertedBlock:Gt,treeGridElementRef:So,rootClientId:mo}=Vm(),de=(0,tve.__unstableUseShortcutEventMatch)();function Me(){let Be=te(),Ft=Be.includes(e),nt=Ft?Be[0]:e,zt=$(nt);return{blocksToUpdate:Ft?Be:[e],firstBlockClientId:nt,firstBlockRootClientId:zt,selectedBlockClientIds:Be}}async function Ze(Be){if(Be.defaultPrevented||Be.target.closest("[role=dialog]"))return;if(we&&de("core/block-editor/unselect",Be)){Be.stopPropagation(),Be.preventDefault(),j();return}let Ft=[xM.BACKSPACE,xM.DELETE].includes(Be.keyCode);if(de("core/block-editor/unselect",Be)&&g.length>0)Be.stopPropagation(),Be.preventDefault(),a(Be,void 0);else if(Ft||de("core/block-editor/remove",Be)){let{blocksToUpdate:nt,firstBlockClientId:zt,firstBlockRootClientId:Ir,selectedBlockClientIds:$o}=Me();if(!re(nt))return;let Sn=ee(zt)??Ir;V(nt,!1);let Wh=$o.length>0&&te().length===0;Sn||(Sn=W()[0]),ct(Sn,Wh)}else if(de("core/block-editor/paste-styles",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me(),zt=oe(nt);ge(zt)}else if(de("core/block-editor/duplicate",Be)){Be.preventDefault();let{blocksToUpdate:nt,firstBlockRootClientId:zt}=Me();if(oe(nt).every($o=>!!$o&&(0,Wk.hasBlockSupport)($o.name,"multiple",!0)&&J($o.name,zt))){let $o=await O(nt,!1);$o?.length&&ct($o[0],!1)}}else if(de("core/block-editor/insert-before",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me();await D(nt[0]);let zt=te();ct(zt[0],!1)}else if(de("core/block-editor/insert-after",Be)){Be.preventDefault();let{blocksToUpdate:nt}=Me();await M(nt.at(-1));let zt=te();ct(zt[0],!1)}else if(de("core/block-editor/select-all",Be)){Be.preventDefault();let{firstBlockRootClientId:nt,selectedBlockClientIds:zt}=Me(),Ir=W(nt);if(!Ir.length)return;if((0,eve.isShallowEqual)(zt,Ir)&&nt&&nt!==mo){ct(nt,!0);return}N(Ir[0],Ir[Ir.length-1],null)}else if(de("core/block-editor/collapse-list-view",Be)){Be.preventDefault();let{firstBlockClientId:nt}=Me(),zt=Y(nt,!1);Ct(),pt(zt)}else if(de("core/block-editor/group",Be)){let{blocksToUpdate:nt}=Me();if(nt.length>1&&ae(nt)){Be.preventDefault();let zt=oe(nt),Ir=ve(),$o=ol(zt,Ir);z(nt,$o),(0,ove.speak)((0,pG.__)("Selected blocks are grouped."));let Sn=te();ct(Sn[0],!1)}}else if(de("core/block-editor/toggle-block-visibility",Be)){if(se===!1)return;Be.preventDefault();let{blocksToUpdate:nt}=Me();if(!oe(nt).every($o=>(0,Wk.hasBlockSupport)($o.name,"visibility",!0))||nt.some($o=>Z($o)!=="default"))return;L(nt)}else if(de("core/block-editor/rename",Be)){let{blocksToUpdate:nt}=Me(),zt=Z(nt[0])==="contentOnly";nt.length===1&&Ae&&!zt&&(Be.preventDefault(),B(!0))}}let ze=(0,Gr.useCallback)(()=>{_(!0),q(e,!0)},[e,_,q]),Je=(0,Gr.useCallback)(()=>{_(!1),q(e,!1)},[e,_,q]),lt=(0,Gr.useCallback)(Be=>{let Ft=Be?.detail===0;a(Be,e,Ft?0:null),Be.preventDefault()},[e,a]),ct=(0,Gr.useCallback)((Be,Ft)=>{Ft&&a(void 0,Be,null,null),Gk(Be,So?.current)},[a,So]),yr=(0,Gr.useCallback)(Be=>{Be.preventDefault(),Be.stopPropagation(),m===!0?at(e):m===!1&&pt(e)},[e,pt,at,m]),Ao=(0,Gr.useCallback)(Be=>{let{ownerDocument:Ft}=k?.current||{};!Ft||!Ft.hasFocus()||ye&&_e&&(k.current?.click(),w(new window.DOMRect(Be.clientX,Be.clientY,0,0)),Be.preventDefault())},[_e,k,ye]),rr=(0,Gr.useCallback)(Be=>{_e&&Be.button===2&&Be.preventDefault()},[_e]),ho=(0,Gr.useMemo)(()=>{let{ownerDocument:Be}=y?.current||{};if(!(!x||!Be))return{ownerDocument:Be,getBoundingClientRect(){return x}}},[x]),Go=(0,Gr.useCallback)(()=>{w(void 0)},[w]);if(Vye({isSelected:i,rowItemRef:y,selectedClientIds:g}),!be)return null;let Vn=qye(l,f,u),vr=Zye(xe,R),an=Vj(be?.attributes?.metadata?.blockVisibility,Re),it=f>0,_t=ye&&!ie,Vt=p&&it&&!ie,ko=K("block-editor-list-view-block__mover-cell",{"is-visible":S||i}),Wo=K("block-editor-list-view-block__menu-cell",{"is-visible":S||I}),nr;Vt?nr=2:_t||(nr=3);let Sa=K({"is-selected":i,"is-first-selected":I,"is-last-selected":A,"is-branch-selected":s,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!ye,"is-synced":xe?.isSynced,"is-draggable":X&&!ie,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":o,"is-nesting":n,"is-disabled":ie}),ka=g.includes(e)?g:[e],Ll=Be=>ie?-1:i&&g.length===1?0:Be;return(0,In.jsxs)(Mye,{className:Sa,isDragged:r,onKeyDown:Ze,onMouseEnter:ie?void 0:ze,onMouseLeave:ie?void 0:Je,onFocus:ie?void 0:ze,onBlur:ie?void 0:Je,level:u,position:l,rowCount:d,path:h,id:`list-view-${Ot}-block-${e}`,"data-block":e,"data-expanded":ne?m:void 0,ref:y,children:[(0,In.jsx)(zb.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:nr,ref:v,"aria-selected":!!i,children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,In.jsx)(Kye,{block:be,onClick:lt,onContextMenu:ie?void 0:Ao,onMouseDown:rr,onToggleExpanded:ie?void 0:yr,isSelected:i,position:l,siblingBlockCount:f,level:u,ref:Be,tabIndex:Ll(Ft),onFocus:nt,isExpanded:ne?m:void 0,selectedClientIds:g,ariaDescribedBy:qe,visibilityLabel:an,isDisabled:ie}),(0,In.jsx)(yM,{id:qe,children:[Vn,vr,an].filter(Boolean).join(" ")})]})}),Vt&&(0,In.jsx)(In.Fragment,{children:(0,In.jsxs)(zb.__experimentalTreeGridCell,{className:ko,withoutGridItem:!0,children:[(0,In.jsx)(zb.__experimentalTreeGridItem,{children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(dL,{orientation:"vertical",clientIds:[e],ref:Be,tabIndex:Ft,onFocus:nt})}),(0,In.jsx)(zb.__experimentalTreeGridItem,{children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(fL,{orientation:"vertical",clientIds:[e],ref:Be,tabIndex:Ft,onFocus:nt})})]})}),_t&&rt&&(0,In.jsx)(zb.__experimentalTreeGridCell,{className:Wo,"aria-selected":!!i,ref:k,children:({ref:Be,tabIndex:Ft,onFocus:nt})=>(0,In.jsx)(rt,{clientIds:ka,block:be,icon:zs,label:(0,pG.__)("Options"),popoverProps:{anchor:ho},toggleProps:{ref:Be,className:"block-editor-list-view-block__menu",tabIndex:Ft,onClick:Go,onFocus:nt,size:"small"},disableOpenOnArrowDown:!0,expand:pt,expandedState:ut,setInsertedBlock:Gt,__experimentalSelectBlock:ct,isContentOnlyListView:!!mo&&Z(mo)==="contentOnly"})}),T&&(0,In.jsx)(Nb,{clientId:e,onClose:()=>B(!1)})]})}var nve=(0,Gr.memo)(rve);var na=c(E(),1);function ive(e,t,o,r){return o?.includes(e.clientId)?0:t[e.clientId]??r?1+e.innerBlocks.reduce(oWe(t,o,r),0):1}var oWe=(e,t,o)=>(r,n)=>t?.includes(n.clientId)?r:(e[n.clientId]??o)&&n.innerBlocks.length>0?r+ive(n,e,t,o):r+1,rWe=()=>{};function sve(e){let{blocks:t,selectBlock:o=rWe,showBlockMovers:r,selectedClientIds:n,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:l=0,fixedListWindow:u,isExpanded:d,parentId:f,shouldShowInnerBlocks:p=!0,isSyncedBranch:h=!1,showAppender:m=!0}=e,g=Do(f),b=h||!!g?.isSynced,v=(0,EM.useSelect)(P=>f?P(C).canEditBlock(f):!0,[f]),{blockDropPosition:y,blockDropTargetIndex:k,firstDraggedBlockIndex:S,blockIndexes:_,expandedState:x,draggedClientIds:w}=Vm(),T=(0,CM.useRef)();if(!v)return null;let B=m&&i===1,R=t.filter(Boolean),I=R.length,A=B?I+1:I;return T.current=l,(0,na.jsxs)(na.Fragment,{children:[R.map((P,O)=>{let{clientId:N,innerBlocks:z}=P;O>0&&(T.current+=ive(R[O-1],x,w,d));let V=!!w?.includes(N),{displacement:M,isAfterDraggedBlocks:D,isNesting:L}=Jye({blockIndexes:_,blockDropTargetIndex:k,blockDropPosition:y,clientId:N,firstDraggedBlockIndex:S,isDragged:V}),{itemInView:j}=u,q=j(T.current),J=O+1,te=s.length>0?`${s}_${J}`:`${J}`,ee=!!z?.length,$=ee&&p?x[N]??d:void 0,W=Xye(N,n),Y=a||W&&ee,Z=V||q||W&&N===n[0]||O===0||O===I-1;return(0,na.jsxs)(EM.AsyncModeProvider,{value:!W,children:[Z&&(0,na.jsx)(nve,{block:P,selectBlock:o,isSelected:W,isBranchSelected:Y,isDragged:V,level:i,position:J,rowCount:A,siblingBlockCount:I,showBlockMovers:r,path:te,isExpanded:V?!1:$,listPosition:T.current,selectedClientIds:n,isSyncedBranch:b,displacement:M,isAfterDraggedBlocks:D,isNesting:L}),!Z&&(0,na.jsx)("tr",{children:(0,na.jsx)("td",{className:"block-editor-list-view-placeholder"})}),ee&&$&&!V&&(0,na.jsx)(sve,{parentId:N,blocks:z,selectBlock:o,showBlockMovers:r,level:i+1,path:te,listPosition:T.current+1,fixedListWindow:u,isBranchSelected:Y,selectedClientIds:n,isExpanded:d,isSyncedBranch:b})]},N)}),B&&(0,na.jsx)(wM.__experimentalTreeGridRow,{level:i,setSize:A,positionInSet:A,isExpanded:!0,children:(0,na.jsx)(wM.__experimentalTreeGridCell,{children:P=>(0,na.jsx)(dG,{clientId:f,nestingLevel:i,blockCount:I,...P})})})]})}var ave=(0,CM.memo)(sve);var Kk=c(U(),1),TM=c(Tt(),1),nf=c(F(),1),mG=c(G(),1);var ll=c(E(),1);function lve({draggedBlockClientId:e,listViewRef:t,blockDropTarget:o}){let r=Do(e),n=jn({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=o||{},[l,u]=(0,nf.useMemo)(()=>{if(!t.current)return[];let y=i?t.current.querySelector(`[data-block="${i}"]`):void 0,k=s?t.current.querySelector(`[data-block="${s}"]`):void 0;return[y,k]},[t,i,s]),d=u||l,f=(0,mG.isRTL)(),p=(0,nf.useCallback)((y,k)=>{if(!d)return 0;let S=d.offsetWidth,_=(0,TM.getScrollContainer)(d,"horizontal"),x=d.ownerDocument,w=_===x.body||_===x.documentElement;if(_&&!w){let T=_.getBoundingClientRect(),B=(0,mG.isRTL)()?T.right-y.right:y.left-T.left,R=_.clientWidth;if(RT.right)return S-=y.right-T.right,S}return S-k},[f,d]),h=(0,nf.useMemo)(()=>{if(!d)return{};let y=d.getBoundingClientRect();return{width:p(y,0)}},[p,d]),m=(0,nf.useMemo)(()=>{if(!d)return{};let y=(0,TM.getScrollContainer)(d),k=d.ownerDocument,S=y===k.body||y===k.documentElement;if(y&&!S){let _=y.getBoundingClientRect(),x=d.getBoundingClientRect(),w=f?_.right-x.right:x.left-_.left;if(!f&&_.left>x.left)return{transform:`translateX( ${w}px )`};if(f&&_.right{if(!l)return 1;let y=parseInt(l.getAttribute("aria-level"),10);return y?y+1:1},[l]),b=(0,nf.useMemo)(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),v=(0,nf.useMemo)(()=>{if(!(!d||!(a==="top"||a==="bottom"||a==="inside")))return{contextElement:d,getBoundingClientRect(){let k=d.getBoundingClientRect(),S=k.left,_=0,x=(0,TM.getScrollContainer)(d,"horizontal"),w=d.ownerDocument,T=x===w.body||x===w.documentElement;if(x&&!T){let I=x.getBoundingClientRect(),A=f?x.offsetWidth-x.clientWidth:0;S{}}),(0,ll.jsx)(Et,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,ll.jsx)(Kk.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,ll.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,ll.jsx)(Kk.__experimentalTruncate,{ellipsizeMode:"auto",children:n})})})]}),(0,ll.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var cve=c(Qr(),1),Yk=c(G(),1),vE=c(Q(),1),uve=c(F(),1),ia=c(io(),1),dve=c(ue(),1);function fve(){let{clearSelectedBlock:e,multiSelect:t,selectBlock:o}=(0,vE.useDispatch)(C),{getBlockName:r,getBlockParents:n,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:l}=(0,vE.useSelect)(C),{getBlockType:u}=(0,vE.useSelect)(dve.store);return{updateBlockSelection:(0,uve.useCallback)(async(f,p,h,m)=>{if(!f?.shiftKey&&f?.keyCode!==ia.ESCAPE){o(p,m);return}f.preventDefault();let g=f.type==="keydown"&&f.keyCode===ia.ESCAPE,b=f.type==="keydown"&&(f.keyCode===ia.UP||f.keyCode===ia.DOWN||f.keyCode===ia.HOME||f.keyCode===ia.END);if(!b&&!l()&&!a()){o(p,null);return}let v=s(),y=[...n(p),p];if((g||b&&!v.some(x=>y.includes(x)))&&await e(),!g){let x=i(),w=p;b&&(!l()&&!a()&&(x=p),h&&(w=h));let T=n(x),B=n(w),{start:R,end:I}=Qye(x,w,T,B);await t(R,I,null)}let k=s();if((f.keyCode===ia.HOME||f.keyCode===ia.END)&&k.length>1)return;let S=v.filter(x=>!k.includes(x)),_;if(S.length===1){let x=u(r(S[0]))?.title;x&&(_=(0,Yk.sprintf)((0,Yk.__)("%s deselected."),x))}else S.length>1&&(_=(0,Yk.sprintf)((0,Yk.__)("%s blocks deselected."),S.length));_&&(0,cve.speak)(_,"assertive")},[e,r,u,n,i,s,a,l,t,o])}}var pve=c(F(),1);function mve(e){return(0,pve.useMemo)(()=>{let o={},r=0,n=i=>{i.forEach(s=>{o[s.clientId]=r,r++,s.innerBlocks.length>0&&n(s.innerBlocks)})};return n(e),o},[e])}var hve=c(Q(),1);function gve({blocks:e,rootClientId:t}){return(0,hve.useSelect)(o=>{let{getDraggedBlockClientIds:r,getSelectedBlockClientIds:n,getListViewClientIdsTree:i}=H(o(C));return{selectedClientIds:n(),draggedClientIds:r(),clientIdsTree:e??i(t)}},[e,t])}var bve=c(F(),1),yve=c(Q(),1);function vve({collapseAll:e,expand:t}){let{expandedBlock:o,getBlockParents:r}=(0,yve.useSelect)(n=>{let{getBlockParents:i,getExpandedBlock:s}=H(n(C));return{expandedBlock:s(),getBlockParents:i}},[]);(0,bve.useEffect)(()=>{if(o){let n=r(o,!1);e(),t(n)}},[e,t,o,r])}var Sve=c(Q(),1),jb=c(F(),1),Hb=c(fe(),1),kve=c(G(),1);var sf=24;function nWe(e,t,o=1,r=!1){let n=r?t.right-o*sf:t.left+o*sf;return r?e.x>n:e.xn.clientId===r.rootClientId);return o}function _ve(e,t){let o=e[t+1];return o&&o.isDraggedBlock?_ve(e,t+1):o}function aWe(e,t,o=1,r=!1){let n=r?t.right-o*sf:t.left+o*sf;return(r?e.xn+sf)&&e.y0&&n.isExpanded||aWe(t,s,l.length,o))){let f=n.isExpanded?0:n.innerBlockCount||0;return{rootClientId:n.clientId,clientId:n.clientId,blockIndex:f,dropPosition:"inside"}}if(u&&n.rootClientId&&nWe(t,s,l.length,o)){let f=_ve(e,a),p=n.nestingLevel,h=f?f.nestingLevel:1;if(p&&h){let m=iWe(t,s,l.length,o),g=Math.max(Math.min(m,p-h),0);if(l[g]){let b=n.blockIndex;if(l[g].nestingLevel===f?.nestingLevel)b=f?.blockIndex;else for(let v=a;v>=0;v--){let y=e[v];if(y.rootClientId===l[g].rootClientId){b=y.blockIndex+1;break}}return{rootClientId:l[g].rootClientId,clientId:n.clientId,blockIndex:b,dropPosition:r}}}}if(!n.canInsertDraggedBlocksAsSibling)return;let d=u?1:0;return{rootClientId:n.rootClientId,clientId:n.clientId,blockIndex:n.blockIndex+d,dropPosition:r}}var uWe={leading:!1,trailing:!0};function xve({dropZoneElement:e,expandedState:t,setExpandedState:o}){let{getBlockRootClientId:r,getBlockIndex:n,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,Sve.useSelect)(C),[l,u]=(0,jb.useState)(),{rootClientId:d,blockIndex:f}=l||{},p=F2(d,f),h=(0,kve.isRTL)(),m=(0,Hb.usePrevious)(d),g=(0,jb.useCallback)((S,_)=>{let{rootClientId:x}=_||{};x&&_?.dropPosition==="inside"&&!S[x]&&o({type:"expand",clientIds:[x]})},[o]),b=(0,Hb.useThrottle)(g,500,uWe);(0,jb.useEffect)(()=>{if(l?.dropPosition!=="inside"||m!==l?.rootClientId){b.cancel();return}b(t,l)},[t,m,l,b]);let v=s(),y=(0,Hb.useThrottle)((0,jb.useCallback)((S,_)=>{let x={x:S.clientX,y:S.clientY},w=!!v?.length,B=Array.from(_.querySelectorAll("[data-block]")).map(I=>{let A=I.dataset.block,P=I.dataset.expanded==="true",O=I.classList.contains("is-dragging"),N=parseInt(I.getAttribute("aria-level"),10),z=r(A);return{clientId:A,isExpanded:P,rootClientId:z,blockIndex:n(A),element:I,nestingLevel:N||void 0,isDraggedBlock:w?O:!1,innerBlockCount:i(A),canInsertDraggedBlocksAsSibling:w?a(v,z):!0,canInsertDraggedBlocksAsChild:w?a(v,A):!0}}),R=cWe(B,x,h);R&&u(R)},[a,v,i,n,r,h]),50);return{ref:(0,Hb.__experimentalUseDropZone)({dropZoneElement:e,onDrop(S){y.cancel(),l&&p(S),u(void 0)},onDragLeave(){y.cancel(),u(null)},onDragOver(S){y(S,S.currentTarget)},onDragEnd(){y.cancel(),u(void 0)}}),target:l}}var RM=c(F(),1),wve=c(Q(),1);function Cve({firstSelectedBlockClientId:e,setExpandedState:t}){let[o,r]=(0,RM.useState)(null),{selectedBlockParentClientIds:n}=(0,wve.useSelect)(i=>{let{getBlockParents:s}=i(C);return{selectedBlockParentClientIds:s(e,!1)}},[e]);return(0,RM.useEffect)(()=>{o!==e&&n?.length&&t({type:"expand",clientIds:n})},[e,n,o,t]),{setSelectedTreeId:r}}var qk=c(Q(),1),Eve=c(fe(),1);function Tve({selectBlock:e}){let t=(0,qk.useRegistry)(),{getBlockOrder:o,getBlockRootClientId:r,getBlocksByClientId:n,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:l,canRemoveBlocks:u}=(0,qk.useSelect)(C),{flashBlock:d,removeBlocks:f,replaceBlocks:p,insertBlocks:h}=(0,qk.useDispatch)(C),m=PS();return(0,Eve.useRefEffect)(g=>{function b(k,S){S&&e(void 0,k,null,null),Gk(k,g)}function v(k){let S=s(),_=S.includes(k),x=_?S[0]:k,w=r(x);return{blocksToUpdate:_?S:[k],firstBlockClientId:x,firstBlockRootClientId:w,originallySelectedBlockClientIds:S}}function y(k){if(k.defaultPrevented||!g.contains(k.target.ownerDocument.activeElement))return;let _=k.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!_)return;let{blocksToUpdate:x,firstBlockClientId:w,firstBlockRootClientId:T,originallySelectedBlockClientIds:B}=v(_);if(x.length!==0){if(k.preventDefault(),k.type==="copy"||k.type==="cut"){x.length===1&&d(x[0]),m(k.type,x);let R=n(x);yA(k,R,t)}if(k.type==="cut"){if(!u(x))return;let R=i(w)??T;f(x,!1);let I=B.length>0&&s().length===0;R||(R=o()[0]),b(R,I)}else if(k.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:R}=a(),I=vce(k,R);if(x.length===1){let[A]=x;if(I.every(P=>l(P.name,A))){h(I,void 0,A),b(I[0]?.clientId,!1);return}}p(x,I,I.length-1,-1),b(I[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",y),g.ownerDocument.addEventListener("cut",y),g.ownerDocument.addEventListener("paste",y),()=>{g.ownerDocument.removeEventListener("copy",y),g.ownerDocument.removeEventListener("cut",y),g.ownerDocument.removeEventListener("paste",y)}},[])}var af=c(E(),1),dWe=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((o,r)=>({...o,[r]:t.type==="expand"}),{})}:e,Rve=32;function Ive({id:e,blocks:t,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:n=!1,showAppender:i=!1,blockSettingsMenu:s=W9,rootClientId:a,description:l,onSelect:u,additionalBlockContent:d},f){t&&(0,Pve.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});let p=(0,Zk.useInstanceId)(Ive),{clientIdsTree:h,draggedClientIds:m,selectedClientIds:g}=gve({blocks:t,rootClientId:a}),b=mve(h),{getBlock:v,getSelectedBlockClientIds:y}=(0,SE.useSelect)(C),{visibleBlockCount:k}=(0,SE.useSelect)(oe=>{let{getGlobalBlockCount:ne,getClientIdsOfDescendants:X}=oe(C),re=m?.length>0?X(m).length+1:0;return{visibleBlockCount:ne()-re}},[m]),{updateBlockSelection:S}=fve(),[_,x]=(0,Wr.useReducer)(dWe,{}),[w,T]=(0,Wr.useState)(null),{setSelectedTreeId:B}=Cve({firstSelectedBlockClientId:g[0],setExpandedState:x}),R=(0,Wr.useCallback)((oe,ne,X)=>{S(oe,ne,null,X),B(ne),u&&u(v(ne))},[B,S,u,v]),{ref:I,target:A}=xve({dropZoneElement:o,expandedState:_,setExpandedState:x}),P=(0,Wr.useRef)(),O=Tve({selectBlock:R}),N=(0,Wr.useCallback)(oe=>{let[ne]=y();ne&&oe&&Gk(ne,oe)},[y]),z=(0,Zk.useMergeRefs)([O,N,P,I,f]),V=(0,Wr.useCallback)(oe=>{if(!oe)return;let ne=Array.isArray(oe)?oe:[oe];x({type:"expand",clientIds:ne})},[x]),M=(0,Wr.useCallback)(oe=>{oe&&x({type:"collapse",clientIds:[oe]})},[x]),D=(0,Wr.useCallback)(()=>{x({type:"clear"})},[x]),L=(0,Wr.useCallback)(oe=>{V(oe?.dataset?.block)},[V]),j=(0,Wr.useCallback)(oe=>{M(oe?.dataset?.block)},[M]),q=(0,Wr.useCallback)((oe,ne,X)=>{oe.shiftKey&&S(oe,ne?.dataset?.block,X?.dataset?.block)},[S]);vve({collapseAll:D,expand:V});let J=m?.[0],{blockDropTargetIndex:te,blockDropPosition:ee,firstDraggedBlockIndex:$}=(0,Wr.useMemo)(()=>{let oe,ne;if(A?.clientId){let X=b[A.clientId];oe=X===void 0||A?.dropPosition==="top"?X:X+1}else A===null&&(oe=null);if(J){let X=b[J];ne=X===void 0||A?.dropPosition==="top"?X:X+1}return{blockDropTargetIndex:oe,blockDropPosition:A?.dropPosition,firstDraggedBlockIndex:ne}},[A,b,J]),W=(0,Wr.useMemo)(()=>({blockDropPosition:ee,blockDropTargetIndex:te,blockIndexes:b,draggedClientIds:m,expandedState:_,expand:V,firstDraggedBlockIndex:$,collapse:M,collapseAll:D,BlockSettingsMenu:s,listViewInstanceId:p,AdditionalBlockContent:d,insertedBlock:w,setInsertedBlock:T,treeGridElementRef:P,rootClientId:a}),[ee,te,b,m,_,V,$,M,D,s,p,d,w,T,a]),[Y]=(0,Zk.__experimentalUseFixedWindowList)(P,Rve,k,{expandedState:_,useWindowing:!0,windowOverscan:40});if(!h.length&&!i)return null;let Z=l&&`block-editor-list-view-description-${p}`;return(0,af.jsxs)(SE.AsyncModeProvider,{value:!0,children:[(0,af.jsx)(lve,{draggedBlockClientId:J,listViewRef:P,blockDropTarget:A}),l&&(0,af.jsx)(bt,{id:Z,children:l}),(0,af.jsx)(Bve.__experimentalTreeGrid,{id:e,className:K("block-editor-list-view-tree",{"is-dragging":m?.length>0&&te!==void 0}),"aria-label":(0,hG.__)("Block navigation structure"),ref:z,onCollapseRow:j,onExpandRow:L,onFocusRow:q,applicationAriaLabel:(0,hG.__)("Block navigation structure"),"aria-describedby":Z,style:{"--wp-admin--list-view-dragged-items-height":m?.length?`${Rve*(m.length-1)}px`:null},children:(0,af.jsx)(gM.Provider,{value:W,children:(0,af.jsx)(ave,{blocks:h,parentId:a,selectBlock:R,showBlockMovers:r,fixedListWindow:Y,selectedClientIds:g,isExpanded:n,showAppender:i})})})]})}var kE=(0,Wr.forwardRef)(Ive),BM=(0,Wr.forwardRef)((e,t)=>(0,af.jsx)(kE,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));var zm=c(E(),1);function fWe({isEnabled:e,onToggle:t,isOpen:o,innerRef:r,...n}){return(0,zm.jsx)(PM.Button,{__next40pxDefaultSize:!0,...n,ref:r,icon:Qx,"aria-expanded":o,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,gG.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}function pWe({isDisabled:e,...t},o){(0,Ove.default)("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});let n=(0,Ave.useSelect)(i=>!!i(C).getBlockCount(),[])&&!e;return(0,zm.jsx)(PM.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:i,onToggle:s})=>(0,zm.jsx)(fWe,{...t,innerRef:o,isOpen:i,onToggle:s,isEnabled:n}),renderContent:()=>(0,zm.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,zm.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,gG.__)("List view")}),(0,zm.jsx)(BM,{})]})})}var Mve=(0,Lve.forwardRef)(pWe);var _E=c(F(),1),Dve=c(Q(),1),Vve=c(fe(),1),jm=c(U(),1),bG=c(G(),1);var lf=c(E(),1),Nve=()=>{};function mWe({clientId:e,onSwitch:t=Nve,onHoverClassName:o=Nve}){let r=(0,Dve.useSelect)(_=>_(C).canEditBlock(e),[e]),{onSelect:n,stylesToRender:i,activeStyle:s,genericPreviewBlock:a,className:l}=Ik({clientId:e,onSwitch:t}),[u,d]=(0,_E.useState)(null),[f,p]=(0,_E.useState)(null),h=xr(),m=(0,_E.useMemo)(()=>{if(!u||!a)return null;let _=Am(l,s,u);return[{...a,attributes:{...a.attributes||{},className:_}}]},[u,a,l,s]);if(!r||!i||i.length===0)return null;let g=(0,Vve.debounce)(d,250),b=_=>{n(_),o(null),d(null),g.cancel()},v=_=>{if(u===_){g.cancel();return}g(_),o(_?.name??null)},y=$L(i),k=()=>s?.name!==y?.name,S=()=>{b(y)};return(0,lf.jsx)(jm.__experimentalToolsPanel,{label:(0,bG.__)("Styles"),resetAll:S,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:h,children:(0,lf.jsx)(jm.__experimentalToolsPanelItem,{hasValue:k,label:(0,bG.__)("Variation"),onDeselect:S,isShownByDefault:!0,panelId:e,children:(0,lf.jsxs)("div",{ref:p,className:"block-editor-block-styles",children:[(0,lf.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map(_=>{let x=_.label||_.name;return(0,lf.jsx)(jm.Button,{__next40pxDefaultSize:!0,className:K("block-editor-block-styles__item",{"is-active":s.name===_.name}),variant:"secondary",label:x,onMouseEnter:()=>v(_),onFocus:()=>v(_),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>b(_),"aria-current":s.name===_.name,children:(0,lf.jsx)(jm.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:x})},_.name)})}),m&&(0,lf.jsx)(Nm,{blocks:m,placement:"left-start",offset:34,anchor:f})]})})})}var Xk=mWe;var Uve=c(U(),1),Qk=c(G(),1);var zve=c(U(),1),jve=c(E(),1),Fve={0:O4,1:$3,2:Y3,3:Z3,4:Q3,5:e4,6:o4};function yG({level:e}){return Fve[e]?(0,jve.jsx)(zve.Icon,{icon:Fve[e]}):null}var IM=c(E(),1),Hve=[1,2,3,4,5,6],hWe={className:"block-library-heading-level-dropdown"};function Gve({options:e=Hve,value:t,onChange:o}){let r=e.filter(n=>n===0||Hve.includes(n)).sort((n,i)=>n-i);return(0,IM.jsx)(Uve.ToolbarDropdownMenu,{popoverProps:hWe,icon:(0,IM.jsx)(yG,{level:t}),label:(0,Qk.__)("Change level"),controls:r.map(n=>{let i=n===t;return{icon:(0,IM.jsx)(yG,{level:n}),title:n===0?(0,Qk.__)("Paragraph"):(0,Qk.sprintf)((0,Qk.__)("Heading %d"),n),isActive:i,onClick(){o(n)},role:"menuitemradio"}})})}var xE=c(G(),1),wE=c(U(),1);var cf=c(E(),1);function gWe({icon:e=S4,label:t=(0,xE.__)("Choose variation"),instructions:o=(0,xE.__)("Select a variation to start with:"),variations:r,onSelect:n,allowSkip:i}){let s=K("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,cf.jsxs)(wE.Placeholder,{icon:e,label:t,instructions:o,className:s,children:[(0,cf.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,xE.__)("Block variations"),children:r.map(a=>(0,cf.jsxs)("li",{children:[(0,cf.jsx)(wE.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:a.icon&&a.icon.src?a.icon.src:a.icon,iconSize:48,onClick:()=>n(a),className:"block-editor-block-variation-picker__variation",label:a.description||a.title}),(0,cf.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:a.title})]},a.name))}),i&&(0,cf.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,cf.jsx)(wE.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(),children:(0,xE.__)("Skip")})})]})}var Wve=gWe;var qve=c(Q(),1),Zve=c(ue(),1),SG=c(U(),1);var vG=c(F(),1),kG=c(fe(),1),Xve=c(G(),1);var uf=c(G(),1),Jk=c(U(),1);var Hm={carousel:"carousel",grid:"grid"};var sa=c(E(),1),bWe=({onBlockPatternSelect:e})=>(0,sa.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,sa.jsx)(Jk.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,uf.__)("Choose")})}),yWe=({handlePrevious:e,handleNext:t,activeSlide:o,totalSlides:r})=>(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,sa.jsx)(Jk.Button,{size:"compact",icon:(0,uf.isRTL)()?un:Ti,label:(0,uf.__)("Previous pattern"),onClick:e,disabled:o===0,accessibleWhenDisabled:!0}),(0,sa.jsx)(Jk.Button,{size:"compact",icon:(0,uf.isRTL)()?Ti:un,label:(0,uf.__)("Next pattern"),onClick:t,disabled:o===r-1,accessibleWhenDisabled:!0})]}),vWe=({viewMode:e,setViewMode:t,handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i,onBlockPatternSelect:s})=>{let a=e===Hm.carousel,l=(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,sa.jsx)(Jk.Button,{size:"compact",icon:mw,label:(0,uf.__)("Carousel view"),onClick:()=>t(Hm.carousel),isPressed:a}),(0,sa.jsx)(Jk.Button,{size:"compact",icon:Gx,label:(0,uf.__)("Grid view"),onClick:()=>t(Hm.grid),isPressed:e===Hm.grid})]});return(0,sa.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[a&&(0,sa.jsx)(yWe,{handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i}),l,a&&(0,sa.jsx)(bWe,{onBlockPatternSelect:s})]})},$ve=vWe;var Kve=c(Q(),1);function SWe(e,t,o){return(0,Kve.useSelect)(r=>{let{getBlockRootClientId:n,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=r(C),a=n(e);return o?s(a).filter(o):i(t,a)},[e,t,o])}var Yve=SWe;var Xo=c(E(),1),kWe=({viewMode:e,activeSlide:t,patterns:o,onBlockPatternSelect:r,showTitles:n})=>{let i="block-editor-block-pattern-setup__container";if(e===Hm.carousel){let s=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,Xo.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,Xo.jsx)("div",{className:i,children:(0,Xo.jsx)("div",{className:"carousel-container",children:o.map((a,l)=>(0,Xo.jsx)(Jve,{active:l===t,className:s.get(l)||"",pattern:a},a.name))})})})}return(0,Xo.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,Xo.jsx)(SG.Composite,{role:"listbox",className:i,"aria-label":(0,Xve.__)("Patterns list"),children:o.map(s=>(0,Xo.jsx)(Qve,{pattern:s,onSelect:r,showTitles:n},s.name))})})};function Qve({pattern:e,onSelect:t,showTitles:o}){let r="block-editor-block-pattern-setup-list",{blocks:n,description:i,viewportWidth:s=700}=e,a=(0,kG.useInstanceId)(Qve,`${r}__item-description`);return(0,Xo.jsx)("div",{className:`${r}__list-item`,children:(0,Xo.jsxs)(SG.Composite.Item,{render:(0,Xo.jsx)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${r}__item`}),id:`${r}__pattern__${e.name}`,role:"option",onClick:()=>t(n),children:[(0,Xo.jsx)(bs,{blocks:n,viewportWidth:s}),o&&(0,Xo.jsx)("div",{className:`${r}__item-title`,children:e.title}),!!i&&(0,Xo.jsx)(bt,{id:a,children:i})]})})}function Jve({active:e,className:t,pattern:o,minHeight:r}){let{blocks:n,title:i,description:s}=o,a=(0,kG.useInstanceId)(Jve,"block-editor-block-pattern-setup-list__item-description");return(0,Xo.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?a:void 0,children:[(0,Xo.jsx)(bs,{blocks:n,minHeight:r}),!!s&&(0,Xo.jsx)(bt,{id:a,children:s})]})}var _We=({clientId:e,blockName:t,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:n=Hm.carousel,showTitles:i=!1})=>{let[s,a]=(0,vG.useState)(n),[l,u]=(0,vG.useState)(0),{replaceBlock:d}=(0,qve.useDispatch)(C),f=Yve(e,t,o);if(!f?.length)return null;let h=r||(m=>{let g=m.map(b=>(0,Zve.cloneBlock)(b));d(e,g)});return(0,Xo.jsx)(Xo.Fragment,{children:(0,Xo.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,Xo.jsx)(kWe,{viewMode:s,activeSlide:l,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,Xo.jsx)($ve,{viewMode:s,setViewMode:a,activeSlide:l,totalSlides:f.length,handleNext:()=>{u(m=>Math.min(m+1,f.length-1))},handlePrevious:()=>{u(m=>Math.max(m-1,0))},onBlockPatternSelect:()=>{h(f[l].blocks)}})]})})},eSe=_We;var _G=c(ue(),1),df=c(G(),1),ff=c(U(),1);var OM=c(Q(),1),tSe=c(F(),1);var $r=c(E(),1),{Menu:Ub}=H(ff.privateApis);function xWe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsxs)("fieldset",{className:e,children:[(0,$r.jsx)(bt,{render:(0,$r.jsx)("legend",{}),children:(0,df.__)("Transform to variation")}),r.map(n=>(0,$r.jsx)(ff.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,$r.jsx)(Et,{icon:n.icon,showColors:!0}),isPressed:o===n.name,label:o===n.name?n.title:(0,df.sprintf)((0,df.__)("Transform to %s"),n.title),onClick:()=>t(n.name),"aria-label":n.title,showTooltip:!0},n.name))]})}function wWe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsx)("div",{className:e,children:(0,$r.jsxs)(Ub,{children:[(0,$r.jsx)(Ub.TriggerButton,{render:(0,$r.jsx)(ff.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,df.__)("Transform to variation")})}),(0,$r.jsx)(Ub.Popover,{position:"bottom",children:(0,$r.jsx)(Ub.Group,{children:r.map(n=>(0,$r.jsxs)(Ub.RadioItem,{value:n.name,checked:o===n.name,onChange:()=>t(n.name),children:[(0,$r.jsx)(Ub.ItemLabel,{children:n.title}),n.description&&(0,$r.jsx)(Ub.ItemHelpText,{children:n.description})]},n.name))})})]})})}function CWe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,$r.jsx)("div",{className:e,children:(0,$r.jsx)(ff.__experimentalToggleGroupControl,{label:(0,df.__)("Transform to variation"),value:o,hideLabelFromVision:!0,onChange:t,children:r.map(n=>(0,$r.jsx)(ff.__experimentalToggleGroupControlOptionIcon,{icon:(0,$r.jsx)(Et,{icon:n.icon,showColors:!0}),value:n.name,label:o===n.name?n.title:(0,df.sprintf)((0,df.__)("Transform to %s"),n.title)},n.name))})})}function EWe({blockClientId:e}){let{updateBlockAttributes:t}=(0,OM.useDispatch)(C),{activeBlockVariation:o,variations:r,canEdit:n,isContentOnly:i,isSection:s}=(0,OM.useSelect)(m=>{let{getActiveBlockVariation:g,getBlockVariations:b}=m(_G.store),{getBlockName:v,getBlockAttributes:y,getBlockEditingMode:k,isSectionBlock:S}=H(m(C)),{canEditBlock:_}=m(C),x=e&&v(e),{hasContentRoleAttribute:w}=H(m(_G.store)),T=w(x);return{activeBlockVariation:g(x,y(e),"transform"),variations:x&&b(x,"transform"),canEdit:_(e),isContentOnly:k(e)==="contentOnly"&&!T,isSection:S(e)}},[e]),a=o?.name,l=(0,tSe.useMemo)(()=>{let m=new Set;return r?(r.forEach(g=>{g.icon&&m.add(g.icon?.src||g.icon)}),m.size===r.length):!1},[r]),u=m=>{t(e,{...r.find(({name:g})=>g===m).attributes})};if(!r?.length||!n||i||s)return null;let d="block-editor-block-variation-transforms",p=r.length>6?xWe:CWe;return(0,$r.jsx)(l?p:wWe,{className:d,onSelectVariation:u,selectedValue:a,variations:r})}var AM=EWe;var Gb=c(G(),1),LM=c(U(),1);var oSe=c(E(),1),xG={top:{icon:Xx,title:(0,Gb._x)("Align top","Block vertical alignment setting")},center:{icon:Yx,title:(0,Gb._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Kx,title:(0,Gb._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Zx,title:(0,Gb._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:qx,title:(0,Gb._x)("Space between","Block vertical alignment setting")}},TWe=["top","center","bottom"],RWe="top";function BWe({value:e,onChange:t,controls:o=TWe,isCollapsed:r=!0,isToolbar:n}){function i(d){return()=>t(e===d?void 0:d)}let s=xG[e],a=xG[RWe],l=n?LM.ToolbarGroup:LM.ToolbarDropdownMenu,u=n?{isCollapsed:r}:{};return(0,oSe.jsx)(l,{icon:s?s.icon:a.icon,label:(0,Gb._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(d=>({...xG[d],isActive:e===d,role:r?"menuitemradio":void 0,onClick:i(d)})),...u})}var wG=BWe;var CG=c(E(),1),lP=e=>(0,CG.jsx)(wG,{...e,isToolbar:!1}),rSe=e=>(0,CG.jsx)(wG,{...e,isToolbar:!0});var ws=c(U(),1),CE=c(F(),1),VM=c(G(),1);var nSe=c(U(),1);var EG=c(G(),1),iSe=c(E(),1);function sSe({isLinked:e,...t}){let o=e?(0,EG.__)("Unlink radii"):(0,EG.__)("Link radii");return(0,iSe.jsx)(nSe.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?ss:is,iconSize:24,label:o})}var aSe=c(U(),1);function PWe(e){return[...e].sort((o,r)=>e.filter(n=>n===r).length-e.filter(n=>n===o).length).shift()}function lSe(e={}){if(typeof e=="string")return e;let t=Object.values(e).map(a=>{let l=(0,aSe.__experimentalParseQuantityAndUnitFromRawValue)(a);return typeof a=="string"&&l[0]===void 0?[a,""]:l}),o=t.map(a=>a[0]??""),r=t.map(a=>a[1]),n=o.every(a=>a===o[0])?o[0]:"",i=PWe(r);return n===0||n?`${n}${i||""}`:void 0}function cSe(e={}){if(typeof e=="string"||!e||typeof e!="object")return!1;let t=Object.values(e);if(t.length===0)return!1;let o=t[0];return!t.every(n=>n===o)}function uSe(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(o=>!!o||o===0).length:!1}var cl=c(U(),1),gSe=c(fe(),1),Gm=c(G(),1);var Wb=c(F(),1);var TG=24,dSe=8,MM={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};var Um=(e,t)=>e?.includes?e==="0"||e.includes(`var:preset|${t}|`):!1;function fSe(e,t){if(!e)return;if(e==="0"||e==="default")return e;let o=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return o?o[1]:void 0}function pSe(e,t,o){if(e===void 0)return 0;let r=parseFloat(e,10)===0?"0":fSe(e,o),n=t.findIndex(i=>String(i.slug)===r);return n!==-1?n:NaN}function RG(e,t,o){if(!Um(e,o))return e;let r=parseFloat(e,10)===0?"0":fSe(e,o);return t.find(i=>String(i.slug)===r)?.size}function mSe(e,t,o){if(!e||Um(e,o)||e==="0")return e;let r=t.find(n=>String(n.size)===String(e));return r?.slug?`var:preset|${o}|${r.slug}`:e}var NM=c(U(),1);var bc=c(E(),1);function hSe({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:o,minValue:r,parsedQuantity:n,computedUnit:i,units:s,isMixed:a,step:l,max:u,showTooltip:d,value:f,minimumCustomValue:p,onCustomValueChange:h,onCustomValueSliderChange:m,onUnitChange:g,onMouseOut:b,onMouseOver:v,setMinValue:y}){let k=(0,bc.jsx)(NM.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:r,onChange:h,onUnitChange:g,onBlur:b,onFocus:v,onMouseOut:b,onMouseOver:v,units:s,value:[n,i].join(""),placeholder:o,onDragStart:()=>{e&&f?.charAt(0)==="-"&&y(0)},onDrag:()=>{e&&f?.charAt(0)==="-"&&y(0)},onDragEnd:()=>{e&&y(p)}}),S=d?(0,bc.jsxs)(kt.Root,{children:[(0,bc.jsx)(kt.Trigger,{render:(0,bc.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:k})}),(0,bc.jsx)(kt.Popup,{children:t})]}):k;return(0,bc.jsxs)(bc.Fragment,{children:[S,(0,bc.jsx)(NM.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:u,min:0,onBlur:b,onChange:m,onFocus:v,onMouseOut:b,onMouseOver:v,step:l,value:n,withInputField:!1})]})}var Wm=c(E(),1);function $b({allowNegativeOnDrag:e=!1,ariaLabel:t,className:o,customValueSettings:r=MM,disableCustomValues:n,icon:i,isMixed:s,value:a,minimumCustomValue:l,onChange:u,onMouseOut:d,onMouseOver:f,onUnitChange:p,placeholder:h,presets:m=[],presetType:g,selectedUnit:b,showTooltip:v,units:y}){let k=(0,Wb.useMemo)(()=>mSe(a,m,g),[a,m,g]),S=o??"preset-input-control",_=m.slice(1,m.length-1).map((Z,oe)=>({value:oe+1,label:void 0})),x=_.length>0,w=m.length<=dSe,T=s?(0,Gm.__)("Mixed"):h??null,[B,R]=(0,Wb.useState)(l),[I,A]=(0,Wb.useState)(!n&&k!==void 0&&!Um(k,g)),P=null,O=(0,gSe.usePrevious)(k);(0,Wb.useEffect)(()=>{k&&O!==k&&!Um(k,g)&&I!==!0&&A(!0)},[k,O,g,I]);let N=!w&&!I&&k!==void 0&&(!Um(k,g)||Um(k,g)&&s),z=m;N?(z=[...m,{name:s?(0,Gm.__)("Mixed"):(0,Gm.sprintf)((0,Gm.__)("Custom (%s)"),k),slug:"custom",size:k}],P=z.length-1):s||(P=I?RG(k,m,g):pSe(k,m,g));let V=z.map((Z,oe)=>({key:oe,name:Z.name})),M=Um(k,g)?RG(k,m,g):k,[D,L]=(0,cl.__experimentalParseQuantityAndUnitFromRawValue)(M),j=L||b||"px",q=y?.find(Z=>Z.value===j),J=q?.step??r[j]?.steps??.1,te=q?.max??r[j]?.max??10,ee=Z=>{if(Z===void 0||Z===""){u(void 0);return}isNaN(parseFloat(Z))||u(Z)},$=Z=>{u([Z,j].join(""))},W=Z=>k===void 0?void 0:m[Z]?.name,Y=(Z,oe)=>{let ne=parseInt(Z,10);if(oe==="selectList"){if(ne===0&&m[0]?.slug==="0")return"0";if(ne===0)return}else if(ne===0)return"0";return`var:preset|${g}|${m[Z]?.slug}`};return(0,Wm.jsxs)(cl.__experimentalHStack,{className:`preset-input-control__wrapper ${S}__wrapper`,children:[i&&(0,Wm.jsx)(cl.Icon,{className:"preset-input-control__icon",icon:i,size:TG}),(!x||I)&&(0,Wm.jsx)(hSe,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:T,minValue:B,parsedQuantity:D,computedUnit:j,units:y,isMixed:s,step:J,max:te,showTooltip:v,value:k,minimumCustomValue:l,onCustomValueChange:ee,onCustomValueSliderChange:$,onUnitChange:p,onMouseOut:d,onMouseOver:f,setMinValue:R}),x&&w&&!I&&(0,Wm.jsx)(cl.RangeControl,{"aria-valuenow":P,"aria-valuetext":m[P]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:m.length-1,marks:_,min:0,onBlur:d,onChange:Z=>u(Y(Z)),onFocus:f,onMouseDown:Z=>{Z?.nativeEvent?.offsetX<35&&k===void 0&&u("0")},onMouseOut:d,onMouseOver:f,renderTooltipContent:W,step:1,value:P,withInputField:!1}),x&&!w&&!I&&(0,Wm.jsx)(cl.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:d,onChange:Z=>{N&&Z.selectedItem.key===V.length-1?A(!0):u(Y(Z.selectedItem.key,"selectList"))},onFocus:f,onMouseOut:d,onMouseOver:f,options:V,value:V.find(Z=>Z.key===P)||""}),x&&!n&&(0,Wm.jsx)(cl.Button,{className:"preset-input-control__custom-toggle",icon:t6,iconSize:TG,isPressed:I,label:I?(0,Gm.__)("Use preset"):(0,Gm.__)("Set custom value"),onClick:()=>{A(!I)},size:"small"})]})}var e_=c(G(),1);var bSe=8,DM=[],BG={all:(0,e_.__)("Border radius"),topLeft:(0,e_.__)("Top left"),topRight:(0,e_.__)("Top right"),bottomLeft:(0,e_.__)("Bottom left"),bottomRight:(0,e_.__)("Bottom right")},PG={all:f3,topLeft:h3,topRight:g3,bottomLeft:p3,bottomRight:m3},IG=0;var pf=c(E(),1);function IWe(e){let t=e?.default??DM,o=e?.custom??DM,r=e?.theme??DM;return(0,CE.useMemo)(()=>{let n=[{name:(0,VM.__)("None"),slug:"0",size:0},...o,...r,...t];return n.length>bSe?[{name:(0,VM.__)("Default"),slug:"default",size:void 0},...n]:n},[o,r,t])}function ySe(e,t){return t==="all"?lSe(e):typeof e=="string"?e:e?.[t]}function vSe(e,t){return t==="all"?e.flat:e[t]}function SSe(e,t,o){return r=>{o(e==="all"?{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r}:{...typeof t!="string"?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:r})}}function kSe(e,t,o){return r=>{let n={...t};e==="all"?(n.flat=r,n.topLeft=r,n.topRight=r,n.bottomLeft=r,n.bottomRight=r):n[e]=r,o(n)}}function FM({onChange:e,values:t,presets:o}){let[r,n]=(0,CE.useState)(!uSe(t)||!cSe(t)),i=IWe(o),[s,a]=(0,CE.useState)({flat:typeof t=="string"?(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,ws.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[l]=Le("spacing.units"),u=(0,ws.__experimentalUseCustomUnits)({availableUnits:l||["px","em","rem"]}),d=()=>n(!r);return(0,pf.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,pf.jsxs)(ws.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,pf.jsx)(ws.BaseControl.VisualLabel,{as:"legend",children:(0,VM.__)("Radius")}),(0,pf.jsx)(sSe,{onClick:d,isLinked:r})]}),r?(0,pf.jsx)($b,{ariaLabel:BG.all,className:"components-border-radius-control",icon:PG.all,minimumCustomValue:IG,onChange:SSe("all",t,e),onUnitChange:kSe("all",s,a),presets:i,presetType:"border-radius",selectedUnit:vSe(s,"all"),showTooltip:!0,units:u,value:ySe(t,"all")}):(0,pf.jsx)(ws.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(f=>(0,pf.jsx)($b,{ariaLabel:BG[f],className:"components-border-radius-control",icon:PG[f],minimumCustomValue:IG,onChange:SSe(f,t,e),onUnitChange:kSe(f,s,a),presets:i,presetType:"border-radius",selectedUnit:vSe(s,f),showTooltip:!0,units:u,value:ySe(t,f)},f))})]})}var wSe=c(U(),1);var _Se=c(fe(),1);var xSe=c(E(),1),zM=(0,_Se.createHigherOrderComponent)(e=>function(o){let[r,n,i,s,a]=Le("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),l=a?[...n||[],...r||[],...i||[]]:[...n||[],...i||[]],{colors:u=l,disableCustomColors:d=!s}=o,f=u&&u.length>0||!d;return(0,xSe.jsx)(e,{...o,colors:u,disableCustomColors:d,hasColorsToChoose:f})},"withColorContext");var CSe=zM(wSe.ColorPalette);var OG=c(G(),1),aa=c(U(),1);var Fo=c(E(),1),{Tabs:t_}=H(aa.privateApis),OWe=["colors","disableCustomColors","gradients","disableCustomGradients"],Eu={color:"color",gradient:"gradient"};function ESe({colors:e,gradients:t,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,className:i,label:s,onColorChange:a,onGradientChange:l,colorValue:u,colorSlug:d,gradientValue:f,gradientSlug:p,clearable:h,showTitle:m=!0,enableAlpha:g,headingLevel:b,noticeProps:v}){let y=a&&(e&&e.length>0||!o),k=l&&(t&&t.length>0||!r);if(!y&&!k)return null;let _=(0,Fo.jsx)(aa.ColorPalette,{value:u,selectedSlug:d,onChange:k?(T,B,R)=>{a(T,R),l()}:(T,B,R)=>a(T,R),colors:e,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:h,enableAlpha:g,headingLevel:b}),x={[Eu.color]:(0,Fo.jsxs)(Fo.Fragment,{children:[_,v&&(0,Fo.jsx)(aa.Notice,{isDismissible:!1,...v})]}),[Eu.gradient]:(0,Fo.jsx)(aa.GradientPicker,{value:f,selectedSlug:p,onChange:y?(T,B,R)=>{l(T,R),a()}:(T,B,R)=>l(T,R),gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,clearable:h,headingLevel:b})},w=T=>(0,Fo.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:x[T]});return(0,Fo.jsx)(aa.BaseControl,{className:K("block-editor-color-gradient-control",i),children:(0,Fo.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Fo.jsxs)(aa.__experimentalVStack,{spacing:1,children:[m&&(0,Fo.jsx)("legend",{children:(0,Fo.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Fo.jsx)(aa.BaseControl.VisualLabel,{children:s})})}),y&&k&&(0,Fo.jsx)("div",{children:(0,Fo.jsxs)(t_,{defaultTabId:f?Eu.gradient:!!y&&Eu.color,children:[(0,Fo.jsxs)(t_.TabList,{children:[(0,Fo.jsx)(t_.Tab,{tabId:Eu.color,children:(0,OG.__)("Color")}),(0,Fo.jsx)(t_.Tab,{tabId:Eu.gradient,children:(0,OG.__)("Gradient")})]}),(0,Fo.jsx)(t_.TabPanel,{tabId:Eu.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:x.color}),(0,Fo.jsx)(t_.TabPanel,{tabId:Eu.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:x.gradient})]})}),!k&&w(Eu.color),!y&&w(Eu.gradient)]})})})}function AWe(e){let[t,o,r,n]=Le("color.palette","color.gradients","color.custom","color.customGradient");return(0,Fo.jsx)(ESe,{colors:t,gradients:o,disableCustomColors:!r,disableCustomGradients:!n,...e})}function LWe(e){return OWe.every(t=>e.hasOwnProperty(t))?(0,Fo.jsx)(ESe,{...e}):(0,Fo.jsx)(AWe,{...e})}var $m=LWe;var TSe=c(E(),1);function RSe({onChange:e,value:t,...o}){return(0,TSe.jsx)($m,{...o,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var yc=c(G(),1),BSe=c(U(),1),PSe=c(Qr(),1),AG=c(E(),1);Yf([qf,jy]);function LG({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:o,fallbackLinkColor:r,fontSize:n,isLargeText:i,textColor:s,linkColor:a,messageOverride:l,enableAlphaChecker:u=!1}){let d=e||t;if(!d)return null;let f=s||o,p=a||r;if(!f&&!p)return null;let h=[{color:f,description:(0,yc.__)("text color")},{color:p,description:(0,yc.__)("link color")}],m=Lo(d),g=m.alpha()<1,b=m.brightness(),v={level:"AA",size:i||i!==!1&&n>=24?"large":"small"},y="",k="";for(let S of h){if(!S.color)continue;let _=Lo(S.color),x=_.isReadable(m,v),w=_.alpha()<1;if(!x){if(g||w)continue;if(l){y=l,k=l;break}y=b<_.brightness()?(0,yc.sprintf)((0,yc.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),S.description):(0,yc.sprintf)((0,yc.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),S.description),k=(0,yc.__)("This color combination may be hard for people to read.");break}w&&u&&(y=(0,yc.__)("Transparent text may be hard for people to read."),k=(0,yc.__)("Transparent text may be hard for people to read."))}return y?{message:y,speakMessage:k}:null}function MWe(e){let t=LG(e);return t?((0,PSe.speak)(t.speakMessage),(0,AG.jsx)("div",{className:"block-editor-contrast-checker",children:(0,AG.jsx)(BSe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:t.message})})):null}var ISe=MWe;var Zn=c(G(),1),EE=c(Tu(),1),jM=c(F(),1),Sc=c(U(),1);var vc=c(E(),1),Km=new Date;Km.setDate(20);Km.setMonth(Km.getMonth()-3);Km.getMonth()===4&&Km.setMonth(3);function ASe({format:e,defaultFormat:t,onChange:o}){return(0,vc.jsxs)(Sc.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,vc.jsx)(bt,{render:(0,vc.jsx)("legend",{}),children:(0,Zn.__)("Date format")}),(0,vc.jsx)(Sc.ToggleControl,{label:(0,Zn.__)("Default format"),help:`${(0,Zn.__)("Example:")} ${(0,EE.dateI18n)(t,Km)}`,checked:!e,onChange:r=>o(r?null:t)}),e&&(0,vc.jsx)(NWe,{format:e,onChange:o})]})}function NWe({format:e,onChange:t}){let r=[...[...new Set(["Y-m-d",(0,Zn._x)("n/j/Y","short date format"),(0,Zn._x)("n/j/Y g:i A","short date format with time"),(0,Zn._x)("M j, Y","medium date format"),(0,Zn._x)("M j, Y g:i A","medium date format with time"),(0,Zn._x)("F j, Y","long date format"),(0,Zn._x)("M j","short date format without the year")])].map((a,l)=>({key:`suggested-${l}`,name:(0,EE.dateI18n)(a,Km),format:a})),{key:"human-diff",name:(0,EE.humanTimeDiff)(Km),format:"human-diff"}],n={key:"custom",name:(0,Zn.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,Zn.__)("Enter your own date format")},[i,s]=(0,jM.useState)(()=>!!e&&!r.some(a=>a.format===e));return(0,vc.jsxs)(Sc.__experimentalVStack,{children:[(0,vc.jsx)(Sc.CustomSelectControl,{label:(0,Zn.__)("Choose a format"),options:[...r,n],value:i?n:r.find(a=>a.format===e)??n,onChange:({selectedItem:a})=>{a===n?s(!0):(s(!1),t(a.format))}}),i&&(0,vc.jsx)(Sc.TextControl,{label:(0,Zn.__)("Custom format"),hideLabelFromVision:!0,help:(0,jM.createInterpolateElement)((0,Zn.__)("Enter a date or timeformat string."),{Link:(0,vc.jsx)(Sc.ExternalLink,{href:(0,Zn.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:a=>t(a)})]})}var ul=c(U(),1),TE=c(G(),1),LSe=c(io(),1);var MSe=c(fe(),1),Ru=c(E(),1);function NSe({id:e,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s}){let a;i==="unset"?a=(0,Ru.jsx)(ul.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?a=(0,Ru.jsx)(ul.DuotoneSwatch,{values:i}):a=(0,Ru.jsx)(gt,{icon:R3});let l=(0,TE.__)("Apply duotone filter"),d=`${(0,MSe.useInstanceId)(NSe,"duotone-control",e)}__description`;return(0,Ru.jsx)(ul.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,TE.__)("Duotone")},renderToggle:({isOpen:f,onToggle:p})=>(0,Ru.jsx)(ul.ToolbarButton,{showTooltip:!0,onClick:p,"aria-haspopup":"true","aria-expanded":f,onKeyDown:m=>{!f&&m.keyCode===LSe.DOWN&&(m.preventDefault(),p())},label:l,icon:a}),renderContent:()=>(0,Ru.jsxs)(ul.MenuGroup,{label:(0,TE.__)("Duotone"),children:[(0,Ru.jsx)("p",{children:(0,TE.__)("Create a two-tone color effect without losing your original image.")}),(0,Ru.jsx)(ul.DuotonePicker,{"aria-label":l,"aria-describedby":d,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s})]})})}var HM=NSe;var zSe=c(U(),1),jSe=c(F(),1),la=c(G(),1);var On=c(G(),1);var UM=c(G(),1);function DSe(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=(0,UM._x)("Regular","font style");break;case"italic":t=(0,UM._x)("Italic","font style");break;case"oblique":t=(0,UM._x)("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}var kc=c(G(),1);function MG(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=(0,kc._x)("Regular","font weight");break;case"bold":case"700":t=(0,kc._x)("Bold","font weight");break;case"100":t=(0,kc._x)("Thin","font weight");break;case"200":t=(0,kc._x)("Extra Light","font weight");break;case"300":t=(0,kc._x)("Light","font weight");break;case"500":t=(0,kc._x)("Medium","font weight");break;case"600":t=(0,kc._x)("Semi Bold","font weight");break;case"800":t=(0,kc._x)("Extra Bold","font weight");break;case"900":t=(0,kc._x)("Black","font weight");break;case"1000":t=(0,kc._x)("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}var VSe=[{name:(0,On._x)("Regular","font style"),value:"normal"},{name:(0,On._x)("Italic","font style"),value:"italic"}],FSe=[{name:(0,On._x)("Thin","font weight"),value:"100"},{name:(0,On._x)("Extra Light","font weight"),value:"200"},{name:(0,On._x)("Light","font weight"),value:"300"},{name:(0,On._x)("Regular","font weight"),value:"400"},{name:(0,On._x)("Medium","font weight"),value:"500"},{name:(0,On._x)("Semi Bold","font weight"),value:"600"},{name:(0,On._x)("Bold","font weight"),value:"700"},{name:(0,On._x)("Extra Bold","font weight"),value:"800"},{name:(0,On._x)("Black","font weight"),value:"900"},{name:(0,On._x)("Extra Black","font weight"),value:"1000"}];function o_(e){let t=[],o=[],r=[],n=!e||e?.length===0,i=!1;return e?.forEach(s=>{if(typeof s.fontWeight=="string"&&/\s/.test(s.fontWeight.trim())){i=!0;let[u,d]=s.fontWeight.split(" "),f=parseInt(u.slice(0,1)),p=d==="1000"?10:parseInt(d.slice(0,1));for(let h=f;h<=p;h++){let m=`${h.toString()}00`;o.some(g=>g.value===m)||o.push(MG(m))}}let a=MG(typeof s.fontWeight=="number"?s.fontWeight.toString():s.fontWeight),l=DSe(s.fontStyle);l&&Object.keys(l).length&&(t.some(u=>u.value===l.value)||t.push(l)),a&&Object.keys(a).length&&(o.some(u=>u.value===a.value)||i||o.push(a))}),o.some(s=>(s.value??"")>="600")||o.push({name:(0,On._x)("Bold","font weight"),value:"700"}),t.some(s=>s.value==="italic")||t.push({name:(0,On._x)("Italic","font style"),value:"italic"}),n&&(t=VSe,o=FSe),t=t.length===0?VSe:t,o=o.length===0?FSe:o,t.forEach(({name:s,value:a})=>{o.forEach(({name:l,value:u})=>{let d=a==="normal"?l:(0,On.sprintf)((0,On._x)("%1$s %2$s","font"),l??"",s??"");r.push({key:`${a}-${u}`,name:d??"",style:{fontStyle:a,fontWeight:u}})})}),{fontStyles:t,fontWeights:o,combinedStyleAndWeightOptions:r,isSystemFont:n,isVariableFont:i}}var HSe=c(E(),1),DWe=(e,t)=>e?t?(0,la.__)("Appearance"):(0,la.__)("Font style"):(0,la.__)("Font weight");function GM(e){let{__next40pxDefaultSize:t,onChange:o,hasFontStyles:r=!0,hasFontWeights:n=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:a},...l}=e,u=r||n,d=DWe(r,n),f={key:"default",name:(0,la.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:p,fontWeights:h,combinedStyleAndWeightOptions:m}=o_(i),g=()=>{let _=[f];return m&&_.push(...m),_},b=()=>{let _=[f];return p.forEach(({name:x,value:w})=>{_.push({key:w,name:x,style:{fontStyle:w,fontWeight:void 0}})}),_},v=()=>{let _=[f];return h.forEach(({name:x,value:w})=>{_.push({key:w,name:x,style:{fontStyle:void 0,fontWeight:w}})}),_},y=(0,jSe.useMemo)(()=>r&&n?g():r?b():v(),[e.options,p,h,m]),k=y.find(_=>_.style.fontStyle===s&&_.style.fontWeight===a)||y[0];return u&&(0,HSe.jsx)(zSe.CustomSelectControl,{...l,className:"components-font-appearance-control",label:d,describedBy:k?r?n?(0,la.sprintf)((0,la.__)("Currently selected font appearance: %s"),k.name):(0,la.sprintf)((0,la.__)("Currently selected font style: %s"),k.name):(0,la.sprintf)((0,la.__)("Currently selected font weight: %s"),k.name):(0,la.__)("No selected font appearance"),options:y,value:k,onChange:({selectedItem:_})=>o(_.style)})}var USe=c(U(),1),NG=c(G(),1);var GSe=c(E(),1);function WM({__next40pxDefaultSize:e,value:t="",onChange:o,fontFamilies:r,className:n,...i}){let[s]=Le("typography.fontFamilies");if(r||(r=s),!r||r.length===0)return null;let a=[{key:"",name:(0,NG.__)("Default")},...r.map(({fontFamily:u,name:d})=>({key:u,name:d||u,style:{fontFamily:u}}))],l=a.find(u=>u.key===t)??"";return(0,GSe.jsx)(USe.CustomSelectControl,{label:(0,NG.__)("Font"),value:l,onChange:({selectedItem:u})=>o(u.key),options:a,className:K("block-editor-font-family-control",n),...i})}var $M=c(U(),1),WSe=c(G(),1);var $Se=c(E(),1);function KM({value:e,onChange:t,__unstableInputWidth:o="60px",...r}){let[n]=Le("spacing.units"),i=(0,$M.__experimentalUseCustomUnits)({availableUnits:n||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,$Se.jsx)($M.__experimentalUnitControl,{...r,label:(0,WSe.__)("Letter spacing"),value:e,__unstableInputWidth:o,units:i,onChange:t})}var RE=c(G(),1),YM=c(U(),1),DG=c(E(),1),VWe=[{label:(0,RE.__)("None"),value:"none",icon:dn},{label:(0,RE.__)("Underline"),value:"underline",icon:N3},{label:(0,RE.__)("Strikethrough"),value:"line-through",icon:L3}];function qM({value:e,onChange:t,className:o}){return(0,DG.jsx)(YM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,RE.__)("Decoration"),className:K("block-editor-text-decoration-control",o),value:e,onChange:r=>{t(r===e?void 0:r)},children:VWe.map(r=>(0,DG.jsx)(YM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var r_=c(G(),1);var ZM=c(U(),1),VG=c(E(),1),FWe=[{label:(0,r_.__)("None"),value:"none",icon:dn},{label:(0,r_.__)("Uppercase"),value:"uppercase",icon:V3},{label:(0,r_.__)("Lowercase"),value:"lowercase",icon:O3},{label:(0,r_.__)("Capitalize"),value:"capitalize",icon:P3}];function XM({className:e,value:t,onChange:o}){return(0,VG.jsx)(ZM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,r_.__)("Letter case"),className:K("block-editor-text-transform-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:FWe.map(r=>(0,VG.jsx)(ZM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var n_=c(G(),1);var QM=c(U(),1),FG=c(E(),1),zWe=[{label:(0,n_.__)("Horizontal"),value:"horizontal-tb",icon:x6},{label:(0,n_.__)("Vertical"),value:(0,n_.isRTL)()?"vertical-lr":"vertical-rl",icon:C6}];function JM({className:e,value:t,onChange:o}){return(0,FG.jsx)(QM.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,n_.__)("Orientation"),className:K("block-editor-writing-mode-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:zWe.map(r=>(0,FG.jsx)(QM.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var $i=c(U(),1),KSe=c(F(),1),YSe=c(G(),1);var mn=c(E(),1),jWe=({setting:e,children:t,panelId:o,...r})=>{let n=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return(0,mn.jsx)($i.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:n,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...r,className:K("block-editor-color-gradient-item","block-editor-tools-panel-color-gradient-settings__item"),panelId:o,resetAllFilter:e.resetAllFilter,children:t})},HWe=({colorValue:e,label:t})=>(0,mn.jsxs)($i.__experimentalHStack,{justify:"flex-start",children:[(0,mn.jsx)($i.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,mn.jsx)($i.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),UWe=e=>function({onToggle:o,isOpen:r}){let{clearable:n,colorValue:i,gradientValue:s,onColorChange:a,onGradientChange:l,label:u}=e,d=(0,KSe.useRef)(void 0),f={onClick:o,className:K("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:d},p=()=>{i?a():s&&l()},h=i??s;return(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsx)($i.Button,{__next40pxDefaultSize:!0,...f,children:(0,mn.jsx)(HWe,{colorValue:h,label:u})}),n&&h&&(0,mn.jsx)($i.Button,{__next40pxDefaultSize:!0,label:(0,YSe.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:dn,onClick:()=>{p(),r&&o(),d.current?.focus()}})]})};function eN({colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradients:n,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let l;return s&&(l={placement:"left-start",offset:36,shift:!0}),(0,mn.jsx)(mn.Fragment,{children:i.map((u,d)=>{let f={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradientValue:u.gradientValue,gradients:n,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...u},p={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&(0,mn.jsx)(jWe,{setting:u,...a,children:(0,mn.jsx)($i.Dropdown,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:UWe(p),renderContent:()=>(0,mn.jsx)($i.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,mn.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,mn.jsx)($m,{...f})})})})},d)})})}var tN=c(U(),1),qSe=c(Q(),1),ZSe=c(fe(),1);var zG=c(F(),1),Kb=c(G(),1);function Ym(){let[e,t,o,r,n,i,s,a,l,u]=Le("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!i};return d.colors=(0,zG.useMemo)(()=>{let f=[];return o&&o.length&&f.push({name:(0,Kb._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:o}),n&&r&&r.length&&f.push({name:(0,Kb._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:r}),t&&t.length&&f.push({name:(0,Kb._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),f},[t,o,r,n]),d.gradients=(0,zG.useMemo)(()=>{let f=[];return a&&a.length&&f.push({name:(0,Kb._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),u&&l&&l.length&&f.push({name:(0,Kb._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),s&&s.length&&f.push({name:(0,Kb._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),f},[s,a,l,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}var dl=c(E(),1),GWe=["colors","disableCustomColors","gradients","disableCustomGradients"],jG=({className:e,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,children:i,settings:s,title:a,showTitle:l=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d})=>{let f=(0,ZSe.useInstanceId)(jG),{batch:p}=(0,qSe.useRegistry)();return(!t||t.length===0)&&(!o||o.length===0)&&r&&n&&s?.every(h=>(!h.colors||h.colors.length===0)&&(!h.gradients||h.gradients.length===0)&&(h.disableCustomColors===void 0||h.disableCustomColors)&&(h.disableCustomGradients===void 0||h.disableCustomGradients))?null:(0,dl.jsx)(tN.__experimentalToolsPanel,{className:K("block-editor-panel-color-gradient-settings",e),hasInnerWrapper:!0,label:l?a:void 0,resetAll:()=>{p(()=>{s.forEach(({colorValue:h,gradientValue:m,onColorChange:g,onGradientChange:b})=>{h?g():m&&b()})})},panelId:f,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:(0,dl.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__inner-wrapper",children:[(0,dl.jsx)(eN,{settings:s,panelId:f,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!i&&(0,dl.jsxs)(dl.Fragment,{children:[(0,dl.jsx)(tN.__experimentalSpacer,{marginTop:4,marginBottom:0}),i]})]})})},WWe=e=>{let t=Ym();return(0,dl.jsx)(jG,{...t,...e})},$We=e=>GWe.every(t=>e.hasOwnProperty(t))?(0,dl.jsx)(jG,{...e}):(0,dl.jsx)(WWe,{...e}),oN=$We;var rN=c(F(),1),Yb=c(U(),1),UG=c(G(),1);var BE=c(E(),1),HG=[],KWe={...MM,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function YWe(e){let t=e?.default??HG,o=e?.custom??HG,r=e?.theme??HG;return(0,rN.useMemo)(()=>[{name:(0,UG.__)("None"),slug:"0",size:0},...o,...r,...t],[o,r,t])}function qb({label:e=(0,UG.__)("Dimension"),onChange:t,value:o,placeholder:r,className:n,dimensionSizes:i}){let[s,a]=Le("dimensions.dimensionSizes","spacing.units"),l=i??s,u=(0,Yb.__experimentalUseCustomUnits)({availableUnits:a||["%","px","em","rem","vh","vw"]}),d=YWe(l),[f,p]=(0,rN.useState)(()=>{let[,m]=(0,Yb.__experimentalParseQuantityAndUnitFromRawValue)(o);return m||u[0]?.value||"px"}),h=m=>{let[g,b]=(0,Yb.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(m)&&b==="px"?t((g/16).toFixed(2)+m):["em","rem"].includes(b)&&m==="px"?t(Math.round(g*16)+m):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(m)&&g>100&&t(100+m),p(m)};return(0,BE.jsxs)("fieldset",{className:K("block-editor-dimension-control",n),children:[(0,BE.jsx)(Yb.BaseControl.VisualLabel,{as:"legend",children:e}),(0,BE.jsx)($b,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:KWe,minimumCustomValue:0,onChange:t,onUnitChange:h,placeholder:r,presets:d,presetType:"dimension",selectedUnit:f,showTooltip:!0,units:u,value:o})]})}var QSe=c(F(),1),An=c(U(),1),JSe=c(G(),1),eke=c(Rt(),1);var Bu=c(E(),1),XSe={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function tke({label:e=(0,JSe.__)("Height"),onChange:t,value:o}){(0,eke.default)("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});let r=parseFloat(o),[n]=Le("spacing.units"),i=(0,An.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=(0,QSe.useMemo)(()=>(0,An.__experimentalParseQuantityAndUnitFromRawValue)(o),[o])[1]||i[0]?.value||"px",a=u=>{t([u,s].join(""))},l=u=>{let[d,f]=(0,An.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(u)&&f==="px"?t((d/16).toFixed(2)+u):["em","rem"].includes(f)&&u==="px"?t(Math.round(d*16)+u):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(u)&&d>100&&t(100+u)};return(0,Bu.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Bu.jsx)(An.BaseControl.VisualLabel,{as:"legend",children:e}),(0,Bu.jsxs)(An.Flex,{children:[(0,Bu.jsx)(An.FlexItem,{isBlock:!0,children:(0,Bu.jsx)(An.__experimentalUnitControl,{value:o,units:i,onChange:t,onUnitChange:l,min:0,label:e,hideLabelFromVision:!0})}),(0,Bu.jsx)(An.FlexItem,{isBlock:!0,children:(0,Bu.jsx)(An.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,Bu.jsx)(An.RangeControl,{value:r,min:0,max:XSe[s]?.max??100,step:XSe[s]?.step??.1,withInputField:!1,onChange:a,label:e,hideLabelFromVision:!0})})})]})]})}var AE=c(U(),1),n_e=c(Rt(),1);var fl=c(ce()),Tke=c(_ke());function JWe(e,t,o,r,n,i){i===void 0&&(i=0);var s=i_(e,t,i),a=s.width,l=s.height,u=Math.min(a,o),d=Math.min(l,r);return u>d*n?{width:d*n,height:d}:{width:u,height:u/n}}function e$e(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function PE(e,t,o,r,n){n===void 0&&(n=0);var i=i_(t.width,t.height,n),s=i.width,a=i.height;return{x:xke(e.x,s,o.width,r),y:xke(e.y,a,o.height,r)}}function xke(e,t,o,r){var n=t*r/2-o/2;return cN(e,-n,n)}function wke(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Cke(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function t$e(e,t,o,r,n,i,s){i===void 0&&(i=0),s===void 0&&(s=!0);var a=s?o$e:r$e,l=i_(t.width,t.height,i),u=i_(t.naturalWidth,t.naturalHeight,i),d={x:a(100,((l.width-o.width/n)/2-e.x/n)/l.width*100),y:a(100,((l.height-o.height/n)/2-e.y/n)/l.height*100),width:a(100,o.width/l.width*100/n),height:a(100,o.height/l.height*100/n)},f=Math.round(a(u.width,d.width*u.width/100)),p=Math.round(a(u.height,d.height*u.height/100)),h=u.width>=u.height*r,m=h?{width:Math.round(p*r),height:p}:{width:f,height:Math.round(f/r)},g=fn(fn({},m),{x:Math.round(a(u.width-m.width,d.x*u.width/100)),y:Math.round(a(u.height-m.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function o$e(e,t){return Math.min(e,Math.max(0,t))}function r$e(e,t){return t}function n$e(e,t,o,r,n,i){var s=i_(t.width,t.height,o),a=cN(r.width/s.width*(100/e.width),n,i),l={x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)};return{crop:l,zoom:a}}function i$e(e,t,o){var r=e$e(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}function s$e(e,t,o,r,n,i){o===void 0&&(o=0);var s=i_(t.naturalWidth,t.naturalHeight,o),a=cN(i$e(e,t,r),n,i),l=r.height>r.width?r.height/e.height:r.width/e.width,u={x:((s.width-e.width)/2-e.x)*l,y:((s.height-e.height)/2-e.y)*l};return{crop:u,zoom:a}}function Eke(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function a$e(e){return e*Math.PI/180}function i_(e,t,o){var r=a$e(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function cN(e,t,o){return Math.min(Math.max(e,t),o)}function lN(){for(var e=[],t=0;t0}).join(" ").trim()}var l$e=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; user-select: none; touch-action: none; cursor: move; display: flex; justify-content: center; align-items: center; }.reactEasyCrop_Image, .reactEasyCrop_Video { will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ }.reactEasyCrop_Contain { max-width: 100%; max-height: 100%; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .reactEasyCrop_Cover_Horizontal { width: 100%; height: auto; } .reactEasyCrop_Cover_Vertical { width: auto; height: 100%; }.reactEasyCrop_CropArea { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; box-shadow: 0 0 0 9999em; color: rgba(0, 0, 0, 0.5); overflow: hidden; }.reactEasyCrop_CropAreaRound { border-radius: 50%; }.reactEasyCrop_CropAreaGrid::before { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }.reactEasyCrop_CropAreaGrid::after { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-left: 0; border-right: 0; } `,c$e=1,u$e=3,d$e=1,Rke=(function(e){IX(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.cropperRef=fl.createRef(),o.imageRef=fl.createRef(),o.videoRef=fl.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc=typeof document<"u"?document:null,o.currentWindow=typeof window<"u"?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!o.containerRef)){var r=!0;o.resizeObserver=new window.ResizeObserver(function(n){if(r){r=!1;return}o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(r){return r.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var r=o.computeSizes();r&&(o.previousCropSize=r,o.emitCropData(),o.setInitialCrop(r),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(r){if(o.props.initialCroppedAreaPercentages){var n=n$e(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=n.crop,s=n.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}else if(o.props.initialCroppedAreaPixels){var a=s$e(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=a.crop,s=a.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}},o.computeSizes=function(){var r,n,i,s,a,l,u=o.imageRef.current||o.videoRef.current;if(u&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var d=o.containerRect.width/o.containerRect.height,f=((r=o.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((n=o.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0,p=((i=o.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((s=o.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,h=u.offsetWidthm?{width:o.containerRect.height*m,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/m};break;case"horizontal-cover":g={width:o.containerRect.width,height:o.containerRect.width/m};break;case"vertical-cover":g={width:o.containerRect.height*m,height:o.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};o.mediaSize=fn(fn({},g),{naturalWidth:f,naturalHeight:p}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var b=o.props.cropSize?o.props.cropSize:JWe(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(((a=o.state.cropSize)===null||a===void 0?void 0:a.height)!==b.height||((l=o.state.cropSize)===null||l===void 0?void 0:l.width)!==b.width)&&o.props.onCropSizeChange&&o.props.onCropSizeChange(b),o.setState({cropSize:b},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(b),b}},o.saveContainerPosition=function(){if(o.containerRef){var r=o.containerRef.getBoundingClientRect();o.containerPosition={x:r.left,y:r.top}}},o.onMouseDown=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(t.getMousePoint(r)))},o.onMouseMove=function(r){return o.onDrag(t.getMousePoint(r))},o.onScroll=function(r){o.currentDoc&&(r.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(r){o.currentDoc&&(o.isTouching=!0,!(o.props.onTouchRequest&&!o.props.onTouchRequest(r))&&(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),r.touches.length===2?o.onPinchStart(r):r.touches.length===1&&o.onDragStart(t.getTouchPoint(r.touches[0]))))},o.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?o.onPinchMove(r):r.touches.length===1&&o.onDrag(t.getTouchPoint(r.touches[0]))},o.onGestureStart=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(r){if(r.preventDefault(),!o.isTouching){var n=t.getMousePoint(r),i=o.gestureZoomStart-1+r.scale;if(o.setNewZoom(i,n,{shouldUpdatePosition:!0}),o.props.onRotationChange){var s=o.gestureRotationStart+r.rotation;o.props.onRotationChange(s)}}},o.onGestureEnd=function(r){o.cleanEvents()},o.onDragStart=function(r){var n,i,s=r.x,a=r.y;o.dragStartPosition={x:s,y:a},o.dragStartCrop=fn({},o.props.crop),(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n)},o.onDrag=function(r){var n=r.x,i=r.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&!(n===void 0||i===void 0)){var s=n-o.dragStartPosition.x,a=i-o.dragStartPosition.y,l={x:o.dragStartCrop.x+s,y:o.dragStartCrop.y+a},u=o.props.restrictPosition?PE(l,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):l;o.props.onCropChange(u)}}))},o.onDragStopped=function(){var r,n;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),(n=(r=o.props).onInteractionEnd)===null||n===void 0||n.call(r)},o.onWheel=function(r){if(o.currentWindow&&!(o.props.onWheelRequest&&!o.props.onWheelRequest(r))){r.preventDefault();var n=t.getMousePoint(r),i=(0,Tke.default)(r).pixelY,s=o.props.zoom-i*o.props.zoomSpeed/200;o.setNewZoom(s,n,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var a,l;return(l=(a=o.props).onInteractionStart)===null||l===void 0?void 0:l.call(a)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var a,l;return(l=(a=o.props).onInteractionEnd)===null||l===void 0?void 0:l.call(a)})},250)}},o.getPointOnContainer=function(r,n){var i=r.x,s=r.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(i-n.x),y:o.containerRect.height/2-(s-n.y)}},o.getPointOnMedia=function(r){var n=r.x,i=r.y,s=o.props,a=s.crop,l=s.zoom;return{x:(n+a.x)/l,y:(i+a.y)/l}},o.setNewZoom=function(r,n,i){var s=i===void 0?{}:i,a=s.shouldUpdatePosition,l=a===void 0?!0:a;if(!(!o.state.cropSize||!o.props.onZoomChange)){var u=cN(r,o.props.minZoom,o.props.maxZoom);if(l){var d=o.getPointOnContainer(n,o.containerPosition),f=o.getPointOnMedia(d),p={x:f.x*u-d.x,y:f.y*u-d.y},h=o.props.restrictPosition?PE(p,o.mediaSize,o.state.cropSize,u,o.props.rotation):p;o.props.onCropChange(h)}o.props.onZoomChange(u)}},o.getCropData=function(){if(!o.state.cropSize)return null;var r=o.props.restrictPosition?PE(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;return t$e(r,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition)},o.emitCropData=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(n,i),o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.emitCropAreaChange=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var r=o.props.crop;if(o.isInitialized&&o.previousCropSize){var n=Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6;if(n){var i=o.state.cropSize.width/o.previousCropSize.width,s=o.state.cropSize.height/o.previousCropSize.height;r={x:o.props.crop.x*i,y:o.props.crop.y*s}}}var a=o.props.restrictPosition?PE(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(a),o.emitCropData()}},o.onKeyDown=function(r){var n,i,s=o.props,a=s.crop,l=s.onCropChange,u=s.keyboardStep,d=s.zoom,f=s.rotation,p=u;if(o.state.cropSize){r.shiftKey&&(p*=.2);var h=fn({},a);switch(r.key){case"ArrowUp":h.y-=p,r.preventDefault();break;case"ArrowDown":h.y+=p,r.preventDefault();break;case"ArrowLeft":h.x-=p,r.preventDefault();break;case"ArrowRight":h.x+=p,r.preventDefault();break;default:return}o.props.restrictPosition&&(h=PE(h,o.mediaSize,o.state.cropSize,d,f)),r.repeat||(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n),l(h)}},o.onKeyUp=function(r){var n,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}o.emitCropData(),(i=(n=o.props).onInteractionEnd)===null||i===void 0||i.call(n)},o}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=l$e,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var o,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(o=this.resizeObserver)===null||o===void 0||o.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(o){var r,n,i,s,a,l,u,d,f;o.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):o.aspect!==this.props.aspect?this.computeSizes():o.objectFit!==this.props.objectFit?this.computeSizes():o.zoom!==this.props.zoom?this.recomputeCropPosition():((r=o.cropSize)===null||r===void 0?void 0:r.height)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.height)||((i=o.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=o.crop)===null||a===void 0?void 0:a.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((u=o.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),o.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),o.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var o=this.props,r=o.cropSize,n=o.aspect;return r?r.width/r.height:n},t.prototype.getObjectFit=function(){var o,r,n,i;if(this.props.objectFit==="cover"){var s=this.imageRef.current||this.videoRef.current;if(s&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,l=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,d=l/u;return de>=0?e%360:(360+e%360)%360,f$e=e=>new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",n=>o(n)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function Oke(e){return e*Math.PI/180}function p$e(e,t,o){let r=Oke(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}async function Ake(e,t,o=0,r={horizontal:!1,vertical:!1}){try{let n=await f$e(e),i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;let a=Oke(o),{width:l,height:u}=p$e(n.width,n.height,o);i.width=l,i.height=u,s.translate(l/2,u/2),s.rotate(a),s.scale(r.horizontal?-1:1,r.vertical?-1:1),s.translate(-n.width/2,-n.height/2),s.drawImage(n,0,0);let d=document.createElement("canvas"),f=d.getContext("2d");return f?(d.width=t.width,d.height=t.height,f.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(p=>{d.toBlob(h=>{h&&p(URL.createObjectURL(h))},"image/jpeg")})):null}catch{return null}}var Qb={crop:{x:0,y:0,width:100,height:100},zoom:s_,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},m$e={x:0,y:0},QG={crop:m$e,croppedArea:Qb.crop,croppedAreaPixels:null,zoom:Qb.zoom,rotation:Qb.rotation,flip:Qb.flip,aspectRatio:Qb.aspectRatio,mediaSize:null};function Lke(){let[e,t]=(0,_c.useState)(QG),[o,r]=(0,_c.useState)(null),n=(0,_c.useCallback)(u=>{t(d=>{let p={...typeof u=="function"?u(d):u};return"rotation"in p&&p.rotation!==void 0&&(p.rotation=uN(p.rotation)),{...d,...p}})},[]),i=(0,_c.useCallback)((u=null)=>{if(!u){r(null),n(QG);return}if(typeof u=="object"){let d={...Qb,...u};r(d),n(d)}},[n,r]),s=(0,_c.useCallback)(()=>{if(o){let u={crop:{x:0,y:0},croppedAreaPixels:null};o.crop&&(u.croppedArea=o.crop),o.zoom!==void 0&&(u.zoom=o.zoom),o.rotation!==void 0&&(u.rotation=o.rotation),o.aspectRatio!==void 0&&(u.aspectRatio=o.aspectRatio),o.flip!==void 0&&(u.flip=o.flip),n(u)}else n({...QG})},[o,n]),a=(0,_c.useMemo)(()=>{if(o){let d={crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:uN(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Xb(d,o)===!1}let u={crop:e.croppedArea,zoom:e.zoom,rotation:uN(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Xb(u,Qb)===!1},[e,o]),l=(0,_c.useCallback)(async u=>e.croppedAreaPixels?Ake(u,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,_c.useMemo)(()=>({cropperState:e,setCropperState:n,resetState:o,setResetState:i,isDirty:a,reset:s,getCroppedImage:l}),[e,n,o,i,a,s,l])}var Mke=c(E(),1),Nke=(0,a_.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:s_,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function JG({children:e}){let t=Lke(),o=(0,a_.useMemo)(()=>({...t}),[t]);return(0,Mke.jsx)(Nke.Provider,{value:o,children:e})}var IE=()=>{let e=(0,a_.useContext)(Nke);if(!e)throw new Error("Missing ImageCropperContext");return e};var Vke=c(E(),1);function eW({src:e,onLoad:t,minZoom:o=s_,maxZoom:r=Ike,...n}){let{cropperState:i,setCropperState:s}=IE(),{crop:a,zoom:l,rotation:u,aspectRatio:d,flip:f}=i,p=v=>s({crop:v}),h=v=>s({zoom:v}),m=v=>s({rotation:v}),g=v=>s({mediaSize:v}),b=(0,Dke.useCallback)((v,y)=>{s({croppedArea:v,croppedAreaPixels:y})},[s]);return(0,Vke.jsx)(Rke,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:o,maxZoom:r,rotation:u,image:e,setMediaSize:g,crop:a,zoom:l,aspect:d,onCropChange:p,onZoomChange:h,onCropComplete:b,onMediaLoaded:v=>{t?.(v)},onRotationChange:m,transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${u}deg)`,`rotateY(${f.horizontal?180:0}deg)`,`rotateX(${f.vertical?180:0}deg)`,`scale(${l})`].join(" "),...n})}var u_=c(U(),1),c_=c(G(),1);var Fke=100,zke=300,dN={placement:"bottom-start"};var l_=c(F(),1);var fN=c(Q(),1),Jb=c(F(),1),mf=c(G(),1),jke=c(as(),1),Hke=c(Tt(),1);var h$e={crop:(0,mf.__)("Image cropped."),rotate:(0,mf.__)("Image rotated."),cropAndRotate:(0,mf.__)("Image cropped and rotated.")};function Uke({crop:e,rotation:t,url:o,id:r,onSaveImage:n,onFinishEditing:i}){let{createErrorNotice:s,createSuccessNotice:a}=(0,fN.useDispatch)(jke.store),[l,u]=(0,Jb.useState)(!1),{editMediaEntity:d}=(0,fN.useSelect)(h=>({editMediaEntity:h(C).getSettings()?.[fT]}),[]),f=(0,Jb.useCallback)(()=>{u(!1),i()},[i]),p=(0,Jb.useCallback)(async()=>{if(!d){i(),s((0,mf.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});return}u(!0);let h=[];if(t>0&&h.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&h.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),h.length===0){u(!1),i();return}let m=h.length===1?h[0].type:"cropAndRotate";try{let g=await d(r,{src:o,modifiers:h},{throwOnError:!0});g&&(n({id:g.id,url:g.source_url}),a(h$e[m],{type:"snackbar",actions:[{label:(0,mf.__)("Undo"),onClick:()=>{n({id:r,url:o})}}]}))}catch(g){s((0,mf.sprintf)((0,mf.__)("Could not edit image. %s"),(0,Hke.__unstableStripHTML)(g.message)),{id:"image-editing-error",type:"snackbar"})}finally{u(!1),i()}},[e,t,r,o,n,s,a,i,d]);return(0,Jb.useMemo)(()=>({isInProgress:l,apply:p,cancel:f}),[l,p,f])}var xc=c(F(),1),Gke=c(go(),1);function Wke({url:e,naturalWidth:t,naturalHeight:o}){let[r,n]=(0,xc.useState)(),{cropperState:i,setCropperState:s}=IE(),{zoom:a,aspectRatio:l,crop:u,croppedArea:d}=i,f=(0,xc.useCallback)(y=>{s({zoom:y})},[s]),p=(0,xc.useCallback)(y=>{s({aspectRatio:y})},[s]),h=t/o,m=o/t;(0,xc.useEffect)(()=>{p(h)},[]);let[g,b]=(0,xc.useState)(0),v=(0,xc.useCallback)(()=>{let y=(g+90)%360,k=h,_=a!==1||!(h===l||m===l);if(g%180===90&&(k=1/h),y===0){n(),b(y),s({aspectRatio:_?l:h,crop:{x:-(u.y*k),y:u.x*k}});return}function x(B){let R=document.createElement("canvas"),I=0,A=0;y%180?(R.width=B.target.height,R.height=B.target.width):(R.width=B.target.width,R.height=B.target.height),(y===90||y===180)&&(I=R.width),(y===270||y===180)&&(A=R.height);let P=R.getContext("2d");P.translate(I,A),P.rotate(y*Math.PI/180),P.drawImage(B.target,0,0),R.toBlob(O=>{n(URL.createObjectURL(O)),b(y);let N=_?l:R.width/R.height;s({aspectRatio:N,crop:{x:-(u.y*k),y:u.x*k}})})}let w=new window.Image;w.src=e,w.onload=x;let T=(0,Gke.applyFilters)("media.crossOrigin",void 0,e);typeof T=="string"&&(w.crossOrigin=T)},[g,h,e,s,u,a,l,m,b]);return(0,xc.useMemo)(()=>({editedUrl:r,setEditedUrl:n,crop:d,zoom:a,setZoom:f,rotation:g,rotateClockwise:v,aspect:l,setAspect:p,defaultAspect:h}),[r,d,a,f,g,v,l,p,h])}var $ke=c(E(),1),tW=(0,l_.createContext)({});tW.displayName="ImageEditingContext";var Pu=()=>(0,l_.useContext)(tW);function Kke({id:e,url:t,naturalWidth:o,naturalHeight:r,onFinishEditing:n,onSaveImage:i,children:s}){let a=Wke({url:t,naturalWidth:o,naturalHeight:r}),l=Uke({id:e,url:t,onSaveImage:i,onFinishEditing:n,...a}),u=(0,l_.useMemo)(()=>({...a,...l}),[a,l]);return(0,$ke.jsx)(tW.Provider,{value:u,children:s})}var pl=c(E(),1);function pN({aspectRatios:e,isDisabled:t,label:o,onClick:r,value:n}){return(0,pl.jsx)(u_.MenuGroup,{label:o,children:e.map(({name:i,slug:s,ratio:a})=>(0,pl.jsx)(u_.MenuItem,{disabled:t,onClick:()=>{r(a)},role:"menuitemradio",isSelected:a===n,icon:a===n?ns:void 0,children:i},s))})}function g$e(e){let[t,o,...r]=e.split("/").map(Number);return t<=0||o<=0||Number.isNaN(t)||Number.isNaN(o)||r.length?NaN:o?t/o:t}function oW({ratio:e,...t}){return{ratio:g$e(e),...t}}function Yke({toggleProps:e}){let{isInProgress:t,aspect:o,setAspect:r,defaultAspect:n}=Pu(),[i,s,a]=Le("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,pl.jsx)(u_.DropdownMenu,{icon:GF,label:(0,c_.__)("Aspect Ratio"),popoverProps:dN,toggleProps:e,children:({onClose:l})=>(0,pl.jsxs)(pl.Fragment,{children:[(0,pl.jsx)(pN,{isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:[{slug:"original",name:(0,c_.__)("Original"),ratio:n},...a?i.map(oW).filter(({ratio:u})=>u===1):[]]}),s?.length>0&&(0,pl.jsx)(pN,{label:(0,c_.__)("Theme"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:s}),a&&(0,pl.jsx)(pN,{label:(0,c_.__)("Landscape"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:i.map(oW).filter(({ratio:u})=>u>1)}),a&&(0,pl.jsx)(pN,{label:(0,c_.__)("Portrait"),isDisabled:t,onClick:u=>{r(u),l()},value:o,aspectRatios:i.map(oW).filter(({ratio:u})=>u<1)})]})})}var qke=c(U(),1),Zke=c(fe(),1);var qm=c(E(),1);function Xke({url:e,width:t,height:o,naturalHeight:r,naturalWidth:n,borderProps:i}){let{isInProgress:s,editedUrl:a,rotation:l}=Pu(),[u,{width:d}]=(0,Zke.useResizeObserver)(),f=o||d*r/n;l%180===90&&(f=d*n/r);let p=(0,qm.jsxs)("div",{className:K("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||d,height:f},children:[(0,qm.jsx)(eW,{src:a||e}),s&&(0,qm.jsx)(qke.Spinner,{})]});return(0,qm.jsxs)(qm.Fragment,{children:[u,p]})}var Zm=c(U(),1),rW=c(G(),1);var OE=c(E(),1);function Qke(){let{isInProgress:e,zoom:t,setZoom:o}=Pu();return(0,OE.jsx)(Zm.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:dN,renderToggle:({isOpen:r,onToggle:n})=>(0,OE.jsx)(Zm.ToolbarButton,{icon:J4,label:(0,rW.__)("Zoom"),onClick:n,"aria-expanded":r,disabled:e}),renderContent:()=>(0,OE.jsx)(Zm.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,OE.jsx)(Zm.RangeControl,{label:(0,rW.__)("Zoom"),min:Fke,max:zke,value:Math.round(t*100),onChange:r=>o(r/100)})})})}var Jke=c(U(),1),e_e=c(G(),1);var t_e=c(E(),1);function o_e(){let{isInProgress:e,rotateClockwise:t}=Pu();return(0,t_e.jsx)(Jke.ToolbarButton,{icon:q4,label:(0,e_e.__)("Rotate"),onClick:t,disabled:e})}var nW=c(U(),1),iW=c(G(),1);var ey=c(E(),1);function r_e(){let{isInProgress:e,apply:t,cancel:o}=Pu();return(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(nW.ToolbarButton,{onClick:t,disabled:e,children:(0,iW.__)("Apply")}),(0,ey.jsx)(nW.ToolbarButton,{onClick:o,children:(0,iW.__)("Cancel")})]})}var ca=c(E(),1);function i_e({id:e,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,n_e.default)("wp.blockEditor.__experimentalImageEditor",{since:"7.1",hint:"The Media Editor modal is now the default crop experience for core blocks. This component will be removed in a future major release."}),(0,ca.jsx)(JG,{children:(0,ca.jsxs)(Kke,{id:e,url:t,naturalWidth:i,naturalHeight:n,onSaveImage:s,onFinishEditing:a,children:[(0,ca.jsx)(Xke,{borderProps:l,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i}),(0,ca.jsxs)(No,{children:[(0,ca.jsxs)(AE.ToolbarGroup,{children:[(0,ca.jsx)(Qke,{}),(0,ca.jsx)(AE.ToolbarItem,{children:u=>(0,ca.jsx)(Yke,{toggleProps:u})}),(0,ca.jsx)(o_e,{})]}),(0,ca.jsx)(AE.ToolbarGroup,{children:(0,ca.jsx)(r_e,{})})]})]})})}var ua=c(U(),1),Xm=c(G(),1);var d_=c(F(),1);function s_e(e,t,o,r,n){let[i,s]=(0,d_.useState)(t??r??""),[a,l]=(0,d_.useState)(e??o??"");return(0,d_.useEffect)(()=>{t===void 0&&r!==void 0&&s(r),e===void 0&&o!==void 0&&l(o)},[r,o]),(0,d_.useEffect)(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(a)&&l(e)},[t,e]),{currentHeight:a,currentWidth:i,updateDimension:(f,p)=>{let h=p===""?void 0:parseInt(p,10);f==="width"?s(h):l(h),n({[f]:h})},updateDimensions:(f,p)=>{l(f??o),s(p??r),n({height:f,width:p})}}}var ml=c(E(),1),a_e=[25,50,75,100],b$e=()=>{};function l_e(e,t,o){let r=Math.round(t*(e/100)),n=Math.round(o*(e/100));return{scaledWidth:r,scaledHeight:n}}function c_e({imageSizeHelp:e,imageWidth:t,imageHeight:o,imageSizeOptions:r=[],isResizable:n=!0,slug:i,width:s,height:a,onChange:l,onChangeImage:u=b$e}){let{currentHeight:d,currentWidth:f,updateDimension:p,updateDimensions:h}=s_e(a,s,o,t,l),m=b=>{if(b===void 0){h();return}let{scaledWidth:v,scaledHeight:y}=l_e(b,t,o);h(y,v)},g=a_e.find(b=>{let{scaledWidth:v,scaledHeight:y}=l_e(b,t,o);return f===v&&d===y});return(0,ml.jsxs)(ua.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[r&&r.length>0&&(0,ml.jsx)(ua.SelectControl,{label:(0,Xm.__)("Resolution"),value:i,options:r,onChange:u,help:e}),n&&(0,ml.jsxs)(ml.Fragment,{children:[(0,ml.jsxs)(ua.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,ml.jsx)(ua.__experimentalNumberControl,{label:(0,Xm.__)("Width"),value:f,min:1,onChange:b=>p("width",b)}),(0,ml.jsx)(ua.__experimentalNumberControl,{label:(0,Xm.__)("Height"),value:d,min:1,onChange:b=>p("height",b)})]}),(0,ml.jsx)(ua.__experimentalToggleGroupControl,{label:(0,Xm.__)("Image size presets"),hideLabelFromVision:!0,onChange:m,value:g,isBlock:!0,children:a_e.map(b=>(0,ml.jsx)(ua.__experimentalToggleGroupControlOption,{value:b,label:(0,Xm.sprintf)((0,Xm.__)("%d%%"),b)},b))})]})]})}var mN=c(U(),1);var ty=c(G(),1),d_e=c(E(),1),u_e={left:ip,center:np,right:sp,"space-between":Zy,stretch:Xy};function y$e({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:o,value:r,popoverProps:n,isToolbar:i}){let s=f=>{o(f===r?void 0:f)},a=r?u_e[r]:u_e.left,l=[{name:"left",icon:ip,title:(0,ty.__)("Justify items left"),isActive:r==="left",onClick:()=>s("left")},{name:"center",icon:np,title:(0,ty.__)("Justify items center"),isActive:r==="center",onClick:()=>s("center")},{name:"right",icon:sp,title:(0,ty.__)("Justify items right"),isActive:r==="right",onClick:()=>s("right")},{name:"space-between",icon:Zy,title:(0,ty.__)("Space between items"),isActive:r==="space-between",onClick:()=>s("space-between")},{name:"stretch",icon:Xy,title:(0,ty.__)("Stretch items"),isActive:r==="stretch",onClick:()=>s("stretch")}],u=i?mN.ToolbarGroup:mN.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,d_e.jsx)(u,{icon:a,popoverProps:n,label:(0,ty.__)("Change items justification"),controls:l.filter(f=>e.includes(f.name)),...d})}var sW=y$e;var aW=c(E(),1),_v=e=>(0,aW.jsx)(sW,{...e,isToolbar:!1}),f_e=e=>(0,aW.jsx)(sW,{...e,isToolbar:!0});var Ki=c(U(),1),wc=c(G(),1),wr=c(F(),1),TN=c(fe(),1),nxe=c(Tt(),1),ixe=c(io(),1),sxe=c(GC(),1),RN=c(Q(),1),gW=c(dv(),1);var axe=c(Rt(),1),BN=c(Fs(),1);var f_=c(U(),1);var hN=c(fe(),1),gN=c(G(),1),p_e=c(F(),1),hf=c(E(),1);function m_e({children:e,settingsOpen:t,setSettingsOpen:o}){let r=(0,hN.useReducedMotion)(),n=r?p_e.Fragment:f_.__unstableAnimatePresence,i=r?"div":f_.__unstableMotion.div,a=`link-control-settings-drawer-${(0,hN.useInstanceId)(m_e)}`;return(0,hf.jsxs)(hf.Fragment,{children:[(0,hf.jsx)(f_.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>o(!t),icon:(0,gN.isRTL)()?jx:rp,"aria-controls":a,children:(0,gN._x)("Advanced","Additional link settings")}),(0,hf.jsx)(n,{children:t&&(0,hf.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!t,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,hf.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}var h_e=m_e;var _N=c(F(),1),mW=c(G(),1),L_e=c(Rt(),1);var LE=c(G(),1),E_e=c(U(),1);var bN=c(G(),1),g_e=c(U(),1),b_e=c(F(),1);var lW=c(E(),1),v$e=({searchTerm:e,onClick:t,itemProps:o,buttonText:r})=>{if(!e)return null;let n;return r?n=typeof r=="function"?r(e):r:n=(0,b_e.createInterpolateElement)((0,bN.sprintf)((0,bN.__)("Create: %s"),e),{mark:(0,lW.jsx)("mark",{})}),(0,lW.jsx)(g_e.MenuItem,{...o,iconPosition:"left",icon:Ca,className:"block-editor-link-control__search-item",onClick:t,children:n})},y_e=v$e;var gf=c(G(),1),vN=c(U(),1);var v_e=c(Tt(),1),m_=c(Fs(),1),S_e=c(fe(),1),k_e=c(Rt(),1),p_=c(E(),1),yN={post:{icon:$4,label:(0,gf.__)("Post")},page:{icon:cg,label:(0,gf.__)("Page")},post_tag:{icon:k6,label:(0,gf.__)("Tag")},category:{icon:qF,label:(0,gf.__)("Category")},attachment:{icon:E3,label:(0,gf.__)("Attachment")}};function S$e({isURL:e,suggestion:t}){let o=null;return e?o=Ux:t.type in yN&&(o=yN[t.type].icon,t.type==="page"&&(t.isFrontPage&&(o=n4),t.isBlogHome&&(o=M6))),o?(0,p_.jsx)(gt,{className:"block-editor-link-control__search-item-icon",icon:o}):null}function k$e(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function _$e(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}var x$e=(e,...t)=>(...o)=>e(...o,...t),w$e=e=>t=>t==null||t!==t?e:t;function C$e(e){return e&&(0,S_e.pipe)(m_.safeDecodeURI,m_.getPath,w$e(""),x$e(m_.filterURLForDisplay,24),_$e,k$e)(e)}var __e=({itemProps:e,suggestion:t,searchTerm:o,onClick:r,isURL:n=!1,shouldShowType:i=!1})=>{let s=n?(0,gf.__)("Press ENTER to add this link"):C$e(t.url);return(0,p_.jsx)(vN.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,p_.jsx)(S$e,{suggestion:t,isURL:n}),onClick:r,shortcut:i&&E$e(t),className:"block-editor-link-control__search-item",children:(0,p_.jsx)(vN.TextHighlight,{text:(0,v_e.__unstableStripHTML)(t.title),highlight:o})})};function E$e(e){return e.isFrontPage?(0,gf.__)("Front page"):e.isBlogHome?(0,gf.__)("Blog home"):e.type in yN?yN[e.type].label:e.type}var x_e=__e,w_e=e=>((0,k_e.default)("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,p_.jsx)(__e,{...e}));var C_e=c(G(),1),oy="__CREATE__",cW="tel",SN="link",uW="mailto",dW="internal",h_=[SN,uW,cW,dW],fW=[{id:"opensInNewTab",title:(0,C_e.__)("Open in new tab")}];var T_e=c(Rt(),1),ry=c(E(),1);function R_e({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:n,suggestions:i,selectedSuggestion:s,isLoading:a,isInitialSuggestions:l,createSuggestionButtonText:u,suggestionsQuery:d}){let f=K("block-editor-link-control__search-results",{"is-loading":a}),p=i.length===1&&h_.includes(i[0].type),h=e&&!p&&!l,m=!d?.type,g=l?(0,LE.__)("Suggestions"):(0,LE.sprintf)((0,LE.__)('Search results for "%s"'),t);return(0,ry.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,ry.jsx)("div",{...r,className:f,"aria-label":g,children:(0,ry.jsx)(E_e.MenuGroup,{children:i.map((b,v)=>h&&oy===b.type?(0,ry.jsx)(y_e,{searchTerm:t,buttonText:u,onClick:()=>o(b),itemProps:n(b,v),isSelected:v===s},b.type):oy===b.type?null:(0,ry.jsx)(x_e,{itemProps:n(b,v),suggestion:b,index:v,onClick:()=>{o(b)},isSelected:v===s,isURL:h_.includes(b.type),searchTerm:t,shouldShowType:m,isFrontPage:b?.isFrontPage,isBlogHome:b?.isBlogHome},`${b.id}-${b.type}`))})})})}var B_e=R_e,P_e=e=>((0,T_e.default)("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,ry.jsx)(R_e,{...e}));var I_e=c(F(),1),O_e=c(Q(),1);var kN=c(Fs(),1);function ME(e){let t=e?.trim();if(!t)return{url:t,type:SN};let o=SN,r=(0,kN.getProtocol)(t)||"";return r.includes("mailto")?o=uW:r.includes("tel")?o=cW:t?.startsWith("#")&&(o=dW),Kh(t)||Yh(t)||t.startsWith("?")||r?{url:t,type:o}:{url:(0,kN.prependHTTPS)(t),type:o}}var T$e=()=>Promise.resolve([]),R$e=e=>{let{url:t,type:o}=ME(e);return Promise.resolve([{id:e,title:e,url:t,type:o}])},B$e=async(e,t,o,r,n,i)=>{let{isInitialSuggestions:s}=t,a=await o(e,t);return a.map(l=>Number(l.id)===n?(l.isFrontPage=!0,l):(Number(l.id)===i&&(l.isBlogHome=!0),l)),s||qh(e)||!r?a:a.concat({title:e,url:e,type:oy})};function A_e(e,t,o){let{fetchSearchSuggestions:r,pageOnFront:n,pageForPosts:i}=(0,O_e.useSelect)(a=>{let{getSettings:l}=a(C);return{pageOnFront:l().pageOnFront,pageForPosts:l().pageForPosts,fetchSearchSuggestions:l().__experimentalFetchLinkSuggestions}},[]),s=t?R$e:T$e;return(0,I_e.useCallback)((a,{isInitialSuggestions:l})=>qh(a)?s(a,{isInitialSuggestions:l}):B$e(a,{...e,isInitialSuggestions:l},r,o,n,i),[s,r,n,i,e,o])}var g_=c(E(),1),P$e=()=>Promise.resolve([]),pW=()=>{},M_e=(0,_N.forwardRef)(({value:e,children:t,currentLink:o={},className:r=null,placeholder:n=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=pW,onChange:a=pW,onSelect:l=pW,showSuggestions:u=!0,renderSuggestions:d=x=>(0,g_.jsx)(B_e,{...x}),fetchSuggestions:f=null,allowDirectEntry:p=!0,showInitialSuggestions:h=!1,suggestionsQuery:m={},withURLSuggestion:g=!0,createSuggestionButtonText:b,hideLabelFromVision:v=!1,suffix:y,isEntity:k=!1,customValidity:S},_)=>{let x=A_e(m,p,i,g),w=u?f||x:P$e,[T,B]=(0,_N.useState)(),R=(N,z)=>{a(N),B(z)},I=N=>d({...N,withCreateSuggestion:i,createSuggestionButtonText:b,suggestionsQuery:m,handleSuggestionClick:z=>{N.handleSuggestionClick&&N.handleSuggestionClick(z),A(z)}}),A=async N=>{let z=N;if(oy===N.type){try{z=await s(N.title),z?.url&&l(z)}catch{}return}if(p||z&&Object.keys(z).length>=1){let{id:V,url:M,kind:D,type:L,...j}=o??{};l({...j,...z},z)}},P=n??(0,mW.__)("Search or type URL"),O=v&&n!==""?P:(0,mW.__)("Link");return(0,g_.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,g_.jsx)(Qm,{disableSuggestions:o?.url===e,label:O,hideLabelFromVision:v,className:r,value:e,onChange:R,placeholder:P,__experimentalRenderSuggestions:u?I:null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,customValidity:S,required:!1,onSubmit:(N,z)=>{let V=N||T;!V&&!e?.trim()?.length?z.preventDefault():A(V||{url:e})},inputRef:_,suffix:y,disabled:k}),t]})}),N_e=M_e,D_e=e=>((0,L_e.default)("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,g_.jsx)(M_e,{...e}));var Jm=c(G(),1),rn=c(U(),1),H_e=c(fe(),1),CN=c(Fs(),1);var U_e=c(Tt(),1),EN=c(Q(),1),G_e=c(as(),1),W_e=c(dv(),1);var V_e=c(U(),1),{Slot:F_e,Fill:z_e}=(0,V_e.createSlotFill)("BlockEditorLinkControlViewer");var j_e=c(Q(),1),xN=c(F(),1);function I$e(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function O$e(e){let[t,o]=(0,xN.useReducer)(I$e,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,j_e.useSelect)(n=>{let{getSettings:i}=n(C);return{fetchRichUrlData:i().__experimentalFetchRichUrlData}},[]);return(0,xN.useEffect)(()=>{if(e?.length&&r&&typeof AbortController<"u"){o({type:"LOADING"});let n=new window.AbortController,i=n.signal;return r(e,{signal:i}).then(s=>{o({type:"RESOLVED",richData:s})}).catch(()=>{i.aborted||o({type:"ERROR"})}),()=>{n.abort()}}},[e]),t}var wN=O$e;var Ro=c(E(),1),{Badge:A$e}=H(rn.privateApis);function $_e({value:e,onEditClick:t,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:n}){let i=(0,EN.useSelect)(b=>b(W_e.store).get("core","showIconLabels"),[]),s=o?e?.url:null,{richData:a,isFetching:l}=wN(s),u=a&&Object.keys(a).length,d=e&&(0,CN.filterURLForDisplay)((0,CN.safeDecodeURI)(e.url),24)||"",f=!e?.url?.length,p=!f&&(0,U_e.__unstableStripHTML)(e?.entityTitle||a?.title||e?.title||d),h;a?.icon?h=(0,Ro.jsx)("img",{src:a?.icon,alt:""}):f?h=(0,Ro.jsx)(gt,{icon:a4,size:32}):h=(0,Ro.jsx)(gt,{icon:Ux});let{createNotice:m}=(0,EN.useDispatch)(G_e.store),g=(0,H_e.useCopyToClipboard)(e.url,()=>{m("info",(0,Jm.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,Ro.jsx)(rn.Flex,{role:"group","aria-label":(0,Jm.__)("Manage link"),className:K("block-editor-link-control__preview",{"is-current":!0,"is-rich":u,"is-fetching":!!l,"is-preview":!0,"is-error":f,"is-url-title":p===d}),children:(0,Ro.jsxs)(rn.Flex,{gap:0,align:"flex-start",children:[(0,Ro.jsxs)(rn.Flex,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,Jm.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,Ro.jsx)(rn.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,Ro.jsx)("img",{src:e?.image,alt:""})}):(0,Ro.jsx)(rn.Flex,{className:K("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:h}),(0,Ro.jsx)(rn.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,Ro.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,Jm.__)("Link is empty")}):(0,Ro.jsxs)(Ro.Fragment,{children:[(0,Ro.jsx)(rn.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,Ro.jsx)(rn.__experimentalTruncate,{numberOfLines:1,children:p})}),(0,Ro.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,Ro.jsx)(rn.__experimentalTruncate,{numberOfLines:1,children:d})}),e?.badges?.length>0&&(0,Ro.jsx)(rn.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((b,v)=>(0,Ro.jsx)(A$e,{intent:b.intent,children:b.label},`${b.label}|${b.intent}|${v}`))})]})})]}),(0,Ro.jsx)(rn.Button,{icon:ug,label:(0,Jm.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),r&&(0,Ro.jsx)(rn.Button,{icon:is,label:(0,Jm.__)("Remove link"),onClick:n,size:"compact",showTooltip:!i}),(0,Ro.jsx)(rn.Button,{icon:c3,label:(0,Jm.__)("Copy link"),ref:g,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!i}),(0,Ro.jsx)(F_e,{fillProps:e})]})})}var K_e=c(G(),1),Y_e=c(U(),1);var ny=c(E(),1),L$e=()=>{},M$e=({value:e,onChange:t=L$e,settings:o})=>{if(!o||!o.length)return null;let r=i=>s=>{t({...e,[i.id]:s})},n=o.map(i=>{if("render"in i){if(typeof i.render=="function"){let s=i.render(i,e,t);return(0,ny.jsx)("div",{className:"block-editor-link-control__setting",children:s},i.id)}return null}return(0,ny.jsx)(Y_e.CheckboxControl,{className:"block-editor-link-control__setting",label:i.title,onChange:r(i),checked:e?!!e[i.id]:!1,help:i?.help},i.id)}).filter(Boolean);return(0,ny.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,ny.jsx)(bt,{render:(0,ny.jsx)("legend",{}),children:(0,K_e.__)("Currently selected link settings")}),n]})},q_e=M$e;var Z_e=c(G(),1),iy=c(F(),1);function X_e(e){let t=(0,iy.useRef)(),[o,r]=(0,iy.useState)(!1),[n,i]=(0,iy.useState)(null),s=async function(a){r(!0),i(null);try{return t.current=N$e(Promise.resolve(e(a))),await t.current.promise}catch(l){if(l&&l.isCanceled)return;throw i(l.message||(0,Z_e.__)("An unknown error occurred during creation. Please try again.")),l}finally{r(!1)}};return(0,iy.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:s,isCreatingPage:o,errorMessage:n}}var N$e=e=>{let t=!1;return{promise:new Promise((r,n)=>{e.then(i=>t?n({isCanceled:!0}):r(i),i=>n(t?{isCanceled:!0}:i))}),cancel(){t=!0}}};var hW=c(F(),1),exe=c(J_e(),1);function txe(e){let[t,o]=(0,hW.useState)(e||{}),[r,n]=(0,hW.useState)(e);return(0,exe.default)(e,r)||(n(e),o(e)),[t,o,l=>{o({...t,url:l})},l=>{o({...t,title:l})},l=>u=>{let d=Object.keys(u).reduce((f,p)=>(l.includes(p)&&(f[p]=u[p]),f),{});o({...t,...d})}]}var zo=c(E(),1),bW=()=>{},oxe="core/block-editor",rxe="linkControlSettingsDrawer";function sy({searchInputPlaceholder:e,value:t,settings:o=fW,onChange:r=bW,onInputChange:n,onRemove:i,onCancel:s,noDirectEntry:a=!1,showSuggestions:l=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:f,withCreateSuggestion:p,inputValue:h="",suggestionsQuery:m={},noURLSuggestion:g=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:y=!1,renderControlBottom:k=null,handleEntities:S=!1}){p===void 0&&f&&(p=!0);let[_,x]=(0,wr.useState)(!1),[w,T]=(0,wr.useState)(void 0),{advancedSettingsPreference:B}=(0,RN.useSelect)(de=>({advancedSettingsPreference:de(gW.store).get(oxe,rxe)??!1}),[]),{set:R}=(0,RN.useDispatch)(gW.store),I=de=>{R&&R(oxe,rxe,de),x(de)},A=B||_,P=(0,wr.useRef)(!0),O=(0,wr.useRef)(),N=(0,TN.useMergeRefs)([O,wv()]),z=(0,wr.useRef)(),V=(0,wr.useRef)(),M=(0,wr.useRef)(),D=o.map(({id:de})=>de),[L,j,q,J,te]=txe(t),ee=de=>{q(de),n?.(de)},$=S&&!!L?.id,W=(0,TN.useInstanceId)(sy,"link-control"),Y=$?`${W}__help`:null,Z=t&&!(0,sxe.isShallowEqualObjects)(L,t),[oe,ne]=(0,wr.useState)(d!==void 0?d:!t||!t.url),{createPage:X,isCreatingPage:re,errorMessage:ae}=X_e(f);(0,wr.useEffect)(()=>{d!==void 0&&ne(d)},[d]),(0,wr.useEffect)(()=>{if(P.current)return;(nxe.focus.focusable.find(O.current)[0]||O.current).focus()},[oe,re]),(0,wr.useEffect)(()=>(P.current=!1,()=>{P.current=!0}),[]);let ve=(0,wr.useRef)();(0,wr.useEffect)(()=>{if(ve.current===void 0){ve.current=h;return}ve.current!==h&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),ve.current=h)},[h]),(0,wr.useEffect)(()=>{if(w?.type==="invalid"){let de=V.current;de&&typeof de.reportValidity=="function"&&de.reportValidity()}},[w]);let xe=t?.url?.trim()?.length>0,ge=()=>{ne(!1)},be=de=>{let Me={type:"invalid",message:(0,wc.__)("Please enter a valid URL.")},Ze={type:"valid"},ze=de?.trim();if(!ze?.length||!qh(ze))return Me;if(Kh(ze)||Yh(ze))return Ze;let Je=(0,BN.prependHTTPS)(ze);return(0,BN.isURL)(Je)?Ze:Me},he=de=>{if(!(de&&de.id&&de.type&&!h_.includes(de.type))){let ze=de?.url||qe,Je=be(ze);if(Je.type==="invalid"){T(Je);return}let{url:lt}=ME(ze);de={...de,url:lt}}de?.kind==="taxonomy"&&de?.url&&(M.current=de.url);let Ze=Object.keys(de).reduce((ze,Je)=>(D.includes(Je)||(ze[Je]=de[Je]),ze),{});r({...L,...Ze,title:L?.title||de?.title}),T(void 0),ge()},ke=()=>{if(pt)return!1;let de=qe.trim(),Me=L&&L.id&&L.type&&!h_.includes(L.type),Ze=t?.url===de;if(Me&&Ze)return T(void 0),!0;let ze=be(qe);return ze.type==="invalid"?(T(ze),!1):(T(void 0),!0)},_e=()=>{Z&&r({...t,...L,url:ME(qe).url}),ge(),T(void 0)},we=()=>{ke()&&_e()},Re=de=>{let{keyCode:Me}=de;Me===ixe.ENTER&&!pt&&(de.preventDefault(),we())},se=()=>{j(t)},ie=de=>{de.preventDefault(),de.stopPropagation(),se(),T(void 0),xe?ge():i?.(),s?.()},[Ae,ye]=(0,wr.useState)(!1),Ee=()=>{let{id:de,kind:Me,type:Ze,...ze}=L;j({...ze,id:void 0,kind:void 0,type:void 0,url:void 0}),ye(!0)};(0,wr.useEffect)(()=>{Ae&&(V.current?.focus(),ye(!1))},[Ae]);let qe=L?.url!==void 0?L.url:h||"",pt=!qe?.trim()?.length;(0,wr.useEffect)(()=>{T(void 0)},[qe]);let at=!w,Ct=i&&t&&!oe&&!re,rt=oe&&xe,Ot=xe&&y,ut=(oe||!t)&&!re,Gt=pt||!at||t&&!Z,So=!!o?.length&&oe&&xe,mo=(0,wr.useMemo)(()=>t?.kind==="taxonomy"&&!t?.url&&M.current?{...t,url:M.current}:t,[t]);return(0,zo.jsxs)("div",{tabIndex:-1,ref:N,className:"block-editor-link-control",children:[re&&(0,zo.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,zo.jsx)(Ki.Spinner,{})," ",(0,wc.__)("Creating"),"\u2026"]}),ut&&(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsxs)("div",{className:K({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Ot,"has-actions":rt}),children:[Ot&&(0,zo.jsx)(Ki.TextControl,{ref:z,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,wc.__)("Text"),value:L?.title,onChange:J,onKeyDown:Re}),(0,zo.jsx)(N_e,{ref:V,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:qe,withCreateSuggestion:p,onCreateSuggestion:X,onChange:ee,onSelect:he,showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:l,suggestionsQuery:m,withURLSuggestion:!g,createSuggestionButtonText:b,hideLabelFromVision:!Ot,isEntity:$,customValidity:w,suffix:(0,zo.jsx)(D$e,{isEntity:$,showActions:rt,isDisabled:Gt,onUnlink:Ee,onSubmit:we,helpTextId:Y})}),$&&Y&&(0,zo.jsx)("p",{id:Y,className:"block-editor-link-control__help",children:(0,wc.sprintf)((0,wc.__)("Synced with the selected %s."),L?.type||"item")})]}),ae&&(0,zo.jsx)(Ki.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ae})]}),t&&!oe&&!re&&(0,zo.jsx)($_e,{value:mo,onEditClick:()=>ne(!0),hasRichPreviews:v,hasUnlinkControl:Ct,onRemove:()=>{i(),ne(!0)}},mo?.url),So&&(0,zo.jsx)("div",{className:"block-editor-link-control__tools",children:!pt&&(0,zo.jsx)(h_e,{settingsOpen:A,setSettingsOpen:I,children:(0,zo.jsx)(q_e,{value:L,settings:o,onChange:te(D)})})}),rt&&(0,zo.jsxs)(Ki.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,zo.jsx)(Ki.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:ie,children:(0,wc.__)("Cancel")}),(0,zo.jsx)(Ki.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:Gt?bW:we,className:"block-editor-link-control__search-submit","aria-disabled":Gt,children:(0,wc.__)("Apply")})]}),!re&&k&&k()]})}function D$e({isEntity:e,showActions:t,isDisabled:o,onUnlink:r,onSubmit:n,helpTextId:i}){if(e)return(0,zo.jsx)(Ki.Button,{icon:is,onClick:r,"aria-describedby":i,showTooltip:!0,label:(0,wc.__)("Unsync and edit"),__next40pxDefaultSize:!0});if(!t)return(0,zo.jsx)(Ki.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,zo.jsx)(Ki.Button,{onClick:o?bW:n,label:(0,wc.__)("Submit"),icon:sd,className:"block-editor-link-control__search-submit","aria-disabled":o,size:"small"})})}sy.ViewerFill=z_e;sy.DEFAULT_LINK_SETTINGS=fW;var PN=e=>((0,axe.default)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,zo.jsx)(sy,{...e}));PN.ViewerFill=sy.ViewerFill;PN.DEFAULT_LINK_SETTINGS=sy.DEFAULT_LINK_SETTINGS;var eh=sy;var cxe=c(G(),1),uxe=c(U(),1);var NE=1.5,yW=.01,vW=10,SW="";function lxe(e){return e!==void 0&&e!==SW}var kW=c(E(),1),V$e=({__next40pxDefaultSize:e,value:t,onChange:o,__unstableInputWidth:r="60px",...n})=>{let i=lxe(t),s=(d,f)=>{if(i)return d;let p=yW*vW;switch(`${d}`){case`${p}`:return NE+p;case"0":return f?d:NE-p;case"":return NE;default:return d}},a=(d,f)=>{let p=["insertText","insertFromPaste"].includes(f.payload.event.nativeEvent?.inputType),h=s(d.value,p);return{...d,value:h}},l=i?t:SW;return(0,kW.jsx)("div",{className:"block-editor-line-height-control",children:(0,kW.jsx)(uxe.__experimentalNumberControl,{placeholder:NE,...n,__unstableInputWidth:r,__unstableStateReducer:a,onChange:(d,{event:f})=>{if(d===""){o();return}if(f.type==="click"){o(s(`${d}`,!1));return}o(`${d}`)},label:(0,cxe.__)("Line height"),step:yW,spinFactor:vW,value:l,min:0,spinControls:"custom"})})},IN=V$e;var Iu=c(G(),1),dxe=c(Qr(),1),Yi=c(U(),1),AN=c(Q(),1),fxe=c(io(),1);var pxe=c(fe(),1),mxe=c(Tt(),1),hxe=c(as(),1),gxe=c(F(),1);function ON(e,t,o){if(o)return o;if(!t||typeof t!="object"||Object.keys(t).length===0)return e&&e.length>0?e.map(n=>`${n}/*`).join(","):void 0;if(!e||e.length===0)return;let r=[];for(let[,n]of Object.entries(t))e.some(s=>s.includes("/")?n===s:n.startsWith(`${s}/`))&&r.push(n);return r.length>0?r.join(","):e.map(n=>`${n}/*`).join(",")}var Ln=c(E(),1),F$e=()=>{},z$e=0,j$e=({mediaURL:e,mediaId:t,mediaIds:o,allowedTypes:r,accept:n,onError:i,onSelect:s,onSelectURL:a,onReset:l,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=F$e,name:p=(0,Iu.__)("Replace"),createNotice:h,removeNotice:m,children:g,multiple:b=!1,addToGallery:v,handleUpload:y=!0,variant:k,popoverProps:S,renderToggle:_,className:x})=>{let{mediaUpload:w,allowedMimeTypes:T}=(0,AN.useSelect)(M=>{let{getSettings:D}=M(C),L=D();return{mediaUpload:L.mediaUpload,allowedMimeTypes:L.allowedMimeTypes}},[]),B=`block-editor/media-replace-flow/error-notice/${++z$e}`,R=(0,gxe.useMemo)(()=>ON(r,T,n),[r,T,n]),I=M=>{let D=(0,mxe.__unstableStripHTML)(M);if(i){i(D);return}setTimeout(()=>{h("error",D,{speak:!0,id:B,isDismissible:!0})},1e3)},A=(M,D)=>{d&&u&&u(),D(),s(M),(0,dxe.speak)((0,Iu.__)("The media file has been replaced")),m(B)},P=(M,D)=>{let L=M.target.files;if(!y)return D(),s(L);f(L),w({allowedTypes:r,filesList:L,onFileChange:([j])=>{A(j,D)},onError:I})},O=M=>{M.keyCode===fxe.DOWN&&(M.preventDefault(),M.target.click())},z=b&&(!r||r.length===0?!1:r.every(M=>M==="image"||M.startsWith("image/"))),V={...S,variant:k};return(0,Ln.jsx)(Yi.Dropdown,{popoverProps:V,className:x,contentClassName:K("block-editor-media-replace-flow__options",k&&`is-variant-${k}`),renderToggle:({isOpen:M,onToggle:D})=>_?_({"aria-expanded":M,"aria-haspopup":"true",onClick:D,onKeyDown:O,children:p}):(0,Ln.jsx)(Yi.ToolbarButton,{"aria-expanded":M,"aria-haspopup":"true",onClick:D,onKeyDown:O,children:p}),renderContent:({onClose:M})=>(0,Ln.jsxs)(Ln.Fragment,{children:[(0,Ln.jsxs)(Yi.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Ln.jsxs)(Xs,{children:[(0,Ln.jsx)(yu,{gallery:z,addToGallery:v,multiple:b,value:b?o:t,onSelect:D=>A(D,M),allowedTypes:r,render:({open:D})=>(0,Ln.jsx)(Yi.MenuItem,{icon:Qy,onClick:D,children:(0,Iu.__)("Open Media Library")})}),(0,Ln.jsx)(Yi.FormFileUpload,{onChange:D=>{P(D,M)},accept:R,multiple:!!b,render:({openFileDialog:D})=>(0,Ln.jsx)(Yi.MenuItem,{icon:A6,onClick:()=>{D()},children:(0,Iu._x)("Upload","verb")})})]}),u&&(0,Ln.jsx)(Yi.MenuItem,{icon:G4,onClick:u,isPressed:d,children:(0,Iu.__)("Use featured image")}),typeof g=="function"?g({onClose:M}):g,e&&l&&(0,Ln.jsx)(Yi.MenuItem,{onClick:()=>{l(),M()},children:(0,Iu.__)("Reset")})]}),a&&(0,Ln.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,Ln.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Iu.__)("Current media URL:")}),(0,Ln.jsx)(eh,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:D})=>{a(D)},searchInputPlaceholder:(0,Iu.__)("Paste or type URL")})]})]})})},b_=(0,pxe.compose)([(0,AN.withDispatch)(e=>{let{createNotice:t,removeNotice:o}=e(hxe.store);return{createNotice:t,removeNotice:o}}),(0,Yi.withFilters)("editor.MediaReplaceFlow")])(j$e);var Yr=c(U(),1),Kr=c(G(),1),nh=c(F(),1),Pxe=c(Q(),1);var Ixe=c(Rt(),1);var xW=c(G(),1),MN=c(F(),1),y_=c(U(),1);var Bxe=c(Rt(),1);var vxe=c(G(),1),Sxe=c(U(),1);var bxe=c(U(),1),LN=c(Fs(),1),_W=c(E(),1);function yxe({url:e,urlLabel:t,className:o}){let r=K(o,"block-editor-url-popover__link-viewer-url");return e?(0,_W.jsx)(bxe.ExternalLink,{className:r,href:e,children:t||(0,LN.filterURLForDisplay)((0,LN.safeDecodeURI)(e))}):(0,_W.jsx)("span",{className:r})}var DE=c(E(),1);function kxe({className:e,linkClassName:t,onEditLinkClick:o,url:r,urlLabel:n,...i}){return(0,DE.jsxs)("div",{className:K("block-editor-url-popover__link-viewer",e),...i,children:[(0,DE.jsx)(yxe,{url:r,urlLabel:n,className:t}),o&&(0,DE.jsx)(Sxe.Button,{icon:ug,label:(0,vxe.__)("Edit"),onClick:o,size:"compact"})]})}var Exe=c(G(),1),Txe=c(U(),1);var bf=c(G(),1),VE=c(F(),1),Cc=c(io(),1),Es=c(U(),1),th=c(fe(),1),_xe=c(Q(),1),xxe=c(Fs(),1);var Ou=c(E(),1),wxe=c(ce(),1),{ValidatedInputControl:H$e}=H(Es.privateApis);function Cxe(e){return typeof e=="function"}var U$e=class extends VE.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,VE.createRef)(),this.inputRef=e.inputRef||(0,VE.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,th.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){let{showSuggestions:t,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:n=!1}=this.props;t&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):n&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){let{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){let{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:o}=this.props;if(!t)return;let r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!o&&(0,xxe.isURL)(e))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});let n=t(e,{isInitialSuggestions:r});n.then(i=>{this.suggestionsRequest===n&&(this.setState({suggestions:i,suggestionsValue:e,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak((0,bf.sprintf)((0,bf._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak((0,bf.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===n&&(this.suggestionsRequest=null)}),this.suggestionsRequest=n}onChange(e){this.props.onChange(e)}onFocus(){let{suggestions:e}=this.state,{disableSuggestions:t,value:o}=this.props;o&&!t&&!(e&&e.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(e){this.props.onKeyDown?.(e);let{showSuggestions:t,selectedSuggestion:o,suggestions:r,loading:n}=this.state;if(!t||!r.length||n){switch(e.keyCode){case Cc.UP:{e.target.selectionStart!==0&&(e.preventDefault(),e.target.setSelectionRange(0,0));break}case Cc.DOWN:{this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Cc.ENTER:{this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e));break}}return}let i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Cc.UP:{e.preventDefault();let s=o?o-1:r.length-1;this.setState({selectedSuggestion:s});break}case Cc.DOWN:{e.preventDefault();let s=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:s});break}case Cc.TAB:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak((0,bf.__)("Link selected.")));break}case Cc.ENTER:{e.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e);break}}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:n}){let i=n,s=e&&e.length;return!r&&!s&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Ou.jsxs)(Ou.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){let{label:e=null,className:t,isFullWidth:o,instanceId:r,placeholder:n=(0,bf.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:a=!1,help:l=null,disabled:u=!1,customValidity:d,markWhenOptional:f}=this.props,{loading:p,showSuggestions:h,selectedSuggestion:m,suggestionsListboxId:g,suggestionOptionIdPrefix:b}=this.state,v=`url-input-control-${r}`,y={id:v,label:e,className:K("block-editor-url-input",t,{"is-full-width":o}),hideLabelFromVision:a},k={id:v,value:s,required:this.props.required??!0,type:"text",name:v,autoComplete:"off",onChange:u?()=>{}:this.onChange,onFocus:u?()=>{}:this.onFocus,placeholder:n,onKeyDown:u?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,bf.__)("URL"),"aria-expanded":h,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":m!==null?`${b}-${m}`:void 0,ref:this.inputRef,disabled:u,suffix:this.props.suffix,help:l},S={customValidity:d,...f!==void 0&&{markWhenOptional:f}};if(i)return i(y,k,p);d!==void 0&&(this.hasRenderedValidation.current=!0);let _=this.hasRenderedValidation.current?H$e:Es.__experimentalInputControl;return(0,Ou.jsxs)(Es.BaseControl,{...y,children:[(0,Ou.jsx)(_,{...k,...this.hasRenderedValidation.current?S:{},__next40pxDefaultSize:!0}),p&&(0,Ou.jsx)(Es.Spinner,{})]})}renderSuggestions(){let{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:n,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!o||r.length===0)return null;let u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(f,p)=>({role:"option",tabIndex:"-1",id:`${a}-${p}`,ref:this.bindSuggestionNode(p),"aria-selected":p===i?!0:void 0});return Cxe(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!n?.length,currentInputValue:n}):(0,Ou.jsx)(Es.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Ou.jsx)("div",{...u,className:K("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:r.map((f,p)=>(0,wxe.createElement)(Es.Button,{__next40pxDefaultSize:!0,...d(f,p),key:f.id,className:K("block-editor-url-input__suggestion",{"is-selected":p===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}},Qm=(0,th.compose)(th.withSafeTimeout,Es.withSpokenMessages,th.withInstanceId,(0,_xe.withSelect)((e,t)=>{if(Cxe(t.__experimentalFetchLinkSuggestions))return;let{getSettings:o}=e(C);return{__experimentalFetchLinkSuggestions:o().__experimentalFetchLinkSuggestions}}))(U$e);var FE=c(E(),1);function Rxe({autocompleteRef:e,className:t,onChangeInputValue:o,value:r,...n}){return(0,FE.jsxs)("form",{className:K("block-editor-url-popover__link-editor",t),...n,children:[(0,FE.jsx)(Qm,{value:r,onChange:o,autocompleteRef:e}),(0,FE.jsx)(Txe.Button,{icon:sd,label:(0,Exe.__)("Apply"),type:"submit",size:"compact"})]})}var oh=c(E(),1),{__experimentalPopoverLegacyPositionToPlacement:G$e}=H(y_.privateApis),W$e="bottom",wW=(0,MN.forwardRef)(({additionalControls:e,children:t,renderSettings:o,placement:r,focusOnMount:n="firstElement",position:i,...s},a)=>{i!==void 0&&(0,Bxe.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let l;r!==void 0?l=r:i!==void 0&&(l=G$e(i)),l=l||W$e;let[u,d]=(0,MN.useState)(!1),f=!!o&&u,p=()=>{d(!u)};return(0,oh.jsxs)(y_.Popover,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,xW.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:n,placement:l,shift:!0,variant:"toolbar",...s,children:[(0,oh.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,oh.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!o&&(0,oh.jsx)(y_.Button,{className:"block-editor-url-popover__settings-toggle",icon:cn,label:(0,xW.__)("Link settings"),onClick:p,"aria-expanded":u,size:"compact"})]})}),f&&(0,oh.jsx)("div",{className:"block-editor-url-popover__settings",children:o()}),e&&!f&&(0,oh.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});wW.LinkEditor=Rxe;wW.LinkViewer=kxe;var rh=wW;var Zt=c(E(),1),$$e=()=>{},K$e=({src:e,onChange:t,onSubmit:o,onClose:r,popoverAnchor:n})=>(0,Zt.jsx)(rh,{anchor:n,onClose:r,children:(0,Zt.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o,children:(0,Zt.jsx)(Yr.__experimentalInputControl,{label:(0,Kr.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,Kr.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Zt.jsx)(Yr.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Zt.jsx)(Yr.Button,{size:"small",icon:sd,label:(0,Kr.__)("Apply"),type:"submit"})})})})}),Y$e=({src:e,onChangeSrc:t,onSelectURL:o})=>{let[r,n]=(0,nh.useState)(null),[i,s]=(0,nh.useState)(!1),a=()=>{s(!0)},l=()=>{s(!1),r?.focus()},u=d=>{d.preventDefault(),e&&o&&(o(e),l())};return(0,Zt.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:a,isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:n,children:(0,Kr.__)("Insert from URL")}),i&&(0,Zt.jsx)(K$e,{src:e,onChange:t,onSubmit:u,onClose:l,popoverAnchor:r})]})};function q$e({value:e={},allowedTypes:t,className:o,icon:r,labels:n={},mediaPreview:i,notices:s,isAppender:a,accept:l,addToGallery:u,multiple:d=!1,handleUpload:f=!0,disableDropZone:p,disableMediaButtons:h,onError:m,onSelect:g,onCancel:b,onSelectURL:v,onToggleFeaturedImage:y,onDoubleClick:k,onFilesPreUpload:S=$$e,onHTMLDrop:_,children:x,mediaLibraryButton:w,placeholder:T,style:B}){_&&(0,Ixe.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});let{mediaUpload:R,allowedMimeTypes:I}=(0,Pxe.useSelect)($=>{let{getSettings:W}=$(C),Y=W();return{mediaUpload:Y.mediaUpload,allowedMimeTypes:Y.allowedMimeTypes}},[]),[A,P]=(0,nh.useState)("");(0,nh.useEffect)(()=>{P(e?.src??"")},[e?.src]);let O=(0,nh.useMemo)(()=>ON(t,I,l),[t,I,l]),N=()=>!t||t.length===0?!1:t.every($=>$==="image"||$.startsWith("image/")),z=$=>{if(!f||typeof f=="function"&&!f($))return g($);S($);let W;if(d)if(u){let Y=[];W=Z=>{let oe=(e??[]).filter(ne=>ne.id?!Y.some(({id:X})=>Number(X)===Number(ne.id)):!Y.some(({urlSlug:X})=>ne.url.includes(X)));g(oe.concat(Z)),Y=Z.map(ne=>{let X=ne.url.lastIndexOf("."),re=ne.url.slice(0,X);return{id:ne.id,urlSlug:re}})}}else W=g;else W=([Y])=>g(Y);R({allowedTypes:t,filesList:$,onFileChange:W,onError:m,multiple:d})};async function V($){let{blocks:W}=b9($);if(!W?.length)return;let Y=await Promise.all(W.map(Z=>{let oe=Z.name.split("/")[1];return Z.attributes.id?(Z.attributes.type=oe,Z.attributes):new Promise((ne,X)=>{window.fetch(Z.attributes.url).then(re=>re.blob()).then(re=>R({filesList:[re],additionalData:{title:Z.attributes.title,alt_text:Z.attributes.alt,caption:Z.attributes.caption,type:oe},onFileChange:([ae])=>{ae.id&&ne(ae)},allowedTypes:t,onError:X})).catch(()=>ne(Z.attributes.url))})})).catch(Z=>m(Z));Y?.length&&g(d?Y:Y[0])}let M=$=>{z($.target.files)},L=T??($=>{let{instructions:W,title:Y}=n;if(!R&&!v&&(W=(0,Kr.__)("To edit this block, you need permission to upload media.")),W===void 0||Y===void 0){let oe=t??[],[ne]=oe,X=oe.length===1,re=X&&ne==="audio",ae=X&&ne==="image",ve=X&&ne==="video";W===void 0&&R&&(W=(0,Kr.__)("Drag and drop an image or video, upload, or choose from your library."),re?W=(0,Kr.__)("Drag and drop an audio file, upload, or choose from your library."):ae?W=(0,Kr.__)("Drag and drop an image, upload, or choose from your library."):ve&&(W=(0,Kr.__)("Drag and drop a video, upload, or choose from your library."))),Y===void 0&&(Y=(0,Kr.__)("Media"),re?Y=(0,Kr.__)("Audio"):ae?Y=(0,Kr.__)("Image"):ve&&(Y=(0,Kr.__)("Video")))}let Z=K("block-editor-media-placeholder",o,{"is-appender":a});return(0,Zt.jsxs)(Yr.Placeholder,{icon:r,label:Y,instructions:W,className:Z,notices:s,onDoubleClick:k,preview:i,style:B,children:[$,x]})}),j=()=>p?null:(0,Zt.jsx)(Yr.DropZone,{onFilesDrop:z,onDrop:V,isEligible:$=>{let W="wp-block:core/",Y=[];for(let Z of $.types)Z.startsWith(W)&&Y.push(Z.slice(W.length));return Y.every(Z=>t.includes(Z))&&(d?!0:Y.length===1)}}),q=()=>b&&(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,Kr.__)("Cancel"),variant:"link",onClick:b,children:(0,Kr.__)("Cancel")}),J=()=>v&&(0,Zt.jsx)(Y$e,{src:A,onChangeSrc:P,onSelectURL:v}),te=()=>y&&(0,Zt.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,Kr.__)("Use featured image")})}),ee=()=>{let W=w??(({open:Z})=>(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{Z()},children:(0,Kr.__)("Media Library")})),Y=(0,Zt.jsx)(yu,{addToGallery:u,gallery:d&&N(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:Z})=>Z):e.id,render:W});if(R&&a)return(0,Zt.jsxs)(Zt.Fragment,{children:[j(),(0,Zt.jsx)(Yr.FormFileUpload,{onChange:M,accept:O,multiple:!!d,render:({openFileDialog:Z})=>{let oe=(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,variant:"primary",className:K("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:Z,children:(0,Kr._x)("Upload","verb")}),Y,J(),te(),q()]});return L(oe)}})]});if(R){let Z=(0,Zt.jsxs)(Zt.Fragment,{children:[j(),(0,Zt.jsx)(Yr.FormFileUpload,{render:({openFileDialog:oe})=>(0,Zt.jsx)(Yr.Button,{__next40pxDefaultSize:!0,onClick:oe,variant:"primary",className:K("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,Kr._x)("Upload","verb")}),onChange:M,accept:O,multiple:!!d}),Y,J(),te(),q()]});return L(Z)}return L(Y)};return h?(0,Zt.jsx)(Xs,{children:j()}):(0,Zt.jsx)(Xs,{fallback:L(J()),children:ee()})}var Oxe=(0,Yr.withFilters)("editor.MediaPlaceholder")(q$e);var Axe=c(E(),1),Z$e=({colorSettings:e,...t})=>{let o=e.map(r=>{if(!r)return r;let{value:n,onChange:i,...s}=r;return{...s,colorValue:n,onColorChange:i}});return(0,Axe.jsx)(oN,{settings:o,gradients:[],disableCustomGradients:!0,...t})},Lxe=Z$e;var Vwe=c(Zz(),1);var Fwe=c(F(),1);var Mwe=c(F(),1);var Rwe=c(Xh(),1),Xn=c(F(),1),vf=c(Q(),1),YN=c(fe(),1),Bwe=c(Ko(),1),Pwe=c(U(),1),Iwe=c(ue(),1),Owe=c(Rt(),1),E_=c(G(),1);var Mxe=c(G(),1),NN=c(U(),1);var CW=c(G(),1),ay=c(U(),1);var yf=c(E(),1),X$e={placement:"bottom-start"},Q$e=()=>(0,yf.jsxs)(yf.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,yf.jsx)(ay.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,yf.jsx)(ay.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;let o=e.map(([{props:r}])=>r).some(({isActive:r})=>r);return(0,yf.jsx)(ay.ToolbarItem,{children:r=>(0,yf.jsx)(ay.DropdownMenu,{icon:cn,label:(0,CW.__)("More"),toggleProps:{...r,className:K(r.className,{"is-pressed":o}),description:(0,CW.__)("Displays more block tools")},controls:Kc(e.map(([{props:n}])=>n),"title"),popoverProps:X$e})})}})]}),EW=Q$e;var ih=c(E(),1);function J$e({popoverAnchor:e}){return(0,ih.jsx)(NN.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,ih.jsx)(Bk,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,Mxe.__)("Format tools"),children:(0,ih.jsx)(NN.ToolbarGroup,{children:(0,ih.jsx)(EW,{})})})})}var eKe=({inline:e,editableContentElement:t})=>e?(0,ih.jsx)(J$e,{popoverAnchor:t}):(0,ih.jsx)(No,{group:"inline",children:(0,ih.jsx)(EW,{})}),Nxe=eKe;var DN=c(F(),1),Dxe=c(Q(),1);function Vxe({html:e,value:t}){let o=(0,DN.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:n}=(0,Dxe.useDispatch)(C);(0,DN.useLayoutEffect)(()=>{if(!o.current){o.current=t.text;return}if(o.current!==t.text){let i=window.setTimeout(()=>{n()},1e3);return o.current=t.text,()=>{window.clearTimeout(i)}}n()},[e,r])}var x_=c(F(),1),dwe=c(fe(),1);var ly=c(Ko(),1),Fxe=c(go(),1);var{subscribeOwnedListener:tKe}=H(ly.privateApis),oKe=["`",'"',"'","\u201C\u201D","\u2018\u2019"],zxe=e=>t=>{function o(r){let{inputType:n,data:i}=r,{value:s,onChange:a,registry:l}=e.current;if(n!=="insertText"||(0,ly.isCollapsed)(s))return;let u=(0,Fxe.applyFilters)("blockEditor.wrapSelectionSettings",oKe).find(([_,x])=>_===i||x===i);if(!u)return;let[d,f=d]=u,p=s.start,h=s.end+d.length,m=(0,ly.insert)(s,d,p,p);m=(0,ly.insert)(m,f,h,h);let{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:b}=l.dispatch(C);g(),a(m),b();let v={};for(let _ in r)v[_]=r[_];v.data=f;let{ownerDocument:y}=t,{defaultView:k}=y,S=new k.InputEvent("input",v);window.queueMicrotask(()=>{t.dispatchEvent(S)}),r.preventDefault()}return tKe(t,"beforeinput",o,!0)};var S_=c(Ko(),1),v_=c(ue(),1);var jxe=c(Ko(),1);function Hxe(e){let t="tales of gutenberg",o=" \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F",{start:r,text:n}=e;return rt=>{function o(){let{getValue:s,onReplace:a,selectionChange:l,registry:u}=e.current;if(!a)return;let d=s(),{start:f,text:p}=d;if(p.slice(f-1,f)!==" ")return;let m=p.slice(0,f).trim(),g=(0,v_.getBlockTransforms)("from").filter(({type:k})=>k==="prefix"),b=(0,v_.findTransform)(g,({prefix:k})=>m===k);if(!b)return;let v=(0,S_.toHTMLString)({value:(0,S_.insert)(d,hd,0,f)}),y=b.transform(v);return l(...Gxe([y])),a([y]),u.dispatch(C).__unstableMarkAutomaticChange(),!0}function r(s){let{inputType:a,type:l}=s,{getValue:u,onChange:d,__unstableAllowPrefixTransformations:f,formatTypes:p,registry:h,onReplace:m}=e.current;if(a!=="insertText"&&l!=="compositionend"||f&&o())return;let g=u(),b=(0,v_.getBlockTransforms)("from").filter(_=>_.type==="input"),v=(0,v_.findTransform)(b,_=>_.regExp.test(g.text));if(v){m(v.transform()),h.dispatch(C).__unstableMarkAutomaticChange();return}let y=p.reduce((_,{__unstableInputRule:x})=>(x&&(_=x(_)),_),Hxe(g)),{__unstableMarkLastChangeAsPersistent:k,__unstableMarkAutomaticChange:S}=h.dispatch(C);y!==g&&(k(),d({...y,activeFormats:g.activeFormats}),S())}let n=Uxe(t,"input",r,!0),i=Uxe(t,"compositionend",r,!0);return()=>{n(),i()}};var $xe=c(Ko(),1);var{subscribeOwnedListener:rKe}=H($xe.privateApis),Kxe=e=>t=>{function o(r){if(r.inputType!=="insertReplacementText")return;let{registry:n}=e.current;n.dispatch(C).__unstableMarkLastChangeAsPersistent()}return rKe(t,"beforeinput",o)};var VN=c(io(),1),Yxe=c(Ko(),1);var{subscribeOwnedListener:nKe}=H(Yxe.privateApis),qxe=()=>e=>{function t(o){(VN.isKeyboardEvent.primary(o,"z")||VN.isKeyboardEvent.primary(o,"y")||VN.isKeyboardEvent.primaryShift(o,"z"))&&o.preventDefault()}return nKe(e,"keydown",t,!0)};var Zxe=c(Ko(),1);var{subscribeOwnedListener:iKe}=H(Zxe.privateApis),Xxe=e=>t=>{let{keyboardShortcuts:o}=e.current;function r(n){for(let i of o.current)i(n)}return iKe(t,"keydown",r,!0)};var Qxe=c(Ko(),1);var{subscribeOwnedListener:sKe}=H(Qxe.privateApis),Jxe=e=>t=>{let{inputEvents:o}=e.current;function r(n){for(let i of o.current)i(n)}return sKe(t,"input",r)};var FN=c(io(),1),ewe=c(Ko(),1);var{subscribeOwnedListener:aKe}=H(ewe.privateApis),twe=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented||n!==FN.BACKSPACE&&n!==FN.ESCAPE)return;let{registry:i}=e.current,{didAutomaticChange:s,getSettings:a}=i.select(C),{__experimentalUndo:l}=a();l&&s()&&(r.preventDefault(),l())}return aKe(t,"keydown",o)};var rwe=c(ue(),1),hl=c(Ko(),1),nwe=c(Fs(),1),iwe=c(fe(),1);var lKe=c(F(),1),cKe=c(ue(),1),uKe=c(E(),1);function owe(e,t){if(t?.length){let o=e.formats.length;for(;o--;)e.formats[o]=[...t,...e.formats[o]||[]]}}function zN(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function k_({allowedFormats:e,disableFormats:t}){return t?k_.EMPTY_ARRAY:e}k_.EMPTY_ARRAY=[];var{subscribeDelegatedListener:dKe}=H(iwe.privateApis),{ownsSelection:fKe}=H(hl.privateApis),swe=e=>t=>{function o(n){let{disableFormats:i,onChange:s,value:a,formatTypes:l,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:f,preserveWhiteSpace:p,pastePlainText:h,registry:m}=e.current;if(!t.contains(n.target)&&!fKe(t)||n.defaultPrevented)return;let{plainText:g,html:b}=TS(n);if(n.preventDefault(),window.console.log(`Received HTML (RichText):`,b),window.console.log(`Received plain text (RichText):`,g),i){s((0,hl.insert)(a,g));return}let v=n.clipboardData.getData("rich-text")==="true";function y(x){let w=l.reduce((T,{__unstablePasteRule:B})=>(B&&T===a&&(T=B(a,{html:b,plainText:g})),T),a);if(w!==a)s(w);else{let T=(0,hl.create)({html:x});owe(T,a.activeFormats),s((0,hl.insert)(a,T))}}if(v){y(b);return}if(h){s((0,hl.insert)(a,(0,hl.create)({text:g})));return}let k="INLINE",S=g.trim();f&&(0,hl.isEmpty)(a)&&(0,nwe.isURL)(S)&&/^https?:/.test(S)&&(k="BLOCKS");let _=(0,rwe.pasteHandler)({HTML:b,plainText:g,mode:k,tagName:u,preserveWhiteSpace:p});if(typeof _=="string"){y(_);return}!_.length||!d||!(0,hl.isEmpty)(a)||(k==="BLOCKS"&&(y(b),m.dispatch(C).__unstableMarkLastChangeAsPersistent()),d(_,_.length-1,-1))}let{defaultView:r}=t.ownerDocument;return dKe(r,"paste",o)};var zE=c(io(),1),__=c(Ko(),1);var{subscribeOwnedListener:pKe}=H(__.privateApis),awe=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented)return;let{value:i,onMerge:s,onRemove:a}=e.current;if(n===zE.DELETE||n===zE.BACKSPACE){let{start:l,end:u,text:d}=i,f=n===zE.BACKSPACE,p=i.activeFormats&&!!i.activeFormats.length;if(!(0,__.isCollapsed)(i)||p||f&&l!==0||!f&&u!==d.length)return;s?s(!f):a&&(0,__.isEmpty)(i)&&f&&a(!f),r.preventDefault()}}return pKe(t,"keydown",o)};var TW=c(io(),1),cy=c(Ko(),1),lwe=c(fe(),1);var{subscribeOwnedListener:mKe,ownsSelection:hKe}=H(cy.privateApis),{subscribeDelegatedListener:gKe}=H(lwe.privateApis),cwe=e=>t=>{function o(a){if(a.keyCode!==TW.ENTER)return;let{onReplace:l,onSplit:u}=e.current;l&&u&&(a.__deprecatedOnSplit=!0)}function r(a){if(a.defaultPrevented||a.target!==t&&!hKe(t)||a.keyCode!==TW.ENTER)return;let{value:l,onChange:u,disableLineBreaks:d,onSplitAtEnd:f,onSplitAtDoubleLineEnd:p,registry:h}=e.current;a.preventDefault();let{text:m,start:g,end:b}=l;a.shiftKey?d||u((0,cy.insert)(l,` `)):f&&g===b&&b===m.length?f():p&&g===b&&b===m.length&&m.slice(-2)===``?h.batch(()=>{let v={...l};v.start=v.end-2,u((0,cy.remove)(v)),p()}):d||u((0,cy.insert)(l,` `))}let{defaultView:n}=t.ownerDocument,i=gKe(n,"keydown",r),s=mKe(t,"keydown",o,!0);return()=>{i(),s()}};var uwe=e=>t=>{function o(){let{registry:r}=e.current;if(!r.select(C).isMultiSelecting())return;let n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}};var bKe=[zxe,Wxe,Kxe,qxe,Xxe,Jxe,twe,swe,awe,cwe,uwe];function jN(e){let t=(0,x_.useRef)(e);(0,x_.useInsertionEffect)(()=>{t.current=e});let o=(0,x_.useMemo)(()=>bKe.map(r=>r(t)),[t]);return(0,dwe.useRefEffect)(r=>{if(!e.isSelected)return;let n=o.map(i=>i(r));return()=>{n.forEach(i=>i())}},[o,e.isSelected])}var HN=c(Ko(),1),UN=c(F(),1);var fwe=c(E(),1),pwe=c(ce(),1),yKe={},RW=Symbol("usesContext");function vKe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a,[RW]:l}=n,u=(0,UN.useContext)(_n),d=(0,UN.useMemo)(()=>l?Object.fromEntries(Object.entries(u).filter(([g])=>l.includes(g))):yKe,[l,u]);if(!a)return null;let f=(0,HN.getActiveFormat)(o,s),p=f!==void 0,h=(0,HN.getActiveObject)(o),m=h!==void 0&&h.type===s;return(0,fwe.jsx)(a,{isActive:p,isVisible:i,activeAttributes:p?f.attributes||{}:{},isObjectActive:m,activeObjectAttributes:m?h.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:d},s)}function GN({formatTypes:e,...t}){return e.map(o=>(0,pwe.createElement)(vKe,{settings:o,...t,key:o.name}))}var mwe=c(F(),1),hwe=c(ue(),1),gwe=c(Rt(),1);var BW=c(E(),1);function PW(e,t){if(w_.isEmpty(e)){let o=zN(t);return o?`<${o}>`:""}return Array.isArray(e)?((0,gwe.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),hwe.children.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function jE({value:e,tagName:t,multiline:o,format:r,...n}){return e=(0,BW.jsx)(mwe.RawHTML,{children:PW(e,o)}),t?(0,BW.jsx)(t,{...n,children:e}):e}var kwe=c(F(),1),OW=c(ue(),1),_we=c(Ko(),1),xwe=c(Rt(),1);var bwe=c(F(),1),ywe=c(Rt(),1),WN=c(Q(),1),vwe=c(io(),1),C_=c(Ko(),1);var IW=c(E(),1);function SKe({children:e,identifier:t,tagName:o="div",value:r="",onChange:n,multiline:i,...s},a){(0,ywe.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});let{clientId:l}=ht(),{getSelectionStart:u,getSelectionEnd:d}=(0,WN.useSelect)(C),{selectionChange:f}=(0,WN.useDispatch)(C),p=zN(i);r=r||`<${p}>`;let m=`${r}<${p}>`.split(`<${p}>`);m.shift(),m.pop();function g(b){n(`<${p}>${b.join(`<${p}>`)}`)}return(0,IW.jsx)(o,{ref:a,children:m.map((b,v)=>(0,IW.jsx)($N,{identifier:`${t}-${v}`,tagName:p,value:b,onChange:y=>{let k=m.slice();k[v]=y,g(k)},isSelected:void 0,onKeyDown:y=>{if(y.keyCode!==vwe.ENTER)return;y.preventDefault();let{offset:k}=u(),{offset:S}=d();if(typeof k!="number"||typeof S!="number")return;let _=(0,C_.create)({html:b});_.start=k,_.end=S;let x=(0,C_.split)(_).map(T=>(0,C_.toHTMLString)({value:T})),w=m.slice();w.splice(v,1,...x),g(w),f(l,`${t}-${v+1}`,0,0)},onMerge:y=>{let k=m.slice(),S=0;if(y){if(!k[v+1])return;k.splice(v,2,k[v]+k[v+1]),S=k[v].length-1}else{if(!k[v-1])return;k.splice(v-1,2,k[v-1]+k[v]),S=k[v-1].length-1}g(k),f(l,`${t}-${v-(y?0:1)}`,S,S)},...s},v))})}var Swe=(0,bwe.forwardRef)(SKe);var wwe=c(E(),1);function Cwe(e){return(0,kwe.forwardRef)((t,o)=>{let r=t.value,n=t.onChange;Array.isArray(r)&&((0,xwe.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),r=OW.children.toHTML(t.value),n=s=>t.onChange(OW.children.fromDOM((0,_we.__unstableCreateElement)(document,s).childNodes)));let i=t.multiline?Swe:e;return(0,wwe.jsx)(i,{...t,value:r,onChange:n,ref:o})})}var KN=c(U(),1),Ewe=c(io(),1),AW=c(E(),1);function LW({name:e,shortcutType:t,shortcutCharacter:o,...r}){let n,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&o&&(n=Ewe.displayShortcut[t](o)),(0,AW.jsx)(KN.Fill,{name:i,children:(0,AW.jsx)(KN.ToolbarButton,{...r,shortcut:n})})}var da=c(E(),1),{useRichText:kKe,KeyboardShortcutContext:_Ke,InputEventContext:xKe,RichTextShortcut:Awe,RichTextInputEvent:Lwe}=H(Bwe.privateApis),Twe=Symbol("instanceId");function $N({children:e,tagName:t="div",value:o="",onChange:r,isSelected:n,multiline:i,inlineToolbar:s,wrapperClassName:a,autocompleters:l,onReplace:u,placeholder:d,allowedFormats:f,withoutInteractiveFormatting:p,onRemove:h,onMerge:m,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:y,preserveWhiteSpace:k,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:_,__unstableDisableFormats:x,disableLineBreaks:w,__unstableAllowPrefixTransformations:T,readOnly:B,...R},I){g&&(0,Owe.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});let A=(0,YN.useInstanceId)($N),P=(0,Xn.useRef)(),[O,N]=(0,Xn.useState)(null),z=ht(),{clientId:V,isSelected:M,name:D}=z,L=z[zy],j=z[Fy]==="default",q=(0,Xn.useContext)(_n),J=(0,vf.useRegistry)(),te=de=>{if(!M)return{isSelected:!1};let{getSelectionStart:Me,getSelectionEnd:Ze}=de(C),ze=Me(),Je=Ze(),lt;return n===void 0?lt=ze.clientId===V&&Je.clientId===V&&(y?ze.attributeKey===y:ze[Twe]===A):n&&(lt=ze.clientId===V),{selectionStart:lt?ze.offset:void 0,selectionEnd:lt?Je.offset:void 0,isSelected:lt}},{selectionStart:ee,selectionEnd:$,isSelected:W}=(0,vf.useSelect)(te,[V,y,A,n,M]),{disableBoundBlock:Y,bindingsPlaceholder:Z,bindingsLabel:oe}=(0,vf.useSelect)(de=>{if(!L?.[y])return{};let{__experimentalBlockBindingsSupportedAttributes:Me}=de(C).getSettings();if(!Me?.[D])return{};let ze=L[y],Je=(0,Iwe.getBlockBindingsSource)(ze.source),lt={};if(Je?.usesContext?.length)for(let vr of Je.usesContext)lt[vr]=q[vr];let ct=!Je?.canUserEditValue?.({select:de,context:lt,args:ze.args});if(o.length>0)return{disableBoundBlock:ct,bindingsPlaceholder:null,bindingsLabel:null};let{getBlockAttributes:yr}=de(C),Ao=yr(V),rr=null;Je?.getFieldsList&&(rr=Je.getFieldsList({select:de,context:lt})?.find(an=>(0,Rwe.default)(an.args,ze?.args))?.label);let ho=rr??Je?.label,Go=ct?ho:(0,E_.sprintf)((0,E_.__)("Add %s"),ho),Vn=ct?ze?.args?.key||Je?.label:(0,E_.sprintf)((0,E_.__)("Empty %s; start writing to edit its value"),ze?.args?.key||Je?.label);return{disableBoundBlock:ct,bindingsPlaceholder:Ao?.placeholder||Go,bindingsLabel:Vn}},[L,y,D,o,V,q]),ne=!!q?.["pattern/overrides"],X=L?.__default?.source==="core/pattern-overrides",ae=B||Y||ne&&!X,ve=(0,vf.useSelect)(de=>{if(ae||!j||!M)return!1;let{getSelectedBlockClientId:Me,canHostEditableRoot:Ze}=H(de(C));return Ze(Me())},[ae,j,M]),{getSelectionStart:xe,getSelectionEnd:ge,getBlockRootClientId:be}=(0,vf.useSelect)(C),{selectionChange:he}=(0,vf.useDispatch)(C),ke=k_({allowedFormats:f,disableFormats:x}),_e=!ke||ke.length>0,we=(0,Xn.useCallback)((de,Me)=>{let Ze={},ze=de===void 0&&Me===void 0,Je={clientId:V,[y?"attributeKey":Twe]:y||A};if(typeof de=="number"||ze){if(Me===void 0&&be(V)!==be(ge().clientId))return;Ze.start={...Je,offset:de}}if(typeof Me=="number"||ze){if(de===void 0&&be(V)!==be(xe().clientId))return;Ze.end={...Je,offset:Me}}he(Ze)},[V,be,ge,xe,y,A,he]),{value:Re,getValue:se,onChange:ie,ref:Ae,formatTypes:ye}=kKe({value:o,onChange:r,selectionStart:ee,selectionEnd:$,onSelectionChange:we,placeholder:Z||d,__unstableIsSelected:W,__unstableDisableFormats:x,preserveWhiteSpace:k,__unstableDependencies:[t],allowedFormats:ke,withoutInteractiveFormatting:p,__unstableFormatTypeHandlerContext:(0,Xn.useMemo)(()=>({richTextIdentifier:y,blockClientId:V}),[y,V])}),Ee=GX({onReplace:u,completers:l,record:Re,onChange:ie}),{"aria-autocomplete":qe,"aria-haspopup":pt,"aria-controls":at,"aria-owns":Ct,"aria-activedescendant":rt}=Ee;(0,Xn.useEffect)(()=>{if(!W)return;let de=P.current?.parentElement?.closest('[contenteditable="true"]');if(!de)return;let Me={"aria-autocomplete":qe,"aria-haspopup":pt,"aria-controls":at,"aria-owns":Ct,"aria-activedescendant":rt};for(let[Ze,ze]of Object.entries(Me))ze===void 0?de.removeAttribute(Ze):de.setAttribute(Ze,ze);return()=>{for(let Ze of Object.keys(Me))de.removeAttribute(Ze)}},[W,qe,pt,at,Ct,rt]),Vxe({html:o,value:Re});let Ot=(0,Xn.useRef)(new Set),ut=(0,Xn.useRef)(new Set);function Gt(){P.current?.focus()}let So=R.tabIndex;ve?So=R.tabIndex??0:!ae&&R.tabIndex===0&&(So=null);let mo=t;return(0,da.jsxs)(da.Fragment,{children:[W&&(0,da.jsx)(_Ke.Provider,{value:Ot,children:(0,da.jsx)(xKe.Provider,{value:ut,children:(0,da.jsxs)(Pwe.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:Re,onChange:ie,onFocus:Gt}),(0,da.jsx)(GN,{value:Re,onChange:ie,onFocus:Gt,formatTypes:ye,forwardedRef:P})]})})}),W&&_e&&(0,da.jsx)(Nxe,{inline:s,editableContentElement:O}),(0,da.jsx)(mo,{role:"textbox","aria-multiline":!w,"aria-readonly":ae,...R,draggable:void 0,"aria-label":oe||R["aria-label"]||d,...Ee,ref:(0,YN.useMergeRefs)([Ae,I,Ee.ref,R.ref,jN({registry:J,getValue:se,onChange:ie,__unstableAllowPrefixTransformations:T,formatTypes:ye,onReplace:u,selectionChange:he,isSelected:W,disableFormats:x,value:Re,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:_,pastePlainText:S,onMerge:m,onRemove:h,disableLineBreaks:w,onSplitAtEnd:b,onSplitAtDoubleLineEnd:v,keyboardShortcuts:Ot,inputEvents:ut}),P,N]),contentEditable:!ae,suppressContentEditableWarning:!0,className:K("block-editor-rich-text__editable",R.className,"rich-text"),tabIndex:So,"data-wp-block-attribute-key":y})]})}var HE=Cwe((0,Xn.forwardRef)($N));HE.Content=jE;HE.isEmpty=e=>!e||e.length===0;var MW=(0,Xn.forwardRef)((e,t)=>{if(ht()[tT]){let{children:n,tagName:i="div",value:s,onChange:a,isSelected:l,multiline:u,inlineToolbar:d,wrapperClassName:f,autocompleters:p,onReplace:h,placeholder:m,allowedFormats:g,withoutInteractiveFormatting:b,onRemove:v,onMerge:y,onSplit:k,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:_,identifier:x,preserveWhiteSpace:w,__unstablePastePlainText:T,__unstableEmbedURLOnPaste:B,__unstableDisableFormats:R,disableLineBreaks:I,__unstableAllowPrefixTransformations:A,readOnly:P,...O}=e;return(0,da.jsx)(i,{ref:t,...O,dangerouslySetInnerHTML:{__html:PW(s,u)||"
"}})}return(0,da.jsx)(HE,{ref:t,...e,readOnly:!1})});MW.Content=jE;MW.isEmpty=e=>!e||e.length===0;var w_=MW;var NW=c(E(),1),Nwe=(0,Mwe.forwardRef)((e,t)=>(0,NW.jsx)(w_,{ref:t,...e,__unstableDisableFormats:!0}));Nwe.Content=function({value:t="",tagName:o="div",...r}){return(0,NW.jsx)(o,{...r,children:t})};var Dwe=Nwe;var DW=c(E(),1),wKe=(0,Fwe.forwardRef)(({__experimentalVersion:e,...t},o)=>{if(e===2)return(0,DW.jsx)(Dwe,{ref:o,...t});let{className:r,onChange:n,...i}=t;return(0,DW.jsx)(Vwe.default,{ref:o,className:K("block-editor-plain-text",r),onChange:s=>n(s.target.value),...i})}),zwe=wKe;var Au=c(G(),1),Hwe=c(F(),1),Uwe=c(U(),1);var jwe=c(fe(),1);var qN=c(G(),1),sh=c(E(),1);function ZN({property:e,viewport:t,desc:o}){let r=(0,jwe.useInstanceId)(ZN),n=o||(0,qN.sprintf)((0,qN._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,sh.jsxs)(sh.Fragment,{children:[(0,sh.jsx)("span",{"aria-describedby":`rbc-desc-${r}`,children:t.label}),(0,sh.jsx)(bt,{id:`rbc-desc-${r}`,render:(0,sh.jsx)("span",{}),children:n})]})}var Lu=c(E(),1);function CKe(e){let{title:t,property:o,toggleLabel:r,onIsResponsiveChange:n,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:a=!1,defaultLabel:l={id:"all",label:(0,Au._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,Au.__)("Small screens")},{id:"medium",label:(0,Au.__)("Medium screens")},{id:"large",label:(0,Au.__)("Large screens")}]}=e;if(!t||!o||!i)return null;let d=r||(0,Au.sprintf)((0,Au.__)("Use the same %s on all screen sizes."),o),f=(0,Au.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),p=i((0,Lu.jsx)(ZN,{property:o,viewport:l}),l),h=()=>u.map(m=>(0,Lu.jsx)(Hwe.Fragment,{children:i((0,Lu.jsx)(ZN,{property:o,viewport:m}),m)},m.id));return(0,Lu.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Lu.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Lu.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Lu.jsx)(Uwe.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:n,help:f}),(0,Lu.jsxs)("div",{className:K("block-editor-responsive-block-control__group",{"is-responsive":a}),children:[!a&&p,a&&(s?s(u):h())]})]})]})}var Gwe=CKe;var XN=c(U(),1);var Wwe=c(E(),1);function $we({units:e,...t}){let[o]=Le("spacing.units"),r=(0,XN.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"],units:e});return(0,Wwe.jsx)(XN.__experimentalUnitControl,{units:r,...t})}var UE=c(G(),1),Kwe=c(F(),1),T_=c(U(),1);var Mu=c(E(),1);function EKe({url:e,onChange:t}){let[o,r]=(0,Kwe.useReducer)(i=>!i,!1),n=i=>{i.preventDefault(),r()};return(0,Mu.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,Mu.jsx)(T_.Button,{size:"compact",icon:ss,label:e?(0,UE.__)("Edit link"):(0,UE.__)("Insert link"),onClick:r,className:"components-toolbar__control",isPressed:!!e}),o&&(0,Mu.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:n,children:(0,Mu.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,Mu.jsx)(T_.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:Vx,label:(0,UE.__)("Close"),onClick:r}),(0,Mu.jsx)(Qm,{value:e||"",onChange:t,suffix:(0,Mu.jsx)(T_.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Mu.jsx)(T_.Button,{size:"small",icon:sd,label:(0,UE.__)("Submit"),type:"submit"})})})]})})]})}var Ywe=EKe;var Ts=c(G(),1),gl=c(F(),1),Jwe=c(Tt(),1),hn=c(U(),1);var e0e=c(Fs(),1);var Bo=c(E(),1),VW="none",qwe="custom",Zwe="media",Xwe="attachment",Qwe=["noopener"],t0e=({linkDestination:e,onChangeUrl:t,url:o,mediaType:r="image",mediaUrl:n,mediaLink:i,linkTarget:s,linkClass:a,rel:l,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:f,resetLightbox:p})=>{let[h,m]=(0,gl.useState)(!1),[g,b]=(0,gl.useState)(null),v=()=>{m(!0)},[y,k]=(0,gl.useState)(!1),[S,_]=(0,gl.useState)(null),x=(0,gl.useRef)(null),w=(0,gl.useRef)();(0,gl.useEffect)(()=>{if(!w.current)return;(Jwe.focus.focusable.find(w.current)[0]||w.current).focus()},[y,o,d]);let T=()=>{(e===Zwe||e===Xwe)&&_(""),k(!0)},B=()=>{k(!1)},R=()=>{_(null),B(),m(!1)},I=$=>{let W=$?"_blank":void 0,Y;if(W){let Z=(l??"").split(" ");Qwe.forEach(oe=>{Z.includes(oe)||Z.push(oe)}),Y=Z.join(" ")}else{let Z=(l??"").split(" ").filter(oe=>Qwe.includes(oe)===!1);Y=Z.length?Z.join(" "):void 0}return{linkTarget:W,rel:Y}},A=()=>$=>{let W=x.current;W&&W.contains($.target)||(m(!1),_(null),B())},P=()=>$=>{if(S){let W=N().find(Y=>Y.url===S)?.linkDestination||qwe;t({href:(0,e0e.prependHTTPS)(S),linkDestination:W,lightbox:{enabled:!1}})}B(),_(null),$.preventDefault()},O=()=>{t({linkDestination:VW,href:""})},N=()=>{let $=[{linkDestination:Zwe,title:(0,Ts.__)("Link to image file"),url:r==="image"?n:void 0,icon:$x}];return r==="image"&&i&&$.push({linkDestination:Xwe,title:(0,Ts.__)("Link to attachment page"),url:r==="image"?i:void 0,icon:cg}),$},z=$=>{let W=N(),Y;$?Y=(W.find(Z=>Z.url===$)||{linkDestination:qwe}).linkDestination:Y=VW,t({linkDestination:Y,href:$})},V=$=>{let W=I($);t(W)},M=$=>{t({rel:$})},D=$=>{t({linkClass:$})},L=(0,Bo.jsxs)(hn.__experimentalVStack,{spacing:"3",children:[(0,Bo.jsx)(hn.ToggleControl,{label:(0,Ts.__)("Open in new tab"),onChange:V,checked:s==="_blank"}),(0,Bo.jsx)(hn.TextControl,{label:(0,Ts.__)("Link relation"),value:l??"",onChange:M,help:(0,gl.createInterpolateElement)((0,Ts.__)("The Link Relation attribute defines the relationship between a linked resource and the current document."),{a:(0,Bo.jsx)(hn.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,Bo.jsx)(hn.TextControl,{label:(0,Ts.__)("Link CSS class"),value:a||"",onChange:D})]}),j=S!==null?S:o,q=!d||d&&!u,J=!j&&q,te=(N().find($=>$.linkDestination===e)||{}).title,ee=()=>{if(d&&u&&!o&&!y)return(0,Bo.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,Bo.jsx)(gt,{icon:rR}),(0,Bo.jsxs)("div",{className:"text",children:[(0,Bo.jsx)("p",{children:(0,Ts.__)("Enlarge on click")}),(0,Bo.jsx)("p",{className:"description",children:(0,Ts.__)("Scales the image with a lightbox effect")})]}),(0,Bo.jsx)(hn.Button,{icon:is,label:(0,Ts.__)("Disable enlarge on click"),onClick:()=>{f?.(!1)},size:"compact"})]});if(!o||y)return(0,Bo.jsx)(rh.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:j,onChangeInputValue:_,onSubmit:P(),autocompleteRef:x});if(o&&!y)return(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(rh.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:T,urlLabel:te}),(0,Bo.jsx)(hn.Button,{icon:is,label:(0,Ts.__)("Remove link"),onClick:()=>{O(),p?.()},size:"compact"})]})};return(0,Bo.jsxs)(Bo.Fragment,{children:[(0,Bo.jsx)(hn.ToolbarButton,{icon:ss,className:"components-toolbar__control",label:(0,Ts.__)("Link"),"aria-expanded":h,onClick:v,ref:b,isActive:!!o||d&&u}),h&&(0,Bo.jsx)(rh,{ref:w,anchor:g,onFocusOutside:A(),onClose:R,renderSettings:q?()=>L:null,additionalControls:J&&(0,Bo.jsxs)(hn.NavigableMenu,{children:[N().map($=>(0,Bo.jsx)(hn.MenuItem,{icon:$.icon,iconPosition:"left",onClick:()=>{_(null),z($.url),B()},children:$.title},$.linkDestination)),u&&(0,Bo.jsx)(hn.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:rR,info:(0,Ts.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{_(null),t({linkDestination:VW,href:""}),f?.(!0),B()},children:(0,Ts.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:ee()})]})};var B_=c(U(),1),h0e=c(F(),1),eD=c(G(),1);var o0e=c(F(),1),zW=c(G(),1);var FW=[],TKe=new Intl.Collator("und",{numeric:!0}).compare;function QN(){let[e,t,o,r]=Le("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),n=e??FW,i=t??FW,s=o&&r!==!1?o:FW;return(0,o0e.useMemo)(()=>{let a=[{name:(0,zW.__)("None"),slug:"0",size:0},...n,...i,...s];return a.every(({slug:l})=>/^[0-9]/.test(l))&&a.sort((l,u)=>TKe(l.slug,u.slug)),a.length>$X?[{name:(0,zW.__)("Default"),slug:"default",size:void 0},...a]:a},[n,i,s])}var r0e=c(F(),1),n0e=c(Q(),1),JN=c(G(),1),i0e=c(U(),1);var s0e=c(E(),1),RKe={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function R_({icon:e,isMixed:t=!1,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:l,type:u,value:d,...f}){let p=(0,n0e.useSelect)(S=>S(C).getSettings()?.disableCustomSpacingSizes),[h]=Le("spacing.units"),m=(0,i0e.__experimentalUseCustomUnits)({availableUnits:h||["px","em","rem"]}),g=(0,r0e.useMemo)(()=>l?.map(S=>({name:S.name,slug:S.slug,size:S.size}))||[],[l]),b=(wp.includes(a)||["vertical","horizontal"].includes(a))&&s?qc[a]:"",v=s?u?.toLowerCase():u,y=(0,JN.sprintf)((0,JN._x)("%1$s %2$s","spacing"),b,v).trim(),k=m[0]?.value||"px";return(0,s0e.jsx)($b,{allowNegativeOnDrag:o<0,ariaLabel:y,className:"spacing-sizes-control",customValueSettings:RKe,disableCustomValues:p,icon:e,isMixed:t,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,presets:g,presetType:"spacing",selectedUnit:k,units:m,value:d,...f})}var GE=c(E(),1),a0e=["vertical","horizontal"];function l0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let l=d=>f=>{if(!t)return;let p={...Object.keys(a).reduce((h,m)=>(h[m]=kv(a[m],i),h),{})};d==="vertical"&&(p.top=f,p.bottom=f),d==="horizontal"&&(p.left=f,p.right=f),t(p)},u=n?.length?a0e.filter(d=>Oz(n,d)):a0e;return(0,GE.jsx)(GE.Fragment,{children:u.map(d=>{let f=d==="vertical"?a.top:a.left;return(0,GE.jsx)(R_,{icon:sP[d],label:qc[d],minimumCustomValue:e,onChange:l(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:f,withInputField:!1},`spacing-sizes-control-${d}`)})})}var WE=c(E(),1);function c0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let l=n?.length?wp.filter(d=>n.includes(d)):wp,u=d=>f=>{let p={...Object.keys(a).reduce((h,m)=>(h[m]=kv(a[m],i),h),{})};p[d]=f,t(p)};return(0,WE.jsx)(WE.Fragment,{children:l.map(d=>(0,WE.jsx)(R_,{icon:sP[d],label:qc[d],minimumCustomValue:e,onChange:u(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:a[d],withInputField:!1},`spacing-sizes-control-${d}`))})}var u0e=c(E(),1);function d0e({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,values:l}){let u=d=>f=>{let p={...Object.keys(l).reduce((h,m)=>(h[m]=kv(l[m],s),h),{})};p[d]=f,t(p)};return(0,u0e.jsx)(R_,{label:qc[i],minimumCustomValue:e,onChange:u(i),onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,value:l[i],withInputField:!1})}var f0e=c(U(),1);var jW=c(G(),1),p0e=c(E(),1);function m0e({isLinked:e,...t}){let o=e?(0,jW.__)("Unlink sides"):(0,jW.__)("Link sides");return(0,p0e.jsx)(f0e.Button,{...t,size:"small",icon:e?ss:is,iconSize:24,label:o})}var Nu=c(E(),1);function P_({inputProps:e,label:t,minimumCustomValue:o=0,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,sides:a=wp,useSelect:l,values:u}){let d=QN(),f=u||KX,p=a?.length===1,h=a?.includes("horizontal")&&a?.includes("vertical")&&a?.length===2,[m,g]=(0,h0e.useState)(qX(f,a)),b=()=>{g(m===bd.axial?bd.custom:bd.axial)},y={...e,minimumCustomValue:o,onChange:x=>{let w={...u,...x};r(w)},onMouseOut:n,onMouseOver:i,sides:a,spacingSizes:d,type:t,useSelect:l,values:f},k=()=>m===bd.axial?(0,Nu.jsx)(l0e,{...y}):m===bd.custom?(0,Nu.jsx)(c0e,{...y}):(0,Nu.jsx)(d0e,{side:m,...y,showSideInLabel:s}),S=wp.includes(m)&&s?qc[m]:"",_=(0,eD.sprintf)((0,eD._x)("%1$s %2$s","spacing"),t,S).trim();return(0,Nu.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Nu.jsxs)(B_.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,Nu.jsx)(B_.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:_}),!p&&!h&&(0,Nu.jsx)(m0e,{label:t,onClick:b,isLinked:m===bd.axial})]}),(0,Nu.jsx)(B_.__experimentalVStack,{spacing:.5,children:k()})]})}var g0e=c(Rt(),1);function b0e(){return(0,g0e.default)("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}var y0e=c(Rt(),1);function v0e(){(0,y0e.default)("wp.blockEditor.useResizeCanvas",{since:"7.1",hint:"Device preview is now handled by the editor canvas. This hook no longer does anything."})}var qi=c(G(),1),Z_=c(ue(),1),X_=c(U(),1),g1=c(Q(),1),e1e=c(F(),1);var I_=c(U(),1),tD=c(G(),1),oD=c(Q(),1),rD=c(ue(),1);var uy=c(E(),1);function BKe({block:e,onNavigateToEntityRecord:t,isSyncedPattern:o,isTemplatePartBlock:r}){let n=e?.attributes||{};return(0,uy.jsx)(I_.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,uy.jsx)(I_.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(o)t({postId:n.ref,postType:"wp_block"});else if(r){let{theme:s,slug:a}=n,l=s&&a?`${s}//${a}`:null;l&&t({postId:l,postType:"wp_template_part"})}},children:(0,tD.__)("Edit original")})})}function PKe({clientId:e,editedContentOnlySection:t,editContentOnlySection:o,stopEditingContentOnlySection:r}){let{selectBlock:n}=(0,oD.useDispatch)(C);return(0,uy.jsx)(I_.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,uy.jsx)(I_.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?(r(),n(e)):(o(e),n(e))},children:t?(0,tD.__)("Exit pattern"):(0,tD.__)("Edit pattern")})})}function S0e({clientId:e}){let{isWithinSection:t,isWithinEditedSection:o,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i}=ZL(e),{block:s,onNavigateToEntityRecord:a,canEdit:l}=(0,oD.useSelect)(p=>{let{getBlock:h,getSettings:m,canEditBlock:g}=p(C);return{block:h(e),onNavigateToEntityRecord:m().onNavigateToEntityRecord,canEdit:g(e)}},[e]);if(!l||!t&&!o)return null;let u=(0,rD.isReusableBlock)(s),d=(0,rD.isTemplatePart)(s);return(u||d)&&a?(0,uy.jsx)(BKe,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:u,isTemplatePartBlock:d}):(0,uy.jsx)(PKe,{clientId:e,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i})}var k0e=c(Q(),1),_0e=c(G(),1),x0e=c(U(),1),w0e=c(F(),1);var C0e=c(E(),1);function nD(){let e=(0,k0e.useSelect)(r=>r(C).getBlockSelectionStart(),[]),t=(0,w0e.useRef)();return xg(e,t),e?(0,C0e.jsx)(x0e.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,_0e.__)("Skip to the selected block")}):null}var iD=c(G(),1),E0e=c(Q(),1);var T0e=c(U(),1);var $E=c(E(),1);function HW(){let e=(0,E0e.useSelect)(t=>t(C).getSelectedBlockCount(),[]);return(0,$E.jsxs)(T0e.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,$E.jsx)(Et,{icon:og,showColors:!0}),(0,$E.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,iD.sprintf)((0,iD._n)("%d Block","%d Blocks",e),e)})]})}var R0e=c(U(),1),IKe=Symbol("BlockInspectorPreTabs"),{Fill:jqt,Slot:B0e}=(0,R0e.createSlotFill)(IKe);var pV=c(U(),1),Bc=c(F(),1),UEe=c(dv(),1),q_=c(Q(),1);var KE=c(G(),1),sD={name:"settings",title:(0,KE.__)("Settings"),value:"settings",icon:a3},aD={name:"styles",title:(0,KE.__)("Styles"),value:"styles",icon:g6},lD={name:"content",title:(0,KE.__)("Content"),value:"content",icon:cg},Sf={name:"list",title:(0,KE.__)("List View"),value:"list-view",icon:Qx};var UW=c(U(),1);var YE=c(U(),1),P0e=c(G(),1);var qE=c(E(),1),OKe=({initialOpen:e=!1})=>{let t=(0,YE.__experimentalUseSlotFills)(Cm.slotName),o=(0,YE.__experimentalUseSlotFills)(YC.name),r=!!(t&&t.length),n=!!(o&&o.length);return!r&&!n?null:(0,qE.jsxs)(YE.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,P0e.__)("Advanced"),initialOpen:e,children:[(0,qE.jsx)(Oe.Slot,{group:"advanced"}),(0,qE.jsx)(YC.Slot,{})]})},cD=OKe;var kf=c(E(),1),AKe=({showAdvancedControls:e=!1})=>{let t=(0,UW.__experimentalUseSlotFills)(dc.default.name),o=(0,UW.__experimentalUseSlotFills)(dc.bindings.name),r=!!t?.length||!!o?.length;return(0,kf.jsxs)(kf.Fragment,{children:[(0,kf.jsx)(Oe.Slot,{}),(0,kf.jsx)(Oe.Slot,{group:"bindings"}),e&&(0,kf.jsx)("div",{children:(0,kf.jsx)(cD,{initialOpen:!r})})]})},I0e=AKe;var dh=c(G(),1),cV=c(Q(),1),I$=c(F(),1);var O_=c(U(),1),uD=c(Q(),1),GW=c(G(),1);var ZE=c(E(),1),LKe=()=>{let{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:o}=(0,uD.useSelect)(s=>{let{getBlocksByClientId:a,getSelectedBlockClientIds:l}=s(C),u=l(),d=a(u);return{selectedClientIds:u,selectedBlocks:d,hasPositionAttribute:d?.some(({attributes:f})=>!!f?.style?.position?.type)}},[]),{updateBlockAttributes:r}=(0,uD.useDispatch)(C),n=xr();function i(){if(!e?.length||!t?.length)return;let s=Object.fromEntries(t?.map(({clientId:a,attributes:l})=>[a,{style:Ge({...l?.style,position:{...l?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));r(e,s,!0)}return(0,ZE.jsx)(O_.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,GW.__)("Position"),resetAll:i,dropdownMenuProps:n,children:(0,ZE.jsx)(O_.__experimentalToolsPanelItem,{isShownByDefault:o,label:(0,GW.__)("Position"),hasValue:()=>o,onDeselect:i,children:(0,ZE.jsx)(Oe.Slot,{group:"position"})})})},MKe=()=>{let e=(0,O_.__experimentalUseSlotFills)(dc.position.name);return!(e&&e.length)?null:(0,ZE.jsx)(LKe,{})},dD=MKe;var u1=c(ue(),1),d$=c(U(),1),$D=c(F(),1),QCe=c(go(),1),JCe=c(Q(),1),WD=c(G(),1);var a$={};Or(a$,{AdvancedPanel:()=>ND,BackgroundPanel:()=>zD,BorderPanel:()=>ID,ColorPanel:()=>yD,DimensionsPanel:()=>TD,FiltersPanel:()=>AD,ImageSettingsPanel:()=>ACe,StateControl:()=>jD,StateControlBadges:()=>HD,TypographyPanel:()=>SD,useHasBackgroundPanel:()=>FD,useHasBorderPanel:()=>PD,useHasBorderPanelControls:()=>e1,useHasColorPanel:()=>bD,useHasDimensionsPanel:()=>ED,useHasFiltersPanel:()=>PCe,useHasImageSettingsPanel:()=>OCe,useHasTypographyPanel:()=>vD,useSettingsForBlockElement:()=>fD});var XE=c(F(),1),O0e=c(Q(),1),WW=c(ue(),1),dy=c(G(),1);function fD(e,t,o){let{supportedStyles:r,supports:n}=(0,O0e.useSelect)(i=>({supportedStyles:H(i(WW.store)).getSupportedStyles(t,o),supports:i(WW.store).getBlockType(t)?.supports}),[t,o]);return(0,XE.useMemo)(()=>{let i={...e};return r.includes("fontSize")||(i.typography={...i.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(i.typography={...i.typography,fontFamilies:{}}),i.color={...i.color,text:i.color?.text&&r.includes("color"),background:i.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:i.color?.button&&r.includes("buttonColor"),heading:i.color?.heading&&r.includes("headingColor"),link:i.color?.link&&r.includes("linkColor"),caption:i.color?.caption&&r.includes("captionColor")},!r.includes("background")&&!r.includes("backgroundGradient")&&(i.color.gradients=[],i.color.customGradient=!1),r.includes("filter")||(i.color.defaultDuotone=!1,i.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(s=>{r.includes(s)||(i.typography={...i.typography,[s]:!1})}),r.includes("textIndent")&&(i.typography={...i.typography,textIndent:i.typography?.textIndent??"subsequent"}),r.includes("columnCount")||(i.typography={...i.typography,textColumns:!1}),["contentSize","wideSize"].forEach(s=>{r.includes(s)||(i.layout={...i.layout,[s]:!1})}),["padding","margin","blockGap"].forEach(s=>{r.includes(s)||(i.spacing={...i.spacing,[s]:!1});let a=Array.isArray(n?.spacing?.[s])?n?.spacing?.[s]:n?.spacing?.[s]?.sides;a?.length&&i.spacing?.[s]&&(i.spacing={...i.spacing,[s]:{...i.spacing?.[s],sides:a}})}),["aspectRatio","height","minHeight","minWidth","width"].forEach(s=>{r.includes(s)||(i.dimensions={...i.dimensions,[s]:!1})}),["radius","color","style","width"].forEach(s=>{r.includes("border"+s.charAt(0).toUpperCase()+s.slice(1))||(i.border={...i.border,[s]:!1})}),[["backgroundImage","backgroundImage"],["backgroundSize","backgroundSize"],["backgroundGradient","gradient"]].forEach(([s,a])=>{r.includes(s)||(i.background={...i.background,[a]:!1})}),i.shadow=r.includes("shadow")?i.shadow:!1,i},[e,r,n])}function Du(e){let t=e?.color?.palette?.custom,o=e?.color?.palette?.theme,r=e?.color?.palette?.default,n=e?.color?.defaultPalette;return(0,XE.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,dy._x)("Theme","Indicates this palette comes from the theme."),colors:o}),n&&r&&r.length&&i.push({name:(0,dy._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&i.push({name:(0,dy._x)("Custom","Indicates this palette is created by the user."),colors:t}),i},[t,o,r,n])}function QE(e){let t=e?.color?.gradients?.custom,o=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,n=e?.color?.defaultGradients;return(0,XE.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,dy._x)("Theme","Indicates this palette comes from the theme."),gradients:o}),n&&r&&r.length&&i.push({name:(0,dy._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&i.push({name:(0,dy._x)("Custom","Indicates this palette is created by the user."),gradients:t}),i},[t,o,r,n])}function A_(e){let t=Du(e),o=QE(e),r=e?.color?.custom,n=e?.color?.customGradient,i=(0,XE.useMemo)(()=>t.flatMap(({colors:l})=>l),[t]),s=l=>Ea({settings:e},"",l),a=(l,u)=>{if(u)return"var:preset|gradient|"+u;let f=o.flatMap(({gradients:p})=>p).find(({gradient:p})=>p===l);return f?"var:preset|gradient|"+f.slug:l};return{colors:t,gradients:o,allColors:i,areCustomSolidsEnabled:r,areCustomGradientsEnabled:n,hasSolidColors:t.length>0||r,hasGradientColors:o.length>0||n,decodeValue:s,encodeGradientValue:a}}var vl=c(U(),1),Cr=c(G(),1),fy=c(F(),1);var L_=c(G(),1);var A0e=c(F(),1),pD=c(U(),1),$W=c(E(),1),NKe=[{label:(0,L_.__)("Align text left"),value:"left",icon:tp},{label:(0,L_.__)("Align text center"),value:"center",icon:Qh},{label:(0,L_.__)("Align text right"),value:"right",icon:op},{label:(0,L_.__)("Justify text"),value:"justify",icon:MF}],DKe=["left","center","right"];function mD({className:e,value:t,onChange:o,options:r=DKe}){let n=(0,A0e.useMemo)(()=>NKe.filter(i=>r.includes(i.value)),[r]);return n.length?(0,$W.jsx)(pD.__experimentalToggleGroupControl,{isDeselectable:!0,label:(0,L_.__)("Text alignment"),className:K("block-editor-text-alignment-control",e),value:t,onChange:i=>{o(i===t?void 0:i)},children:n.map(i=>(0,$W.jsx)(pD.__experimentalToggleGroupControlOptionIcon,{value:i.value,icon:i.icon,label:i.label},i.value))}):null}var nn=c(U(),1),JE=c(G(),1);var bl=c(E(),1);function L0e({value:e,onChange:t,__unstableInputWidth:o="60px",withSlider:r=!1,hasBottomMargin:n=!1,help:i,className:s,placeholder:a,...l}){let[u]=Le("spacing.units"),d=(0,nn.__experimentalUseCustomUnits)({availableUnits:u||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[f,p]=(0,nn.__experimentalParseQuantityAndUnitFromRawValue)(e,d),h=!!p&&["em","rem","%","ch","vw","vh"].includes(p);return r?(0,bl.jsxs)(nn.__experimentalView,{style:n?{marginBottom:12}:void 0,children:[(0,bl.jsx)(nn.BaseControl.VisualLabel,{children:(0,JE.__)("Line indent")}),(0,bl.jsxs)(nn.Flex,{children:[(0,bl.jsx)(nn.FlexItem,{isBlock:!0,children:(0,bl.jsx)(nn.__experimentalUnitControl,{label:(0,JE.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:e,onChange:t,units:d,__unstableInputWidth:o,min:0,className:s,placeholder:a})}),r&&(0,bl.jsx)(nn.FlexItem,{isBlock:!0,children:(0,bl.jsx)(nn.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,bl.jsx)(nn.RangeControl,{label:(0,JE.__)("Line indent"),hideLabelFromVision:!0,value:f,withInputField:!1,onChange:m=>{t?.(m===void 0?void 0:m+(p??"px"))},min:0,max:h?10:100,step:h?.1:1,initialPosition:0})})})]}),i&&(0,bl.jsx)("p",{className:"components-base-control__help",children:i})]}):(0,bl.jsx)(nn.__experimentalUnitControl,{...l,label:(0,JE.__)("Line indent"),value:e,__unstableInputWidth:o,units:d,onChange:t,help:i,className:s,placeholder:a})}var sn=c(U(),1),D0e=c(F(),1),KW=c(G(),1);var M_=c(U(),1);var M0e=c(G(),1),ah=c(E(),1),gn=()=>!!window.__experimentalGlobalStylesInheritanceUI;function yl(e,t,o){let r=!!e&&!t,n=K(o,{"is-inherited-from-global-styles":r,"has-local-override-from-global-styles":!!t});return{...n?{className:n}:{},isInherited:r,hasLocalOverride:!!t}}function _f({onResetToInherited:e,className:t}){return(0,ah.jsxs)(M_.Button,{__next40pxDefaultSize:!1,label:(0,M0e.__)("Reset to inherited value"),showTooltip:!0,className:K("has-local-override-from-global-styles__reset",t),onClick:o=>{o.preventDefault(),o.stopPropagation(),e?.()},children:[(0,ah.jsx)("span",{"aria-hidden":"true",className:"has-local-override-from-global-styles__dot"}),(0,ah.jsx)(M_.Icon,{className:"has-local-override-from-global-styles__reset-icon",icon:dn})]})}function Lt({className:e,isInherited:t,hasLocalOverride:o,label:r,onDeselect:n,showLocalOverrideActionsInLabel:i=!0,hasInlineEndToggle:s=!1,children:a,...l}){return(0,ah.jsxs)(M_.__experimentalToolsPanelItem,{className:e,label:r,onDeselect:n,...l,children:[a,o&&i&&(0,ah.jsx)("div",{className:K("global-styles-inheritance-affordance",{"global-styles-inheritance-affordance--offset-toggle":s}),children:(0,ah.jsx)(_f,{onResetToInherited:n})})]})}var vo=c(E(),1),{Tabs:hD}=H(sn.privateApis);function VKe({tabs:e,colorGradientControlSettings:t,contrastWarning:o}){let{key:r,...n}=e[0]??{},i=(e.find(s=>s.userValue!==void 0)??e.find(s=>s.isPlaceholder||s.inheritedValue!==void 0))?.key;return(0,vo.jsx)(sn.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,vo.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[e.length===1&&(0,vo.jsx)(N0e,{...n,colorGradientControlSettings:t,contrastWarning:o},r),e.length>1&&(0,vo.jsxs)(hD,{defaultTabId:i,children:[(0,vo.jsx)(hD.TabList,{children:e.map(s=>(0,vo.jsx)(hD.Tab,{tabId:s.key,children:s.label},s.key))}),e.map(s=>{let{key:a,...l}=s;return(0,vo.jsx)(hD.TabPanel,{tabId:a,focusable:!1,children:(0,vo.jsx)(N0e,{...l,colorGradientControlSettings:t,contrastWarning:o},a)},a)})]})]})})}var FKe={placement:"left-start",offset:36,shift:!0},zKe=({indicators:e,label:t})=>(0,vo.jsxs)(sn.__experimentalHStack,{justify:"flex-start",children:[(0,vo.jsx)(sn.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((o,r)=>(0,vo.jsx)(sn.Flex,{expanded:!1,children:(0,vo.jsx)(sn.ColorIndicator,{colorValue:o})},r))}),(0,vo.jsx)(sn.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function N0e({isGradient:e,inheritedValue:t,inheritedSlug:o,userSlug:r,userValue:n,setValue:i,isPlaceholder:s,colorGradientControlSettings:a,contrastWarning:l}){let u=n??t,d=n!==void 0?r:o,f=(p,h)=>{if(s&&p===void 0){i(t,o);return}i(p,h)};return(0,vo.jsx)($m,{...a,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:u,colorSlug:e?void 0:d,gradientValue:e?u:void 0,gradientSlug:e?d:void 0,onColorChange:e?void 0:f,onGradientChange:e?f:void 0,clearable:n!==void 0,headingLevel:3,noticeProps:!e&&l?{children:l,status:"warning",spokenMessage:null,className:"block-editor-panel-color-gradient-settings__contrast-notice"}:void 0})}function lh({label:e,hasValue:t,resetValue:o,isShownByDefault:r,indicators:n,tabs:i,colorGradientControlSettings:s,panelId:a,contrastWarning:l,className:u="block-editor-tools-panel-color-gradient-settings__item",isPlaceholder:d=!1,hasInheritedValue:f=!1,showInheritanceLabelIndicators:p=gn()}){let h=(0,D0e.useRef)(void 0),m=K("block-editor-color-gradient-item",u),g=p&&t()&&f,b=p?yl(d,g,m):{className:m};return(0,vo.jsx)(Lt,{...b,showLocalOverrideActionsInLabel:!1,hasValue:t,label:e,onDeselect:o,isShownByDefault:r,panelId:a,children:(0,vo.jsx)(sn.Dropdown,{popoverProps:FKe,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:v,isOpen:y})=>{let k={onClick:v,className:K("block-editor-panel-color-gradient-settings__dropdown",{"is-open":y,"has-contrast-warning":!!l}),"aria-expanded":y,ref:h};return(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(sn.Button,{...k,__next40pxDefaultSize:!0,children:(0,vo.jsx)(zKe,{indicators:n,label:e})}),t()&&(g?(0,vo.jsx)(_f,{className:"block-editor-panel-color-gradient-settings__reset",onResetToInherited:()=>{o(),y&&v(),h.current?.focus()}}):(0,vo.jsx)(sn.Button,{__next40pxDefaultSize:!0,label:(0,KW.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:dn,onClick:()=>{o(),y&&v(),h.current?.focus()}})),l&&(0,vo.jsx)(sn.Button,{__next40pxDefaultSize:!0,size:"small",icon:XF,label:(0,KW.__)("Low contrast"),className:"block-editor-panel-color-gradient-settings__contrast-warning","aria-expanded":y,onClick:v})]})},renderContent:()=>(0,vo.jsx)(VKe,{tabs:i,colorGradientControlSettings:s,contrastWarning:l})})})}var V0e=c(U(),1),gD=c(F(),1),Qn=c(G(),1),F0e=c(rv(),1);function Po(e,t){if(typeof e!="string")return;let o=`var:preset|${t}|`;if(e.startsWith(o))return e.slice(o.length);let r=`--wp--preset--${t}--`;return e.match(new RegExp(`^var\\(${r}([^)]+)\\)$`))?.[1]}function xf(e,t,o){if(o)return"var:preset|color|"+o;let r=e.find(({color:n})=>n===t);return r?"var:preset|color|"+r.slug:t}var N_=c(E(),1);function bD(e){let t=z0e(e),o=H0e(e),r=U0e(e),n=j0e(e);return t||o||r||n}function YW(e){let t=Du(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function z0e(e){let t=Du(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function j0e(e){let t=Du(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function H0e(e){let t=Du(e),o=QE(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function U0e(e){let t=Du(e),o=QE(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function qW(e){let t=Du(e),o=QE(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function ZW({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=xr(),a=()=>{let l=e(o);t(l)};return(0,N_.jsx)(V0e.__experimentalToolsPanel,{label:i||(0,Qn.__)("Elements"),resetAll:a,panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,N_.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:n})})}var jKe={link:!0,heading:!0,button:!0,caption:!0};function yD({as:e=ZW,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=jKe,label:a,children:l,contrastWarning:u,showInheritanceLabelIndicators:d=gn()}){let{colors:f,gradients:p,areCustomSolidsEnabled:h,areCustomGradientsEnabled:m,hasSolidColors:g,hasGradientColors:b,allColors:v,decodeValue:y,encodeGradientValue:k}=A_(n),S=L=>(0,F0e.getCSSValueFromRawStyle)(y(L)),_=z0e(n),x=S(r?.elements?.link?.color?.text),w=y(t?.elements?.link?.color?.text),T=(L,j)=>{o(De(t,["elements","link","color","text"],xf(v,L,j)))},B=S(r?.elements?.link?.[":hover"]?.color?.text),R=y(t?.elements?.link?.[":hover"]?.color?.text),I=(L,j)=>{o(De(t,["elements","link",":hover","color","text"],xf(v,L,j)))},A=()=>!!w||!!R,P=()=>{let L=De(t,["elements","link",":hover","color","text"],void 0);L=De(L,["elements","link","color","text"],void 0),o(L)},O=j0e(n),N=U0e(n),z=H0e(n),V=(0,gD.useMemo)(()=>[{name:"caption",label:(0,Qn.__)("Captions"),showPanel:O},{name:"button",label:(0,Qn.__)("Button"),showPanel:N},{name:"heading",label:(0,Qn.__)("Heading"),showPanel:z},{name:"h1",label:(0,Qn.__)("H1"),showPanel:z},{name:"h2",label:(0,Qn.__)("H2"),showPanel:z},{name:"h3",label:(0,Qn.__)("H3"),showPanel:z},{name:"h4",label:(0,Qn.__)("H4"),showPanel:z},{name:"h5",label:(0,Qn.__)("H5"),showPanel:z},{name:"h6",label:(0,Qn.__)("H6"),showPanel:z}],[O,N,z]),M=(0,gD.useCallback)(L=>({...L,elements:{...L?.elements,link:{...L?.elements?.link,color:void 0,":hover":{color:void 0}},...V.reduce((j,q)=>({...j,[q.name]:{...L?.elements?.[q.name],color:void 0}}),{})}}),[V]),D=[_&&{key:"link",label:(0,Qn.__)("Link"),hasValue:A,resetValue:P,isShownByDefault:s.link,indicators:[w??x,R??B],isPlaceholder:w===void 0&&R===void 0&&(x!==void 0||B!==void 0),hasInheritedValue:x!==void 0||B!==void 0,contrastWarning:u,tabs:[{key:"link",label:(0,Qn.__)("Default"),inheritedValue:x,inheritedSlug:Po(r?.elements?.link?.color?.text,"color"),userSlug:Po(t?.elements?.link?.color?.text,"color"),setValue:T,userValue:w,isPlaceholder:w===void 0&&x!==void 0},{key:"hover",label:(0,Qn.__)("Hover"),inheritedValue:B,inheritedSlug:Po(r?.elements?.link?.[":hover"]?.color?.text,"color"),userSlug:Po(t?.elements?.link?.[":hover"]?.color?.text,"color"),setValue:I,userValue:R,isPlaceholder:R===void 0&&B!==void 0}]}].filter(Boolean);return V.forEach(({name:L,label:j,showPanel:q})=>{if(!q)return;let J=S(r?.elements?.[L]?.color?.background),te=S(r?.elements?.[L]?.color?.gradient),ee=S(r?.elements?.[L]?.color?.text),$=y(t?.elements?.[L]?.color?.background),W=y(t?.elements?.[L]?.color?.gradient),Y=y(t?.elements?.[L]?.color?.text),Z=()=>!!(Y||$||W),oe=()=>{let ke=De(t,["elements",L,"color","background"],void 0);ke.elements[L].color.gradient=void 0,ke.elements[L].color.text=void 0,o(ke)},ne=(ke,_e)=>{o(De(t,["elements",L,"color","text"],xf(v,ke,_e)))},X=(ke,_e)=>{let we=De(t,["elements",L,"color","background"],xf(v,ke,_e));we.elements[L].color.gradient=void 0,o(we)},re=(ke,_e)=>{let we=De(t,["elements",L,"color","gradient"],k(ke,_e));we.elements[L].color.background=void 0,o(we)},ae=L!=="caption",ve=Y===void 0&&ee!==void 0,xe=$===void 0&&J!==void 0,ge=W===void 0&&te!==void 0,be=Y===void 0&&$===void 0&&W===void 0&&(ee!==void 0||J!==void 0||te!==void 0),he=ee!==void 0||J!==void 0||te!==void 0;D.push({key:L,label:j,hasValue:Z,resetValue:oe,isShownByDefault:s[L],indicators:ae?[Y??ee,W??te??$??J]:[Y??ee],isPlaceholder:be,hasInheritedValue:he,tabs:[g&&{key:"text",label:(0,Qn.__)("Text"),inheritedValue:ee,inheritedSlug:Po(r?.elements?.[L]?.color?.text,"color"),userSlug:Po(t?.elements?.[L]?.color?.text,"color"),setValue:ne,userValue:Y,isPlaceholder:ve},g&&ae&&{key:"background",label:(0,Qn.__)("Background"),inheritedValue:J,inheritedSlug:Po(r?.elements?.[L]?.color?.background,"color"),userSlug:Po(t?.elements?.[L]?.color?.background,"color"),setValue:X,userValue:$,isPlaceholder:xe},b&&ae&&{key:"gradient",label:(0,Qn.__)("Gradient"),inheritedValue:te,inheritedSlug:Po(r?.elements?.[L]?.color?.gradient,"gradient"),userSlug:Po(t?.elements?.[L]?.color?.gradient,"gradient"),setValue:re,userValue:W,isGradient:!0,isPlaceholder:ge}].filter(Boolean)})}),(0,N_.jsxs)(e,{resetAllFilter:M,value:t,onChange:o,panelId:i,label:a,children:[D.map(L=>{let{key:j,...q}=L;return(0,N_.jsx)(lh,{...q,showInheritanceLabelIndicators:d,colorGradientControlSettings:{colors:f,disableCustomColors:!h,gradients:p,disableCustomGradients:!m},panelId:i},j)}),l]})}function W0e(e,t){let o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>o?.[i]??[]),n=r.find(i=>i.fontFamily===t)?.fontFace??[];return{fontFamilies:r,fontFamilyFaces:n}}function G0e(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((r,{value:n})=>{let i=Math.abs(parseInt(n)-parseInt(t)),s=Math.abs(parseInt(r)-parseInt(t));return ir.value===t)?t:t==="oblique"&&!e.find(r=>r.value==="oblique")?"italic":""}function $0e(e,t,o){let r=t,n=o,{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:a}=o_(e),l=i?.some(({value:d})=>d===t),u=s?.some(({value:d})=>d?.toString()===o?.toString());return l||(r=t?HKe(i,t):a?.find(d=>d.style.fontWeight===G0e(s,o))?.style?.fontStyle),u||(n=o?G0e(s,o):a?.find(d=>d.style.fontStyle===(r||t))?.style?.fontWeight),{nearestFontStyle:r,nearestFontWeight:n}}var to=c(E(),1),UKe=1,GKe=6;function WKe(e,t){let o=e?.elements?.link?.color?.text;if(o!==void 0)return o===e?.color?.text;let r=t?.elements?.link?.color?.text;return r===void 0||t?.color?.text===r}function vD(e){let t=Y0e(e),o=q0e(e),r=Z0e(e),n=X0e(e),i=J0e(e),s=Q0e(e),a=eCe(e),l=rCe(e),u=tCe(e),d=oCe(e),f=K0e(e),p=YW(e);return t||o||r||n||i||s||f||a||l||u||d||p}function K0e(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function Y0e(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function q0e(e){return e?.typography?.lineHeight}function Z0e(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function $Ke(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,Cr.__)("Appearance"):(0,Cr.__)("Font style"):(0,Cr.__)("Font weight")}function X0e(e){return e?.typography?.letterSpacing}function Q0e(e){return e?.typography?.textTransform}function J0e(e){return e?.typography?.textAlign}function eCe(e){return e?.typography?.textDecoration}function tCe(e){return e?.typography?.writingMode}function oCe(e){return e?.typography?.textColumns}function rCe(e){return e?.typography?.textIndent}function KKe(e){let t=e?.typography?.fontSizes,o=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...o?t?.default??[]:[]]}function QW({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,to.jsx)(vl.__experimentalToolsPanel,{label:(0,Cr.__)("Typography"),resetAll:s,panelId:r,__experimentalFirstVisibleItemClass:"first",dropdownMenuProps:i,children:n})}var YKe={textColor:!0,fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0},qKe=[void 0,null,""];function Ye(e){return!qKe.includes(e)}function XW(e){if(!Ye(e))return;let[t]=(0,vl.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}function SD({as:e=QW,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=YKe,isGlobalStyles:a=!1,showInheritanceLabelIndicators:l=gn(),contrastWarning:u}){let{colors:d,allColors:f,areCustomSolidsEnabled:p,decodeValue:h}=A_(n),m=(Ne,ln,zc)=>yl(l&&Ne,l&&ln,zc),g=YW(n),b=h(r?.color?.text),v=h(t?.color?.text),y=()=>!!t?.color?.text,k=(Ne,ln)=>{let zc=xf(f,Ne,ln),Ml=De(t,["color","text"],zc);(gn()?WKe(t,r):r?.color?.text===r?.elements?.link?.color?.text)&&(Ml=De(Ml,["elements","link","color","text"],zc)),o(Ml)},S=()=>k(void 0),_=Y0e(n),x=h(r?.typography?.fontFamily),w=h(t?.typography?.fontFamily)??x,T=!Ye(t?.typography?.fontFamily)&&Ye(x),{fontFamilies:B,fontFamilyFaces:R}=(0,fy.useMemo)(()=>W0e(n,w),[n,w]),I=Ne=>{let ln=B?.find(({fontFamily:Nl})=>Nl===Ne)?.slug,zc=ln?`var:preset|font-family|${ln}`:Ne,Ml=De(t,["typography","fontFamily"],Ye(zc)?zc:void 0),bF=B?.find(({fontFamily:Nl})=>Nl===Ne)?.fontFace??[],{fontStyles:jIe,fontWeights:HIe}=o_(bF),UIe=jIe?.some(({value:Nl})=>Nl===xe),GIe=HIe?.some(({value:Nl})=>Nl?.toString()===ge?.toString());if(!UIe||!GIe){let{nearestFontStyle:Nl,nearestFontWeight:yF}=$0e(bF,xe,ge);Nl||yF?Ml={...Ml,typography:{...Ml?.typography,fontStyle:Ye(Nl)?Nl:void 0,fontWeight:Ye(yF)?yF:void 0}}:(xe||ge)&&(Ml={...Ml,typography:{...Ml?.typography,fontStyle:void 0,fontWeight:void 0}})}o(Ml)},A=()=>Ye(t?.typography?.fontFamily),P=()=>I(void 0),O=K0e(n),N=!n?.typography?.customFontSize,z=KKe(n),V=t?.typography?.fontSize,M=r?.typography?.fontSize,D=V??M,L=h(D),j=h(M),q=!Ye(V)&&Ye(M),J=Ne=>{if(!Ne||typeof Ne!="string")return;if(Ne.startsWith("var:preset|font-size|"))return Ne.replace("var:preset|font-size|","");let ln=Ne.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);if(ln)return ln[1]},te=J(D),ee=J(M),$=(Ne,ln)=>{let zc=ln?.slug?`var:preset|font-size|${ln?.slug}`:Ne;o(De(t,["typography","fontSize"],Ye(zc)?zc:void 0))},W=(Ne,ln)=>{if(q&&Ne===void 0&&!ln){ee?$(void 0,{slug:ee}):$(j);return}$(Ne,ln)},Y=()=>Ye(t?.typography?.fontSize),Z=()=>$(void 0),oe=Z0e(n),ne=$Ke(n),X=n?.typography?.fontStyle,re=n?.typography?.fontWeight,ae=h(r?.typography?.fontStyle),ve=h(r?.typography?.fontWeight),xe=h(t?.typography?.fontStyle)??ae,ge=h(t?.typography?.fontWeight)??ve,be=!Ye(t?.typography?.fontStyle)&&!Ye(t?.typography?.fontWeight)&&(Ye(ae)||Ye(ve)),he=(0,fy.useCallback)(({fontStyle:Ne,fontWeight:ln})=>{(Ne!==xe||ln!==ge)&&o({...t,typography:{...t?.typography,fontStyle:Ye(Ne)?Ne:void 0,fontWeight:Ye(ln)?ln:void 0}})},[xe,ge,o,t]),ke=(0,fy.useCallback)(Ne=>{if(be&&Ne.fontStyle===xe&&Ne.fontWeight===ge){o({...t,typography:{...t?.typography,fontStyle:Ye(xe)?xe:void 0,fontWeight:Ye(ge)?ge:void 0}});return}he(Ne)},[be,xe,ge,o,t,he]),_e=()=>Ye(t?.typography?.fontStyle)||Ye(t?.typography?.fontWeight),we=(0,fy.useCallback)(()=>{he({})},[he]),Re=q0e(n),se=h(t?.typography?.lineHeight),ie=h(r?.typography?.lineHeight),Ae=!Ye(t?.typography?.lineHeight)&&Ye(ie),ye=Ne=>{o(De(t,["typography","lineHeight"],Ye(Ne)?Ne:void 0))},Ee=()=>Ye(t?.typography?.lineHeight),qe=()=>ye(void 0),pt=X0e(n),at=h(t?.typography?.letterSpacing),Ct=h(r?.typography?.letterSpacing),rt=!Ye(t?.typography?.letterSpacing)&&Ye(Ct),Ot=Ne=>{o(De(t,["typography","letterSpacing"],Ye(Ne)?Ne:void 0))},ut=()=>Ye(t?.typography?.letterSpacing),Gt=()=>Ot(void 0),So=rCe(n),mo=h(t?.typography?.textIndent),de=h(r?.typography?.textIndent),Me=!Ye(t?.typography?.textIndent)&&Ye(de),ze=(n?.typography?.textIndent??"subsequent")==="all",Je=Ne=>{o(De(t,["typography","textIndent"],Ye(Ne)?Ne:void 0))},lt=Ne=>{o({...t,settings:{typography:{textIndent:Ne?"all":"subsequent"}}})},ct=()=>Ye(t?.typography?.textIndent),yr=()=>{o(De(t,["typography","textIndent"],void 0))},Ao=ze?(0,Cr.__)("Indents the first line of all paragraphs."):(0,Cr.__)("Indents the first line of each paragraph after the first one."),rr=oCe(n),ho=h(t?.typography?.textColumns),Go=h(r?.typography?.textColumns),Vn=!Ye(t?.typography?.textColumns)&&Ye(Go),vr=Ne=>{o(De(t,["typography","textColumns"],Ye(Ne)?Ne:void 0))},an=()=>Ye(t?.typography?.textColumns),it=()=>vr(void 0),_t=Q0e(n),Vt=h(r?.typography?.textTransform),ko=h(t?.typography?.textTransform)??Vt,Wo=!Ye(t?.typography?.textTransform)&&Ye(Vt),nr=Ne=>{o(De(t,["typography","textTransform"],Ye(Ne)?Ne:void 0))},Sa=Ne=>{if(Wo&&Ne===void 0){nr(Vt);return}nr(Ne)},ka=()=>Ye(t?.typography?.textTransform),Ll=()=>nr(void 0),Be=eCe(n),Ft=h(r?.typography?.textDecoration),nt=h(t?.typography?.textDecoration)??Ft,zt=!Ye(t?.typography?.textDecoration)&&Ye(Ft),Ir=Ne=>{o(De(t,["typography","textDecoration"],Ye(Ne)?Ne:void 0))},$o=Ne=>{if(zt&&Ne===void 0){Ir(Ft);return}Ir(Ne)},Sn=()=>Ye(t?.typography?.textDecoration),Wh=()=>Ir(void 0),mF=tCe(n),Dy=h(r?.typography?.writingMode),X1=h(t?.typography?.writingMode)??Dy,Q1=!Ye(t?.typography?.writingMode)&&Ye(Dy),Rx=Ne=>{o(De(t,["typography","writingMode"],Ye(Ne)?Ne:void 0))},hF=Ne=>{if(Q1&&Ne===void 0){Rx(Dy);return}Rx(Ne)},$h=()=>Ye(t?.typography?.writingMode),$e=()=>Rx(void 0),ri=J0e(n),od=h(r?.typography?.textAlign),EY=h(t?.typography?.textAlign)??od,TY=!Ye(t?.typography?.textAlign)&&Ye(od),gF=Ne=>{o(De(t,["typography","textAlign"],Ye(Ne)?Ne:void 0))},VIe=Ne=>{if(TY&&Ne===void 0){gF(od);return}gF(Ne)},RY=()=>Ye(t?.typography?.textAlign),FIe=()=>gF(void 0),zIe=(0,fy.useCallback)(Ne=>g?{...Ne,typography:{},color:{...Ne?.color,text:void 0}}:{...Ne,typography:{}},[g]);return(0,to.jsxs)(e,{resetAllFilter:zIe,value:t,onChange:o,panelId:i,children:[g&&(0,to.jsx)(lh,{label:(0,Cr.__)("Color"),hasValue:y,resetValue:S,isShownByDefault:s.textColor,indicators:[v??b],contrastWarning:u,showInheritanceLabelIndicators:l,isPlaceholder:v===void 0&&b!==void 0,hasInheritedValue:b!==void 0,tabs:[{key:"text",label:(0,Cr.__)("Color"),inheritedValue:b,inheritedSlug:Po(r?.color?.text,"color"),userSlug:Po(t?.color?.text,"color"),setValue:k,userValue:v,isPlaceholder:v===void 0&&b!==void 0}],colorGradientControlSettings:{colors:d,disableCustomColors:!p},panelId:i}),_&&(0,to.jsx)(Lt,{...m(T,A()&&x!==void 0),label:(0,Cr.__)("Font"),hasValue:A,onDeselect:P,isShownByDefault:s.fontFamily,panelId:i,children:(0,to.jsx)(WM,{fontFamilies:B,value:w,onChange:I})}),O&&(0,to.jsx)(Lt,{...m(q,Y()&&M!==void 0),label:(0,Cr.__)("Size"),hasValue:Y,hasInlineEndToggle:!0,onDeselect:Z,isShownByDefault:s.fontSize,panelId:i,children:(0,to.jsx)(vl.FontSizePicker,{value:te||L,valueMode:te?"slug":"literal",onChange:W,fontSizes:z,disableCustomFontSizes:N,withReset:!1,withSlider:!0})}),oe&&(0,to.jsx)(Lt,{...m(be,_e()&&(ae!==void 0||ve!==void 0)),label:ne,hasValue:_e,onDeselect:we,isShownByDefault:s.fontAppearance,panelId:i,children:(0,to.jsx)(GM,{value:{fontStyle:xe,fontWeight:ge},onChange:ke,hasFontStyles:X,hasFontWeights:re,fontFamilyFaces:R})}),Re&&(0,to.jsx)(Lt,{...m(Ae,Ee()&&ie!==void 0,"single-column"),label:(0,Cr.__)("Line height"),hasValue:Ee,onDeselect:qe,isShownByDefault:s.lineHeight,panelId:i,children:(0,to.jsx)(IN,{__unstableInputWidth:"auto",value:se??ie,onChange:ye,...Ae?{placeholder:XW(ie)}:{}})}),pt&&(0,to.jsx)(Lt,{...m(rt,ut()&&Ct!==void 0,"single-column"),label:(0,Cr.__)("Letter spacing"),hasValue:ut,onDeselect:Gt,isShownByDefault:s.letterSpacing,panelId:i,children:(0,to.jsx)(KM,{value:at??Ct,onChange:Ot,__unstableInputWidth:"auto",placeholder:rt?XW(Ct):void 0})}),So&&(0,to.jsxs)(Lt,{...m(Me,ct()&&de!==void 0),label:(0,Cr.__)("Line indent"),hasValue:ct,onDeselect:yr,isShownByDefault:s.textIndent,panelId:i,children:[(0,to.jsx)(L0e,{value:mo??de,onChange:Je,__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a,placeholder:Me?XW(de):void 0}),a&&(0,to.jsx)(vl.ToggleControl,{label:(0,Cr.__)("Indent all paragraphs"),checked:ze,onChange:lt,help:Ao})]}),rr&&(0,to.jsx)(Lt,{...m(Vn,an()&&Go!==void 0,"single-column"),label:(0,Cr.__)("Columns"),hasValue:an,onDeselect:it,isShownByDefault:s.textColumns,panelId:i,children:(0,to.jsx)(vl.__experimentalNumberControl,{label:(0,Cr.__)("Columns"),max:GKe,min:UKe,onChange:vr,placeholder:Vn?Go:void 0,spinControls:"custom",value:ho,initialPosition:1})}),Be&&(0,to.jsx)(Lt,{...m(zt,Sn()&&Ft!==void 0,"single-column"),label:(0,Cr.__)("Decoration"),hasValue:Sn,onDeselect:Wh,isShownByDefault:s.textDecoration,panelId:i,children:(0,to.jsx)(qM,{value:nt,onChange:$o,size:"__unstable-large",__unstableInputWidth:"auto"})}),mF&&(0,to.jsx)(Lt,{...m(Q1,$h()&&Dy!==void 0,"single-column"),label:(0,Cr.__)("Orientation"),hasValue:$h,onDeselect:$e,isShownByDefault:s.writingMode,panelId:i,children:(0,to.jsx)(JM,{value:X1,onChange:hF,size:"__unstable-large"})}),_t&&(0,to.jsx)(Lt,{...m(Wo,ka()&&Vt!==void 0),label:(0,Cr.__)("Letter case"),hasValue:ka,onDeselect:Ll,isShownByDefault:s.textTransform,panelId:i,children:(0,to.jsx)(XM,{value:ko,onChange:Sa,showNone:!0,isBlock:!0,size:"__unstable-large"})}),ri&&(0,to.jsxs)(Lt,{...m(TY,RY()&&od!==void 0),label:(0,Cr.__)("Text alignment"),hasValue:RY,onDeselect:FIe,isShownByDefault:s.textAlign,panelId:i,children:[(0,to.jsx)(mD,{value:EY,onChange:VIe,options:["left","center","right","justify"],size:"__unstable-large"}),EY==="justify"&&(0,to.jsx)("div",{children:(0,to.jsx)(vl.Notice,{status:"warning",isDismissible:!1,children:(0,Cr.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var jo=c(G(),1),ei=c(U(),1);var CD=c(F(),1);var oo=c(U(),1),pr=c(G(),1),iCe=c(F(),1),kD=c(Q(),1);var nCe=c(Q(),1);function py(e,t){let{getBlockOrder:o,getBlockAttributes:r}=(0,nCe.useSelect)(C);return(i,s)=>{let a=(s-1)*t+i-1,l=0;for(let u of o(e)){let{columnStart:d,rowStart:f}=r(u).style?.layout??{};(f-1)*t+d-1!!i,f=a==="horizontal"?(0,pr.__)("Width"):(0,pr.__)("Height"),[p]=Le("spacing.units"),h=(0,oo.__experimentalUseCustomUnits)({availableUnits:p||["%","px","em","rem","vh","vw"]}),m=()=>{t({selfStretch:void 0,flexSize:void 0})};return(0,iCe.useEffect)(()=>{JW(i)&&!s&&t({...e,selfStretch:Jn.fit})},[]),(0,Qo.jsxs)(oo.__experimentalVStack,{as:oo.__experimentalToolsPanelItem,spacing:2,hasValue:d,label:f,onDeselect:m,isShownByDefault:r,panelId:n,children:[(0,Qo.jsxs)(oo.__experimentalToggleGroupControl,{label:eYe(o),value:l,help:QKe(l,o),onChange:g=>{let b=JW(g)?s:null;t({selfStretch:g,flexSize:b})},isBlock:!0,children:[(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.fit,label:(0,pr._x)("Fit","Intrinsic block width in flex layout")},Jn.fit),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.grow,label:(0,pr._x)("Grow","Block with expanding width in flex layout")},Jn.grow),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.max,label:XKe(o)},Jn.max),(0,Qo.jsx)(oo.__experimentalToggleGroupControlOption,{value:Jn.fixed,label:(0,pr._x)("Fixed","Block with fixed width in flex layout")},Jn.fixed)]}),u&&(0,Qo.jsx)(oo.__experimentalUnitControl,{units:h,onChange:g=>{t({selfStretch:l,flexSize:g})},value:s,min:0,label:f,hideLabelFromVision:!0})]})}function eYe(e){let{orientation:t="horizontal"}=e??{};return t==="horizontal"?(0,pr.__)("Width"):(0,pr.__)("Height")}function tYe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n,showGridSpanDefaults:i}){let{columnStart:s,rowStart:a,columnSpan:l,rowSpan:u}=e,{columnCount:d,rowCount:f}=o??{},p=(0,kD.useSelect)(T=>T(C).getBlockRootClientId(n)),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:m}=(0,kD.useDispatch)(C),g=py(p,d||3),b=()=>!!s||!!a,v=()=>!!l||!!u,y=()=>{t({columnStart:void 0,rowStart:void 0})},k=()=>{t({columnSpan:void 0,rowSpan:void 0})},S=d?d-(s??1)+1:void 0,_=window.__experimentalEnableGridInteractivity&&f?f-(a??1)+1:void 0,x=l??(i?1:void 0),w=u??(i?1:void 0);return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsxs)(oo.Flex,{as:oo.__experimentalToolsPanelItem,hasValue:v,label:(0,pr.__)("Grid span"),onDeselect:k,isShownByDefault:r,panelId:n,children:[(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Column span"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10),R=S?Math.min(B,S):B;t({columnStart:s,rowStart:a,rowSpan:u,columnSpan:R})},value:x,min:1,max:S})}),(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Row span"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10),R=_?Math.min(B,_):B;t({columnStart:s,rowStart:a,columnSpan:l,rowSpan:R})},value:w,min:1,max:_})})]}),window.__experimentalEnableGridInteractivity&&(0,Qo.jsxs)(oo.Flex,{as:oo.__experimentalToolsPanelItem,hasValue:b,label:(0,pr.__)("Grid placement"),onDeselect:y,isShownByDefault:!1,panelId:n,children:[(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Column"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10);t({columnStart:B,rowStart:a,columnSpan:l,rowSpan:u}),m(),h([n],p,p,g(B,a))},value:s??1,min:1,max:d?d-(l??1)+1:void 0})}),(0,Qo.jsx)(oo.FlexItem,{style:{width:"50%"},children:(0,Qo.jsx)(oo.__experimentalInputControl,{label:(0,pr.__)("Row"),type:"number",onChange:T=>{let B=T===""?1:parseInt(T,10);t({columnStart:s,rowStart:B,columnSpan:l,rowSpan:u}),m(),h([n],p,p,g(s,B))},value:a??1,min:1,max:f?f-(u??1)+1:void 0})})]})]})}var aCe=c(U(),1),D_=c(G(),1);var e$=c(E(),1);function _D({panelId:e,value:t,onChange:o=()=>{},options:r,defaultValue:n="auto",hasValue:i,isShownByDefault:s=!0,className:a,isInherited:l,hasLocalOverride:u}){let d=t??"auto",[f,p,h]=Le("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),m=p?.map(({name:v,ratio:y})=>({label:v,value:y})),g=f?.map(({name:v,ratio:y})=>({label:v,value:y})),b=[{label:(0,D_._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...h?g:[],...m||[],{label:(0,D_._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,e$.jsx)(Lt,{className:a,isInherited:l,hasLocalOverride:u,hasValue:i||(()=>d!==n),label:(0,D_.__)("Aspect ratio"),onDeselect:()=>o(void 0),isShownByDefault:s,panelId:e,children:(0,e$.jsx)(aCe.SelectControl,{label:(0,D_.__)("Aspect ratio"),value:d,options:r??b,onChange:o})})}var Dt=c(E(),1),t$=["horizontal","vertical"];function lCe(e,t){return e?.length===1?!1:t?!(e?.includes("horizontal")&&e?.includes("vertical")&&e?.length===2):!0}function ED(e,t=Js){return fCe(e)||pCe(e)||mCe(e)||hCe(e)||gCe(e)||bCe(e)||yCe(e)||vCe(e)||SCe(e)||kCe(e,t)||_Ce(e,t)}function fCe(e){return e?.layout?.contentSize}function pCe(e){return e?.layout?.wideSize}function mCe(e){return e?.spacing?.padding}function hCe(e){return e?.spacing?.margin}function gCe(e){return e?.spacing?.blockGap}function bCe(e){return e?.dimensions?.height}function yCe(e){return e?.dimensions?.minHeight}function vCe(e){return e?.dimensions?.minWidth}function SCe(e){return e?.dimensions?.width}function kCe(e,t=Js){return!ea(t)&&e?.dimensions?.aspectRatio}function _Ce(e,t=Js){if(ea(t))return!1;let{type:o="default",default:{type:r="default"}={},allowSizingOnChildren:n=!1}=e?.parentLayout??{},i=(r==="flex"||o==="flex"||r==="grid"||o==="grid")&&n;return!!e?.layout&&i}function oYe(e){let{defaultSpacingSizes:t,spacingSizes:o}=e?.spacing||{};return t!==!1&&o?.default?.length>0||o?.theme?.length>0||o?.custom?.length>0}function cCe(e,t){if(!t||!e)return e;let o={};return t.forEach(r=>{r==="vertical"&&(o.top=e.top,o.bottom=e.bottom),r==="horizontal"&&(o.left=e.left,o.right=e.right),o[r]=e?.[r]}),o}var rYe=[void 0,null,""];function dt(e){return!rYe.includes(e)}function xD(e){if(!dt(e))return;let[t]=(0,ei.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}function wD(e){return dt(e)&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function uCe(e){if(!dt(e))return;if(typeof e=="string")return e!==""?e:void 0;if(typeof e!="object")return;let o=["top","right","bottom","left"].map(i=>e[i]);if(!o.every(dt))return;let n=o[0];return o.every(i=>i===n)?n:void 0}function dCe(e){return dt(e)?typeof e=="string"?e!=="":typeof e!="object"?!1:["top","right","bottom","left"].some(t=>dt(e[t])):!1}function nYe(e,t){return dt(e)?typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}function iYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,Dt.jsx)(ei.__experimentalToolsPanel,{label:(0,jo.__)("Dimensions"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var Sl={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,minWidth:!0,width:!0,aspectRatio:!0,childLayout:!0};function TD({as:e=iYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=Sl,onVisualize:a=()=>{},includeLayoutControls:l=!1,styleState:u=Js,showInheritanceLabelIndicators:d=gn()}){let{dimensions:f,spacing:p}=n,h=$e=>$e&&typeof $e=="object"?Object.keys($e).reduce((ri,od)=>(ri[od]=Ea({settings:{dimensions:f,spacing:p}},"",$e[od]),ri),{}):Ea({settings:{dimensions:f,spacing:p}},"",$e),m=($e,ri,od)=>yl(d&&$e,d&&ri,od),g=oYe(n),b=(0,ei.__experimentalUseCustomUnits)({availableUnits:n?.spacing?.units||["%","px","em","rem","vw"]}),v=-1/0,[y,k]=(0,CD.useState)(v),S=(0,CD.useCallback)($e=>({...$e,layout:Ge({...$e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...$e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...$e?.dimensions,height:void 0,minHeight:void 0,minWidth:void 0,aspectRatio:void 0,width:void 0}}),[]),_=fCe(n)&&l,x=h(t?.layout?.contentSize),w=h(r?.layout?.contentSize),T=!dt(t?.layout?.contentSize)&&dt(w),B=$e=>{o(De(t,["layout","contentSize"],dt($e)?$e:void 0))},R=()=>dt(t?.layout?.contentSize),I=()=>B(void 0),A=pCe(n)&&l,P=h(t?.layout?.wideSize),O=h(r?.layout?.wideSize),N=!dt(t?.layout?.wideSize)&&dt(O),z=$e=>{o(De(t,["layout","wideSize"],dt($e)?$e:void 0))},V=()=>dt(t?.layout?.wideSize),M=()=>z(void 0),D=mCe(n),L=wD(h(r?.spacing?.padding)),j=wD(h(t?.spacing?.padding)),q=dt(t?.spacing?.padding)?j:L,J=uCe(L),te=!dt(t?.spacing?.padding)&&J!==void 0,ee=dCe(L),$=!dt(t?.spacing?.padding)&&ee,W=Array.isArray(n?.spacing?.padding)?n?.spacing?.padding:n?.spacing?.padding?.sides,Y=W&&W.some($e=>t$.includes($e)),Z=$e=>{let ri=cCe($e,W);o(De(t,["spacing","padding"],ri))},oe=()=>dt(t?.spacing?.padding)&&Object.keys(t?.spacing?.padding).length,ne=()=>Z(void 0),X=()=>a("padding"),re=hCe(n),ae=wD(h(r?.spacing?.margin)),ve=wD(h(t?.spacing?.margin)),xe=dt(t?.spacing?.margin)?ve:ae,ge=uCe(ae),be=!dt(t?.spacing?.margin)&&ge!==void 0,he=dCe(ae),ke=!dt(t?.spacing?.margin)&&he,_e=Array.isArray(n?.spacing?.margin)?n?.spacing?.margin:n?.spacing?.margin?.sides,we=_e&&_e.some($e=>t$.includes($e)),Re=$e=>{let ri=cCe($e,_e);o(De(t,["spacing","margin"],ri))},se=()=>dt(t?.spacing?.margin)&&Object.keys(t?.spacing?.margin).length,ie=()=>Re(void 0),Ae=()=>a("margin"),ye=gCe(n),Ee=Array.isArray(n?.spacing?.blockGap)?n?.spacing?.blockGap:n?.spacing?.blockGap?.sides,qe=Ee&&Ee.some($e=>t$.includes($e)),pt=h(t?.spacing?.blockGap),at=h(r?.spacing?.blockGap),Ct=dt(t?.spacing?.blockGap)?pt:at,rt=nYe(Ct,qe),Ot=!dt(t?.spacing?.blockGap)&&typeof at=="string"&&at!=="",ut=$e=>{o(De(t,["spacing","blockGap"],$e))},Gt=$e=>{dt($e)||ut(null),!qe&&$e?.hasOwnProperty("top")?ut($e.top):ut({top:$e?.top,left:$e?.left})},So=()=>ut(void 0),mo=()=>dt(t?.spacing?.blockGap),de=yCe(n),Me=h(t?.dimensions?.minHeight),Ze=h(r?.dimensions?.minHeight),ze=!dt(t?.dimensions?.minHeight)&&dt(Ze),Je=$e=>{let ri=De(t,["dimensions","minHeight"],$e);o(De(ri,["dimensions","aspectRatio"],void 0))},lt=()=>{Je(void 0)},ct=()=>dt(t?.dimensions?.minHeight),yr=bCe(n),Ao=h(t?.dimensions?.height),rr=h(r?.dimensions?.height),ho=!dt(t?.dimensions?.height)&&dt(rr),Go=$e=>{let ri=De(t,["dimensions","height"],$e);o(De(ri,["dimensions","aspectRatio"],void 0))},Vn=()=>{Go(void 0)},vr=()=>dt(t?.dimensions?.height),an=vCe(n),it=h(t?.dimensions?.minWidth),_t=h(r?.dimensions?.minWidth),Vt=!dt(t?.dimensions?.minWidth)&&dt(_t),ko=$e=>{o(De(t,["dimensions","minWidth"],$e))},Wo=()=>{ko(void 0)},nr=()=>dt(t?.dimensions?.minWidth),Sa=SCe(n),ka=h(t?.dimensions?.width),Ll=h(r?.dimensions?.width),Be=!dt(t?.dimensions?.width)&&dt(Ll),Ft=$e=>{o(De(t,["dimensions","width"],$e))},nt=()=>{Ft(void 0)},zt=()=>dt(t?.dimensions?.width),Ir=kCe(n,u),$o=h(t?.dimensions?.aspectRatio),Sn=h(r?.dimensions?.aspectRatio),Wh=$o??Sn,mF=!dt(t?.dimensions?.aspectRatio)&&dt(Sn),Dy=$e=>{let ri=De(t,["dimensions","aspectRatio"],$e);o(De(ri,["dimensions","minHeight"],void 0))},X1=()=>dt(t?.dimensions?.aspectRatio),Q1=_Ce(n,u),Rx=t?.layout,hF=$e=>{o({...t,layout:{...t?.layout,...$e}})},$h=()=>a(!1);return(0,Dt.jsxs)(e,{resetAllFilter:S,value:t,onChange:o,panelId:i,children:[(_||A)&&(0,Dt.jsx)("span",{className:"span-columns",children:(0,jo.__)("Set the width of the main content area.")}),_&&(0,Dt.jsx)(Lt,{...m(T,R()&&w!==void 0),label:(0,jo.__)("Content width"),hasValue:R,onDeselect:I,isShownByDefault:s.contentSize??Sl.contentSize,panelId:i,children:(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Content width"),labelPosition:"top",value:x??w,placeholder:T?xD(w):void 0,onChange:$e=>{B($e)},units:b,prefix:(0,Dt.jsx)(ei.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Dt.jsx)(gt,{icon:Jh})})})}),A&&(0,Dt.jsx)(Lt,{...m(N,V()&&O!==void 0),label:(0,jo.__)("Wide width"),hasValue:V,onDeselect:M,isShownByDefault:s.wideSize??Sl.wideSize,panelId:i,children:(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Wide width"),labelPosition:"top",value:P??O,placeholder:N?xD(O):void 0,onChange:$e=>{z($e)},units:b,prefix:(0,Dt.jsx)(ei.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Dt.jsx)(gt,{icon:fg})})})}),D&&(0,Dt.jsxs)(Lt,{hasValue:oe,label:(0,jo.__)("Padding"),hasInlineEndToggle:lCe(W,g),onDeselect:ne,isShownByDefault:s.padding??Sl.padding,...m($,oe()&&ee,{"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,Dt.jsx)(ei.BoxControl,{values:j,onChange:Z,label:(0,jo.__)("Padding"),sides:W,units:b,allowReset:!1,splitOnAxis:Y,inputProps:{onMouseOver:X,onMouseOut:$h,placeholder:te?J:void 0}}),g&&(0,Dt.jsx)(P_,{values:q,onChange:Z,label:(0,jo.__)("Padding"),sides:W,units:b,allowReset:!1,onMouseOver:X,onMouseOut:$h})]}),re&&(0,Dt.jsxs)(Lt,{hasValue:se,label:(0,jo.__)("Margin"),hasInlineEndToggle:lCe(_e,g),onDeselect:ie,isShownByDefault:s.margin??Sl.margin,...m(ke,se()&&he,{"tools-panel-item-spacing":g}),panelId:i,children:[!g&&(0,Dt.jsx)(ei.BoxControl,{values:ve,onChange:Re,inputProps:{min:y,onDragStart:()=>{k(0)},onDragEnd:()=>{k(v)},onMouseOver:Ae,onMouseOut:$h,placeholder:be?ge:void 0},label:(0,jo.__)("Margin"),sides:_e,units:b,allowReset:!1,splitOnAxis:we}),g&&(0,Dt.jsx)(P_,{values:xe,onChange:Re,minimumCustomValue:-1/0,label:(0,jo.__)("Margin"),sides:_e,units:b,allowReset:!1,onMouseOver:Ae,onMouseOut:$h})]}),ye&&(0,Dt.jsxs)(Lt,{hasValue:mo,label:(0,jo.__)("Block spacing"),hasInlineEndToggle:qe,onDeselect:So,isShownByDefault:s.blockGap??Sl.blockGap,...m(Ot,mo()&&at!==void 0,{"tools-panel-item-spacing":g,"single-column":!g&&!qe}),panelId:i,children:[!g&&(qe?(0,Dt.jsx)(ei.BoxControl,{label:(0,jo.__)("Block spacing"),min:0,onChange:Gt,units:b,sides:Ee,values:rt,allowReset:!1,splitOnAxis:qe}):(0,Dt.jsx)(ei.__experimentalUnitControl,{label:(0,jo.__)("Block spacing"),min:0,onChange:ut,units:b,value:pt??void 0,placeholder:Ot?at:void 0})),g&&(0,Dt.jsx)(P_,{label:(0,jo.__)("Block spacing"),min:0,onChange:Gt,showSideInLabel:!1,sides:qe?Ee:["top"],values:rt,allowReset:!1})]}),Q1&&(0,Dt.jsx)(sCe,{value:Rx,onChange:hF,parentLayout:n?.parentLayout,panelId:i,showGridSpanDefaults:!Hi(u),isShownByDefault:s.childLayout??Sl.childLayout}),de&&(0,Dt.jsx)(Lt,{...m(ze,ct()&&Ze!==void 0),hasValue:ct,label:(0,jo.__)("Minimum height"),onDeselect:lt,isShownByDefault:s.minHeight??Sl.minHeight,panelId:i,children:(0,Dt.jsx)(qb,{label:(0,jo.__)("Minimum height"),value:Me??Ze,onChange:Je,placeholder:ze?xD(Ze):void 0,dimensionSizes:f?.dimensionSizes})}),an&&(0,Dt.jsx)(Lt,{...m(Vt,nr()&&_t!==void 0),hasValue:nr,label:(0,jo.__)("Minimum width"),onDeselect:Wo,isShownByDefault:s.minWidth??Sl.minWidth,panelId:i,children:(0,Dt.jsx)(qb,{label:(0,jo.__)("Minimum width"),value:it??_t,onChange:ko,placeholder:Vt?xD(_t):void 0,dimensionSizes:f?.dimensionSizes})}),yr&&(0,Dt.jsx)(Lt,{...m(ho,vr()&&rr!==void 0),hasValue:vr,label:(0,jo.__)("Height"),onDeselect:Vn,isShownByDefault:s.height??Sl.height,panelId:i,children:(0,Dt.jsx)(qb,{label:(0,jo.__)("Height"),value:Ao,onChange:Go,placeholder:ho?rr:void 0,dimensionSizes:f?.dimensionSizes})}),Sa&&(0,Dt.jsx)(Lt,{...m(Be,zt()&&Ll!==void 0),hasValue:zt,label:(0,jo.__)("Width"),onDeselect:nt,isShownByDefault:s.width??Sl.width,panelId:i,children:(0,Dt.jsx)(qb,{label:(0,jo.__)("Width"),value:ka,onChange:Ft,placeholder:Be?Ll:void 0,dimensionSizes:f?.dimensionSizes})}),Ir&&(0,Dt.jsx)(_D,{hasValue:X1,value:Wh,onChange:Dy,panelId:i,...m(mF,X1()&&Sn!==void 0),isShownByDefault:s.aspectRatio??Sl.aspectRatio})]})}var vi=c(U(),1),Vu=c(F(),1),V_=c(G(),1);var my=c(G(),1),bn=c(U(),1),BD=c(F(),1);var fo=c(E(),1),RD=[];function sYe({shadow:e,onShadowChange:t,settings:o}){let r=o$(o);return(0,fo.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,fo.jsxs)(bn.__experimentalVStack,{spacing:4,children:[(0,fo.jsx)(bn.__experimentalHeading,{level:5,children:(0,my.__)("Drop shadow")}),(0,fo.jsx)(aYe,{presets:r,activeShadow:e,onSelect:t}),(0,fo.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,my.__)("Clear")})})]})})}function aYe({presets:e,activeShadow:t,onSelect:o}){return e?(0,fo.jsx)(bn.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,my.__)("Drop shadows"),children:e.map(({name:r,slug:n,shadow:i})=>(0,fo.jsx)(lYe,{label:r,isActive:i===t,type:n==="unset"?"unset":"preset",onSelect:()=>o(i===t?void 0:i),shadow:i},n))}):null}function lYe({type:e,label:t,isActive:o,onSelect:r,shadow:n}){return(0,fo.jsxs)(kt.Root,{children:[(0,fo.jsx)(kt.Trigger,{render:(0,fo.jsx)(bn.Composite.Item,{role:"option","aria-label":t,"aria-selected":o,className:K("block-editor-global-styles__shadow__item",{"is-active":o}),render:(0,fo.jsx)("button",{className:K("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:r,style:{boxShadow:n},"aria-label":t,children:o&&(0,fo.jsx)(gt,{icon:ns})})})}),(0,fo.jsx)(kt.Popup,{children:t})]})}function xCe({shadow:e,onShadowChange:t,settings:o,className:r,hasLocalValue:n=!!e,hasLocalOverride:i=!1,onReset:s}){return(0,fo.jsx)(bn.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:K("block-editor-global-styles__shadow-dropdown",r),renderToggle:cYe(e,t,{hasLocalValue:n,hasLocalOverride:i,onReset:s??(()=>t(void 0))}),renderContent:()=>(0,fo.jsx)(bn.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,fo.jsx)(sYe,{shadow:e,onShadowChange:t,settings:o})})})}function cYe(e,t,o){let{hasLocalValue:r,hasLocalOverride:n,onReset:i}=o;return function({onToggle:a,isOpen:l}){let u=(0,BD.useRef)(void 0),d={onClick:a,className:K("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":l}),"aria-expanded":l,ref:u},f=()=>{l&&a(),i(),u.current?.focus()};return(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,...d,children:(0,fo.jsxs)(bn.__experimentalHStack,{justify:"flex-start",children:[(0,fo.jsx)(gt,{className:"block-editor-global-styles__toggle-icon",icon:r6,size:24}),(0,fo.jsx)(bn.FlexItem,{children:(0,my.__)("Drop shadow")})]})}),r&&(n?(0,fo.jsx)(_f,{className:"block-editor-global-styles__shadow-editor__remove-button",onResetToInherited:f}):(0,fo.jsx)(bn.Button,{__next40pxDefaultSize:!0,size:"small",icon:dn,label:(0,my.__)("Remove"),className:"block-editor-global-styles__shadow-editor__remove-button",onClick:f}))]})}}function o$(e){return(0,BD.useMemo)(()=>{if(!e?.shadow)return RD;let t=e?.shadow?.defaultPresets,{default:o,theme:r,custom:n}=e?.shadow?.presets??{},i={name:(0,my.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&o||RD,...r||RD,...n||RD];return s.length&&s.unshift(i),s},[e])}var kl=c(E(),1);function PD(e){return Object.values(e1(e)).some(Boolean)}function e1(e){return{hasBorderColor:wCe(e),hasBorderRadius:CCe(e),hasBorderStyle:ECe(e),hasBorderWidth:TCe(e),hasShadow:RCe(e)}}function wCe(e){return e?.border?.color}function CCe(e){return e?.border?.radius}function ECe(e){return e?.border?.style}function TCe(e){return e?.border?.width}function RCe(e){let t=o$(e);return!!e?.shadow&&t.length>0}function uYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=xr();return(0,kl.jsx)(vi.__experimentalToolsPanel,{label:i,resetAll:()=>{let l=e(o);t(l)},panelId:r,dropdownMenuProps:s,children:n})}var dYe={radius:!0,color:!0,width:!0,shadow:!0};function ID({as:e=uYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,name:s,defaultControls:a=dYe,showInheritanceLabelIndicators:l=gn()}){let u=Du(n),d=n?.color?.custom,f=(0,Vu.useCallback)(X=>Ea({settings:n},"",X),[n]),p=(X,re,ae)=>yl(l&&X,l&&re,ae),h=X=>{let ae=u.flatMap(({colors:ve})=>ve).find(({color:ve})=>ve===X);return ae?"var:preset|color|"+ae.slug:X},m=(0,Vu.useCallback)(X=>{if(X){if((0,vi.__experimentalHasSplitBorders)(X)){let re={...X};return["top","right","bottom","left"].forEach(ae=>{re[ae]={...re[ae],color:f(re[ae]?.color)}}),re}return{...X,color:X.color?f(X.color):void 0}}},[f]),g=(0,Vu.useMemo)(()=>m(t?.border),[t?.border,m]),b=(0,Vu.useMemo)(()=>m(r?.border),[r?.border,m]),v=!(0,vi.__experimentalIsDefinedBorder)(t?.border)&&!!b&&(0,vi.__experimentalIsDefinedBorder)(b),y=v?b:g,k=X=>o({...t,border:X}),S=wCe(n),_=ECe(n),x=TCe(n),w=CCe(n),T=(0,Vu.useMemo)(()=>typeof t?.border?.radius!="object"?f(t?.border?.radius):{topLeft:f(t?.border?.radius?.topLeft),topRight:f(t?.border?.radius?.topRight),bottomLeft:f(t?.border?.radius?.bottomLeft),bottomRight:f(t?.border?.radius?.bottomRight)},[t?.border?.radius,f]),B=(0,Vu.useMemo)(()=>{let X=r?.border?.radius;return typeof X!="object"?f(X):{topLeft:f(X?.topLeft),topRight:f(X?.topRight),bottomLeft:f(X?.bottomLeft),bottomRight:f(X?.bottomRight)}},[r?.border?.radius,f]),R=X=>k({...t?.border,radius:X}),I=()=>{let X=t?.border?.radius;return typeof X=="object"?Object.entries(X).some(([,re])=>!!re):!!X},A=!I()&&B!==void 0&&B!=="",P=(0,Vu.useMemo)(()=>{if(!A)return T;if(typeof B=="string")return B;let X=B;return X?{all:X.topLeft&&X.topLeft===X.topRight&&X.topLeft===X.bottomLeft&&X.topLeft===X.bottomRight?X.topLeft:void 0,...X}:T},[A,T,B]),O=RCe(n),N=f(t?.shadow),z=f(r?.shadow),V=N===void 0&&z!==void 0&&z!=="",M=V?z:N,D=n?.shadow?.presets??{},L=D.custom??D.theme??D.default??[],j=X=>{let re=L?.find(({shadow:ae})=>ae===X)?.slug;o(De(t,["shadow"],re?`var:preset|shadow|${re}`:X||void 0))},q=X=>{if(V&&X===void 0){j(z);return}j(X)},J=()=>!!t?.shadow,te=()=>j(void 0),ee=l&&J()&&z!==void 0,$=()=>{if(I())return k({radius:t?.border?.radius});k(void 0)},W=X=>{let re={...X};(0,vi.__experimentalHasSplitBorders)(re)?["top","right","bottom","left"].forEach(ae=>{re[ae]&&(re[ae]={...re[ae],color:h(re[ae]?.color)})}):re&&(re.color=h(re.color)),k({...re,radius:t?.border?.radius})},Y=(0,Vu.useCallback)(X=>({...X,border:void 0,shadow:void 0}),[]),Z=a?.color||a?.width,oe=S||_||x||w,ne=hy({blockName:s,hasShadowControl:O,hasBorderControl:oe});return(0,kl.jsxs)(e,{resetAllFilter:Y,value:t,onChange:o,panelId:i,label:ne,children:[(x||S)&&(0,kl.jsxs)(Lt,{...p(v,(0,vi.__experimentalIsDefinedBorder)(t?.border)&&!!b&&(0,vi.__experimentalIsDefinedBorder)(b)),hasValue:()=>(0,vi.__experimentalIsDefinedBorder)(t?.border),label:(0,V_.__)("Border"),onDeselect:()=>$(),isShownByDefault:Z,panelId:i,children:[(l||O)&&(0,kl.jsx)(vi.BaseControl.VisualLabel,{as:"legend",children:(0,V_.__)("Border")}),(0,kl.jsx)(vi.BorderBoxControl,{colors:u,disableCustomColors:!d,enableAlpha:!0,enableStyle:_,onChange:W,popoverOffset:40,popoverPlacement:"left-start",value:y,__experimentalIsRenderedInSidebar:!0})]}),w&&(0,kl.jsx)(Lt,{...p(A,I()&&B!==void 0),hasValue:I,label:(0,V_.__)("Radius"),hasInlineEndToggle:!0,onDeselect:()=>R(void 0),isShownByDefault:a.radius,panelId:i,children:(0,kl.jsx)(FM,{presets:n?.border?.radiusSizes,values:P,onChange:X=>{R(X||void 0)}})}),O&&(0,kl.jsxs)(Lt,{...p(V,J()&&z!==void 0),label:(0,V_.__)("Shadow"),hasValue:J,onDeselect:te,isShownByDefault:a.shadow,showLocalOverrideActionsInLabel:!1,panelId:i,children:[oe?(0,kl.jsx)(vi.BaseControl.VisualLabel,{as:"legend",children:(0,V_.__)("Shadow")}):null,(0,kl.jsx)(xCe,{shadow:M,onShadowChange:q,settings:n,hasLocalValue:J(),hasLocalOverride:ee,onReset:te})]})]})}var Ho=c(U(),1),wf=c(G(),1),F_=c(F(),1);var mr=c(E(),1),OD=[];function BCe(e,{presetSetting:t,defaultSetting:o}){let r=!e?.color?.[o],n=e?.color?.[t]?.custom||OD,i=e?.color?.[t]?.theme||OD,s=e?.color?.[t]?.default||OD;return(0,F_.useMemo)(()=>[...n,...i,...r?OD:s],[r,n,i,s])}function PCe(e){return ICe(e)}function ICe(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function fYe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=xr(),s=()=>{let a=e(o);t(a)};return(0,mr.jsx)(Ho.__experimentalToolsPanel,{label:(0,wf._x)("Filters","Name for applying graphical effects"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var pYe={duotone:!0},mYe={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,wf.__)("Duotone")},hYe=({indicator:e,label:t})=>(0,mr.jsxs)(Ho.__experimentalHStack,{justify:"flex-start",children:[(0,mr.jsx)(Ho.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,mr.jsx)(Ho.Flex,{expanded:!1,children:e==="unset"||!e?(0,mr.jsx)(Ho.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):(0,mr.jsx)(Ho.DuotoneSwatch,{values:e})})}),(0,mr.jsx)(Ho.FlexItem,{className:"block-editor-panel-duotone-settings__label",title:t,children:t})]}),gYe=(e,t)=>function({onToggle:r,isOpen:n}){let{hasLocalValue:i,hasLocalOverride:s,onReset:a}=t,l=(0,F_.useRef)(void 0),u={onClick:r,className:K("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:l},d=()=>{n&&r(),a(),l.current?.focus()};return(0,mr.jsxs)(mr.Fragment,{children:[(0,mr.jsx)(Ho.Button,{__next40pxDefaultSize:!0,...u,children:(0,mr.jsx)(hYe,{indicator:e,label:(0,wf.__)("Duotone")})}),i&&(s?(0,mr.jsx)(_f,{className:"block-editor-panel-duotone-settings__reset",onResetToInherited:d}):(0,mr.jsx)(Ho.Button,{size:"small",icon:dn,label:(0,wf.__)("Reset"),className:"block-editor-panel-duotone-settings__reset",onClick:d}))]})};function AD({as:e=fYe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=pYe,showInheritanceLabelIndicators:a=gn()}){let l=w=>Ea({settings:n},"",w),u=(w,T,B)=>yl(a&&w,a&&T,B),d=ICe(n),f=BCe(n,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),p=BCe(n,{presetSetting:"palette",defaultSetting:"defaultPalette"}),h=l(t?.filter?.duotone),m=l(r?.filter?.duotone),g=h??m,b=h===void 0&&m!==void 0,v=w=>{let T=f.find(({colors:R})=>R===w),B=T?`var:preset|duotone|${T.slug}`:w;o(De(t,["filter","duotone"],B))},y=w=>{if(w===void 0&&b&&m!==void 0){v(m);return}v(w)},k=()=>!!t?.filter?.duotone,S=()=>v(void 0),_=a&&k()&&m!==void 0,x=(0,F_.useCallback)(w=>({...w,filter:{...w.filter,duotone:void 0}}),[]);return(0,mr.jsx)(e,{resetAllFilter:x,value:t,onChange:o,panelId:i,children:d&&(0,mr.jsx)(Lt,{...u(b,h!==void 0&&m!==void 0),label:(0,wf.__)("Duotone"),hasValue:k,onDeselect:S,isShownByDefault:s.duotone,showLocalOverrideActionsInLabel:!1,panelId:i,children:(0,mr.jsx)(Ho.Dropdown,{popoverProps:mYe,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:gYe(g,{hasLocalValue:k(),hasLocalOverride:_,onReset:S}),renderContent:()=>(0,mr.jsx)(Ho.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,mr.jsxs)(Ho.MenuGroup,{label:(0,wf.__)("Duotone"),children:[(0,mr.jsx)("p",{children:(0,wf.__)("Create a two-tone color effect without losing your original image.")}),(0,mr.jsx)(Ho.DuotonePicker,{colorPalette:p,duotonePalette:f,disableCustomColors:!0,disableCustomDuotone:!0,value:g,onChange:y})]})})})})})}var z_=c(U(),1),t1=c(G(),1);var gy=c(E(),1);function OCe(e,t,o){return e==="core/image"&&o?.lightbox?.allowEditing||!!t?.lightbox}function ACe({onChange:e,value:t,inheritedValue:o,panelId:r}){let n=xr(),i=()=>{e(void 0)},s=l=>{e({enabled:l})},a=!1;return o?.lightbox?.enabled&&(a=o.lightbox.enabled),(0,gy.jsx)(gy.Fragment,{children:(0,gy.jsx)(z_.__experimentalToolsPanel,{label:(0,t1._x)("Settings","Image settings"),resetAll:i,panelId:r,dropdownMenuProps:n,children:(0,gy.jsx)(z_.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,t1.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:r,children:(0,gy.jsx)(z_.ToggleControl,{label:(0,t1.__)("Enlarge on click"),checked:a,onChange:s})})})})}var LD=c(U(),1);var MCe=c(F(),1),MD=c(G(),1);var o1=c(E(),1);function r$(e){return!(typeof e=="string"&&/<\/?\w/.test(e))}function NCe(e){return r$(e)?null:(0,MD.__)("The custom CSS is invalid. Do not use <> markup.")}function LCe(e){if(!e)return null;let t=NCe(e);if(t)return t;let[o]=zS([{css:e}],".for-validation-only");return o===null?(0,MD.__)("There is an error with your CSS structure."):null}function ND({value:e,onChange:t,inheritedValue:o=e,help:r}){let n=o?.css,[i,s]=(0,MCe.useState)(()=>LCe(n));function a(u){t({...e,css:u}),s(NCe(u))}function l(u){s(LCe(u?.target?.value))}return(0,o1.jsxs)(Qe,{direction:"column",gap:"md",className:"block-editor-global-styles-advanced-panel",children:[i&&(0,o1.jsx)(LD.Notice,{status:"error",onRemove:()=>s(null),children:i}),(0,o1.jsx)(LD.TextareaControl,{label:(0,MD.__)("Additional CSS"),value:n,onChange:u=>a(u),onBlur:l,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:r})]})}var GCe=c(U(),1),WCe=c(F(),1),Ef=c(G(),1);var yt=c(U(),1);var Uo=c(G(),1),VCe=c(as(),1),n$=c(Fs(),1),Cf=c(F(),1),n1=c(Q(),1),FCe=c(Tt(),1),zCe=c(t9(),1);var ft=c(E(),1),DD="image",bYe={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},VD=()=>{},r1=e=>{window.requestAnimationFrame(()=>{let[t]=FCe.focus.tabbable.find(e?.current);t&&t.focus()})};function yYe(e){return e==="cover"||e===void 0?(0,Uo.__)("Image covers the space evenly."):e==="contain"?(0,Uo.__)("Image is contained without distortion."):(0,Uo.__)("Image has a fixed width.")}var vYe=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;let t=isNaN(e.x)?.5:e.x,o=isNaN(e.y)?.5:e.y;return`${t*100}% ${o*100}%`},SYe=e=>{if(!e)return{x:void 0,y:void 0};let[t,o]=e.split(" ").map(r=>parseFloat(r)/100);return t=isNaN(t)?void 0:t,o=isNaN(o)?t:o,{x:t,y:o}};function jCe({as:e="span",imgUrl:t,toggleProps:o={},filename:r,label:n,onToggleCallback:i=VD}){let{isOpen:s,...a}=o;(0,Cf.useEffect)(()=>{typeof s<"u"&&i(s)},[s,i]);let l=()=>(0,ft.jsxs)(yt.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,ft.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,ft.jsxs)(yt.FlexBlock,{children:[(0,ft.jsx)(yt.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:n}),(0,ft.jsx)(bt,{render:(0,ft.jsx)("span",{}),children:t?(0,Uo.sprintf)((0,Uo.__)("Background image: %s"),r||n):(0,Uo.__)("No background image selected")})]})]});return e==="button"?(0,ft.jsx)(yt.Button,{__next40pxDefaultSize:!0,...a,children:l()}):l()}function kYe({label:e,filename:t,url:o,children:r,onToggle:n=VD,hasImageValue:i,onReset:s,hasLocalOverride:a,containerRef:l}){if(!i)return;let u=e||(0,n$.getFilename)(o)||(0,Uo.__)("Image");return(0,ft.jsx)(yt.Dropdown,{popoverProps:bYe,renderToggle:({onToggle:d,isOpen:f})=>{let p={onClick:d,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":f,"aria-label":(0,Uo.__)("Background size, position and repeat options."),isOpen:f};return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(jCe,{imgUrl:o,filename:t,label:u,toggleProps:p,as:"button",onToggleCallback:n}),s&&(a?(0,ft.jsx)(_f,{className:"block-editor-global-styles-background-panel__reset",onResetToInherited:()=>{s(),f&&d(),r1(l)}}):(0,ft.jsx)(yt.Button,{__next40pxDefaultSize:!0,label:(0,Uo.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:dn,onClick:()=>{s(),f&&d(),r1(l)}}))]})},renderContent:()=>(0,ft.jsx)(yt.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:r})})}function _Ye(){return(0,ft.jsx)(yt.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,ft.jsx)(yt.Spinner,{})})}function DCe({onChange:e,style:t,inheritedValue:o,onRemoveImage:r=VD,onResetImage:n=VD,displayInPanel:i,defaultValues:s,containerRef:a}){let[l,u]=(0,Cf.useState)(!1),{getSettings:d}=(0,n1.useSelect)(C),{id:f,title:p,url:h}=t?.background?.backgroundImage||{...o?.background?.backgroundImage},{createErrorNotice:m}=(0,n1.useDispatch)(VCe.store),g=w=>{m(w,{type:"snackbar"}),u(!1)},b=()=>e(De(t,["background","backgroundImage"],void 0)),v=w=>{if(!w||!w.url){b(),u(!1);return}if((0,zCe.isBlobURL)(w.url)){u(!0);return}if(w.media_type&&w.media_type!==DD||!w.media_type&&w.type&&w.type!==DD){g((0,Uo.__)("Only images can be used as a background image."));return}let T=t?.background?.backgroundSize||s?.backgroundSize,B=t?.background?.backgroundPosition;e(De(t,["background"],{...t?.background,backgroundImage:{url:w.url,id:w.id,source:"file",title:w.title||void 0},backgroundPosition:!B&&(T==="auto"||!T)?"50% 0":B,backgroundSize:T})),u(!1),r1(a)},y=w=>{d().mediaUpload({allowedTypes:[DD],filesList:w,onFileChange([T]){v(T)},onError:g,multiple:!1})},k=Ec(t),S=()=>e(De(t,["background"],{backgroundImage:"none"})),_=!k&&Ec(o),x=p||(0,n$.getFilename)(h)||(0,Uo.__)("Image");return(0,ft.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[l&&(0,ft.jsx)(_Ye,{}),(0,ft.jsx)(b_,{mediaId:f,mediaURL:h,allowedTypes:[DD],accept:"image/*",onSelect:v,popoverProps:{className:K({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,ft.jsx)(jCe,{imgUrl:h,filename:p,label:x}),renderToggle:w=>(0,ft.jsx)(yt.Button,{...w,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{r1(a),n()},children:_&&(0,ft.jsx)(yt.MenuItem,{onClick:()=>{r1(a),S(),r()},children:(0,Uo.__)("Remove")})}),(0,ft.jsx)(yt.DropZone,{onFilesDrop:y,label:(0,Uo.__)("Drop to upload")})]})}function xYe({onChange:e,style:t,inheritedValue:o,defaultValues:r}){let n=t?.background?.backgroundSize,i=t?.background?.backgroundRepeat,s=t?.background?.backgroundPosition,a=t?.background?.backgroundAttachment,l=o?.background?.backgroundSize,u=o?.background?.backgroundRepeat,d=o?.background?.backgroundPosition,f=o?.background?.backgroundAttachment,p=n||l,h=i||u,m=t?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,g=t?.background?.backgroundImage?.id,b=s||d,v=a||f,y=!p&&g?r?.backgroundSize:p||"auto";y=["cover","contain","auto"].includes(y)?y:"auto";let k=!(h==="no-repeat"||y==="cover"&&h===void 0),S=B=>{let R=h,I=b;B==="contain"&&(R="no-repeat",I=void 0),B==="cover"&&(R=void 0,I=void 0),(y==="cover"||y==="contain")&&B==="auto"&&(R=void 0,t?.background?.backgroundImage?.id&&(I="50% 0")),!B&&y==="auto"&&(B="auto"),e(De(t,["background"],{...t?.background,backgroundPosition:I,backgroundRepeat:R,backgroundSize:B}))},_=B=>{e(De(t,["background","backgroundPosition"],vYe(B)))},x=()=>e(De(t,["background","backgroundRepeat"],k===!0?"no-repeat":"repeat")),w=()=>e(De(t,["background","backgroundAttachment"],v==="fixed"?"scroll":"fixed")),T=!b&&g&&p==="contain"?r?.backgroundPosition:b;return(0,ft.jsxs)(yt.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,ft.jsx)(yt.FocalPointPicker,{label:(0,Uo.__)("Focal point"),url:m,value:SYe(T),onChange:_}),(0,ft.jsx)(yt.ToggleControl,{label:(0,Uo.__)("Fixed background"),checked:v==="fixed",onChange:w}),(0,ft.jsxs)(yt.__experimentalToggleGroupControl,{label:(0,Uo.__)("Size"),value:y,onChange:S,isBlock:!0,help:yYe(p||r?.backgroundSize),children:[(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Uo._x)("Cover","Size option for background image control")},"cover"),(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Uo._x)("Contain","Size option for background image control")},"contain"),(0,ft.jsx)(yt.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Uo._x)("Tile","Size option for background image control")},"tile")]}),(0,ft.jsxs)(yt.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,ft.jsx)(yt.__experimentalUnitControl,{"aria-label":(0,Uo.__)("Background image width"),onChange:S,value:p,__unstableInputWidth:"100px",min:0,placeholder:(0,Uo.__)("Auto"),disabled:y!=="auto"||y===void 0}),(0,ft.jsx)(yt.ToggleControl,{label:(0,Uo.__)("Repeat"),checked:k,onChange:x,disabled:y==="cover"})]})]})}function HCe({value:e,onChange:t,inheritedValue:o=e,settings:r,defaultValues:n={},showInheritanceLabelIndicators:i=gn()}){let{globalStyles:s,_links:a}=(0,n1.useSelect)(S=>{let{getSettings:_}=S(C),x=_();return{globalStyles:x[rs],_links:x[Gy]}},[]),l=(0,Cf.useMemo)(()=>{let S={background:{}};return o?.background?(Object.entries(o?.background).forEach(([_,x])=>{S.background[_]=ap(x,{styles:s,_links:a})}),S):o},[s,a,o]),u=()=>t(De(e,["background"],{gradient:e?.background?.gradient})),{title:d,url:f}=e?.background?.backgroundImage||{...l?.background?.backgroundImage},p=Ec(e),h=p||Ec(l),m=i&&p&&Ec(l),g=e?.background?.backgroundImage||o?.background?.backgroundImage,b=h&&g!=="none"&&(r?.background?.backgroundSize||r?.background?.backgroundPosition||r?.background?.backgroundRepeat),[v,y]=(0,Cf.useState)(!1),k=(0,Cf.useRef)();return(0,ft.jsx)("div",{ref:k,className:K("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":v}),children:b?(0,ft.jsx)(kYe,{label:d,filename:d,url:f,onToggle:y,hasImageValue:h,hasLocalOverride:m,onReset:p?u:void 0,containerRef:k,children:(0,ft.jsxs)(yt.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,ft.jsx)(DCe,{onChange:t,style:e,inheritedValue:l,displayInPanel:!0,onResetImage:()=>{y(!1),u()},onRemoveImage:()=>y(!1),defaultValues:n,containerRef:k}),(0,ft.jsx)(xYe,{onChange:t,style:e,defaultValues:n,inheritedValue:l})]})}):(0,ft.jsx)(DCe,{onChange:t,style:e,inheritedValue:l,defaultValues:n,onResetImage:()=>{y(!1),u()},onRemoveImage:()=>y(!1),containerRef:k})})}var Fu=c(E(),1),wYe={backgroundImage:!0,backgroundColor:!0,gradient:!0};function UCe(e,t){return e?.background?.[t]}function FD(e){let t=qW(e),{backgroundImage:o,gradient:r}=e?.background||{};return o||r||t}function Ec(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function i$(e){return typeof e?.background?.gradient=="string"&&e?.background?.gradient!==""}function CYe(e){return!!e?.color?.background}function EYe(e){return!!e?.color?.gradient}function s$({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,headerLabel:i}){let s=xr();return(0,Fu.jsx)(GCe.__experimentalToolsPanel,{label:i,resetAll:()=>{let l=e(o);t(l)},panelId:r,hasInnerWrapper:!0,className:"background-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Fu.jsx)("div",{className:"background-block-support-panel__inner-wrapper",children:n})})}function zD({as:e=s$,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=wYe,defaultValues:a={},headerLabel:l=(0,Ef.__)("Background"),contrastWarning:u,showInheritanceLabelIndicators:d=gn()}){let{colors:f,gradients:p,allColors:h,areCustomSolidsEnabled:m,areCustomGradientsEnabled:g,hasSolidColors:b,hasGradientColors:v,decodeValue:y,encodeGradientValue:k}=A_(n),S=UCe(n,"gradient"),_=qW(n),x=_&&b,w=v&&S,T=_&&v&&!S,B=UCe(n,"backgroundImage"),R=(0,WCe.useCallback)(W=>{let Y=x,Z=S||T;return!Y&&!Z?{...W,background:{}}:{...W,background:{},color:{...W?.color,...Y&&{background:void 0},...Z&&{gradient:void 0}}}},[S,x,T]);if(!B&&!x&&!w&&!T)return null;let I=()=>o(De(t,["background","backgroundImage"],void 0)),A=()=>{let W=De(t,["background","gradient"],void 0);W=De(W,["color","gradient"],void 0),o(W)},P=y(r?.color?.background),O=y(t?.color?.background),N=(W,Y)=>{let Z=De(t,["color","background"],xf(h,W,Y));T&&(Z.color.gradient=void 0),o(Z)},z=()=>{let W=De(t,["color","background"],void 0);T&&(W.color.gradient=void 0),o(W)},V=y(r?.color?.gradient),M=y(t?.color?.gradient),D=(W,Y)=>{let Z=De(t,["color","gradient"],k(W,Y));Z.color.background=void 0,o(Z)},L=()=>o(De(t,["color","gradient"],void 0)),j=y(t?.background?.gradient??t?.color?.gradient),q=y(r?.background?.gradient??r?.color?.gradient),J=(W,Y)=>{let Z=De(t,["background","gradient"],k(W,Y));Z=De(Z,["color","gradient"],void 0),o(Z)},te=(W,Y,Z)=>d?yl(W,Y,Z):{className:Z},ee=Ec({background:{backgroundImage:r?.background?.backgroundImage}}),$=Ec(t);return(0,Fu.jsxs)(e,{resetAllFilter:R,value:t,onChange:o,panelId:i,headerLabel:l,children:[B&&(0,Fu.jsx)(Lt,{...te(ee&&!$,$&&ee,"block-editor-color-gradient-item"),showLocalOverrideActionsInLabel:!1,hasValue:()=>Ec(t),label:(0,Ef.__)("Image"),onDeselect:I,isShownByDefault:s.backgroundImage,panelId:i,children:(0,Fu.jsx)(HCe,{value:t,onChange:o,settings:n,inheritedValue:r,defaultControls:s,defaultValues:a,showInheritanceLabelIndicators:d})}),x&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Color"),hasValue:()=>CYe(t),resetValue:z,isShownByDefault:s.backgroundColor,indicators:[O??P],contrastWarning:u,showInheritanceLabelIndicators:d,isPlaceholder:O===void 0&&P!==void 0,hasInheritedValue:P!==void 0,tabs:[{key:"background",label:(0,Ef.__)("Color"),inheritedValue:P,inheritedSlug:Po(r?.color?.background,"color"),userSlug:Po(t?.color?.background,"color"),setValue:N,userValue:O,isPlaceholder:O===void 0&&P!==void 0}],colorGradientControlSettings:{colors:f,disableCustomColors:!m},panelId:i}),w&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Gradient"),hasValue:()=>i$(t),resetValue:A,isShownByDefault:s.gradient,indicators:[j??q],showInheritanceLabelIndicators:d,isPlaceholder:j===void 0&&q!==void 0,hasInheritedValue:q!==void 0,tabs:[{key:"gradient",label:(0,Ef.__)("Gradient"),inheritedValue:q,inheritedSlug:Po(r?.background?.gradient??r?.color?.gradient,"gradient"),userSlug:Po(t?.background?.gradient??t?.color?.gradient,"gradient"),setValue:J,userValue:j,isGradient:!0,isPlaceholder:j===void 0&&q!==void 0}],colorGradientControlSettings:{gradients:p,disableCustomGradients:!g},panelId:i}),T&&(0,Fu.jsx)(lh,{label:(0,Ef.__)("Gradient"),hasValue:()=>EYe(t),resetValue:L,isShownByDefault:s.gradient,indicators:[M??V],showInheritanceLabelIndicators:d,isPlaceholder:M===void 0&&V!==void 0,hasInheritedValue:V!==void 0,tabs:[{key:"gradient",label:(0,Ef.__)("Gradient"),inheritedValue:V,inheritedSlug:Po(r?.color?.gradient,"gradient"),userSlug:Po(t?.color?.gradient,"gradient"),setValue:D,userValue:M,isGradient:!0,isPlaceholder:M===void 0&&V!==void 0}],colorGradientControlSettings:{gradients:p,disableCustomGradients:!g},panelId:i})]})}var zu=c(G(),1);var ch=c(U(),1);var Tc=c(E(),1);function jD({viewportStates:e=[],pseudoStates:t=[],viewportValue:o="default",pseudoStateValue:r="default",onChangeViewport:n,onChangePseudoState:i,showText:s=!0,popoverProps:a={}}){if(!e.length&&!t.length)return null;let l=[{label:(0,zu.__)("Default"),value:"default"},...e.map(v=>({label:v.label,value:v.value}))],u=[{label:(0,zu.__)("Default"),value:"default"},...t.map(v=>({label:v.label,value:v.value}))],d=e.length>0,f=t.length>0,p=(0,zu.__)("States"),h=[];if(d&&o!=="default"){let v=l.find(y=>y.value===o);v&&h.push({key:`viewport-${v.value}`,label:v.label})}if(f&&r!=="default"){let v=u.find(y=>y.value===r);v&&h.push({key:`pseudo-${v.value}`,label:v.label})}let m=h.length?h.map(v=>v.label).join(", "):(0,zu.__)("Default"),g=s?cn:zs,b=s?{size:"compact",iconPosition:"right"}:{size:"small"};return(0,Tc.jsx)(Qe,{direction:"column",gap:"sm",align:"flex-end",className:"block-editor-global-styles-state-control",children:(0,Tc.jsx)(ch.DropdownMenu,{icon:g,label:s?p:(0,zu.sprintf)((0,zu.__)("State: %s"),m),popoverProps:{placement:"right-start",...a},text:s?p:void 0,toggleProps:b,children:({onClose:v})=>(0,Tc.jsxs)(Tc.Fragment,{children:[d&&(0,Tc.jsx)(ch.MenuGroup,{label:(0,zu.__)("Viewport"),children:l.map(y=>(0,Tc.jsx)(ch.MenuItem,{onClick:()=>{n?.(y.value),f||v()},icon:o===y.value?ns:null,children:y.label},`viewport-${y.value}`))}),f&&(0,Tc.jsx)(ch.MenuGroup,{label:(0,zu.__)("Pseudo state"),children:u.map(y=>(0,Tc.jsx)(ch.MenuItem,{onClick:()=>{i?.(y.value),d||v()},icon:r===y.value?ns:null,children:y.label},`pseudo-${y.value}`))})]})})})}var $Ce=c(U(),1),j_=c(G(),1);var ju=c(E(),1),{Badge:TYe}=H($Ce.privateApis);function HD({viewportStates:e=[],pseudoStates:t=[],viewportValue:o="default",pseudoStateValue:r="default",className:n="block-editor-global-styles-state-control__badges"}){let i=[],s=e.find(l=>l.value===o),a=t.find(l=>l.value===r);return s&&i.push({key:`viewport-${s.value}`,label:s.label,tooltipText:(0,j_.sprintf)((0,j_.__)("Style changes apply to the %s viewport."),s.label)}),a&&i.push({key:`pseudo-${a.value}`,label:a.label,tooltipText:(0,j_.sprintf)((0,j_.__)("Style changes apply to the %s state."),a.label)}),(0,ju.jsx)(Qe,{className:n,direction:"row",justify:"flex-start",gap:"xs",wrap:"wrap",children:i.map(l=>{let u=(0,ju.jsxs)(TYe,{className:"block-editor-global-styles-state-control__badge",intent:"info",children:[l.label,!!l.tooltipText&&(0,ju.jsx)(bt,{render:(0,ju.jsx)("span",{}),children:l.tooltipText})]},l.key);return l.tooltipText?(0,ju.jsxs)(kt.Root,{children:[(0,ju.jsx)(kt.Trigger,{render:(0,ju.jsx)("span",{className:"block-editor-global-styles-state-control__badge-tooltip-trigger",children:u})}),(0,ju.jsx)(kt.Popup,{children:l.tooltipText})]},l.key):u})})}var c1=c(F(),1),u$=c(Q(),1),qCe=c(ue(),1);var a1=c(ue(),1),i1=c(Q(),1),UD=c(F(),1);var s1=c(E(),1),{getVariationStyle:RYe}=H(Sr),l$="is-style-";function KCe(e){return e?e.split(/\s+/).reduce((t,o)=>{if(o.startsWith(l$)){let r=o.slice(l$.length);r!=="default"&&t.push(r)}return t},[]):[]}function l1(e,t=[]){let o=KCe(e);if(!o)return null;for(let r of o)if(t.some(n=>n.name===r))return r;return null}function BYe({override:e}){Rc(e)}function c$({config:e}){let{overrides:t}=(0,i1.useSelect)(n=>({overrides:H(n(C)).getStyleOverrides()}),[]),{getBlockName:o}=(0,i1.useSelect)(C),r=(0,UD.useMemo)(()=>{if(!t?.length)return;let n=[],i=[];for(let[,s]of t)if(s?.variation&&s?.clientId&&!i.includes(s.clientId)){let a=o(s.clientId),l=e?.styles?.blocks?.[a]?.variations?.[s.variation];if(l){let u={settings:e?.settings,styles:{blocks:{[a]:{variations:{[`${s.variation}-${s.clientId}`]:l}}}}},d=_B((0,a1.getBlockTypes)(),s.clientId),g=kB(u,d,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});n.push({id:`${s.variation}-${s.clientId}`,css:g,__unstableType:"variation",variation:s.variation,clientId:s.clientId}),i.push(s.clientId)}}return n},[e,t,o]);return!r||!r.length?null:(0,s1.jsx)(s1.Fragment,{children:r.map(n=>(0,s1.jsx)(BYe,{override:n},n.id))})}function PYe(e,t,o){let{globalSettings:r,globalStyles:n}=(0,i1.useSelect)(i=>{let s=i(C).getSettings();return{globalSettings:s.__experimentalFeatures,globalStyles:s[rs]}},[]);return(0,UD.useMemo)(()=>{let i=RYe({settings:r,styles:n},e,t);return{settings:r,styles:{blocks:{[e]:{variations:{[`${t}-${o}`]:i}}}}}},[r,n,t,o,e])}function IYe({name:e,className:t,clientId:o}){let{getBlockStyles:r}=(0,i1.useSelect)(a1.store),n=r(e),i=l1(t,n),s=`${l$}${i}-${o}`,{settings:a,styles:l}=PYe(e,i,o),u=(0,UD.useMemo)(()=>{if(!i)return;let d={settings:a,styles:l},f=_B((0,a1.getBlockTypes)(),o);return kB(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[i,a,l,o]);return Rc({id:`variation-${o}`,css:u,__unstableType:"variation",variation:i,clientId:o}),i?{className:s}:{}}var YCe={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>KCe(e).length>0,useBlockProps:IYe};var{resolveStyle:OYe}=H(Sr),AYe={value:void 0,sources:void 0};function LYe(){let{rawGlobalStylesData:e,links:t}=(0,u$.useSelect)(o=>{let r=o(C).getSettings();return{rawGlobalStylesData:r[rs]??null,links:r[Gy]??null}},[]);return(0,c1.useMemo)(()=>e?{styles:e,_links:t??void 0}:null,[e,t])}var ZCe={"core/accordion-heading":{contextKey:"core/accordion-heading-level",fallbackLevel:3}};function MYe(e,t,o){let r=ZCe[e];return r?t||o||r.fallbackLevel:t}function NYe(e){let t=(0,c1.useContext)(_n),o=ZCe[e]?.contextKey;return o?t[o]:void 0}function DYe(e,t){switch(e){case"core/button":return["button"];case"core/accordion-heading":case"core/heading":case"core/post-title":case"core/site-title":case"core/query-title":case"core/comments-title":case"core/term-name":case"core/site-tagline":return t===0?[]:t?["heading",`h${t}`]:["heading"];case"core/read-more":case"core/loginout":case"core/post-navigation-link":case"core/query-pagination-next":case"core/query-pagination-previous":case"core/query-pagination-numbers":case"core/comments-pagination-next":case"core/comments-pagination-previous":case"core/comments-pagination-numbers":case"core/comment-edit-link":case"core/comment-reply-link":case"core/post-comments-link":return["link"];default:return[]}}function VYe(e,t){let{clientId:o}=ht(),r=NYe(e);return(0,u$.useSelect)(n=>{if(!e)return{variationName:null,headingLevel:void 0};let i=n(qCe.store).getBlockStyles(e),{level:s}=n(C).getBlockAttributes(o)||{};return{variationName:t?l1(t,i):null,headingLevel:MYe(e,s,r)}},[e,t,o,r])}function _l(e,t,o=null){let{variationName:r,headingLevel:n}=VYe(e,t),i=LYe();return(0,c1.useMemo)(()=>gn()?e?OYe(i,{blockName:e,variationName:r,elements:DYe(e,n),viewport:o?.viewport??null,pseudoState:o?.pseudo??null}):{value:{},sources:{}}:AYe,[e,r,n,i,o])}var f$=c(E(),1),yy="__experimentalBorder",d1="shadow",XCe=(e,t,o)=>{let r;return e.some(n=>n.colors.some(i=>i[t]===o?(r=i,!0):!1)),r},by=({colors:e,namedColor:t,customColor:o})=>{if(t){let n=XCe(e,"slug",t);if(n)return n}if(!o)return{color:void 0};let r=XCe(e,"color",o);return r||{color:o}};function GD(e){let t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function eEe(e){if((0,d$.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};let t=e?.border?.color,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:o?void 0:t},{style:Ge(r),borderColor:o}}function tEe(e){return(0,d$.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function FYe({label:e,children:t,resetAllFilter:o}){let r=(0,$D.useCallback)(n=>{let i=tEe(n),s=o(i);return{...n,...eEe(s)}},[o]);return(0,f$.jsx)(Oe,{group:"border",resetAllFilter:r,label:e,children:t})}function oEe({clientId:e,name:t,setAttributes:o,settings:r}){let n=Ja(),i=PD(r),{style:s,borderColor:a,className:l}=(0,JCe.useSelect)(m=>{if(!i)return{};let{style:g,borderColor:b,className:v}=m(C).getBlockAttributes(e)||{};return{style:g,borderColor:b,className:v}},[e,i]),{value:u}=_l(t,l,n),d=!Bn(n),f=(0,$D.useMemo)(()=>d?To(s,n):tEe({style:s,borderColor:a}),[d,n,s,a]),p=d?m=>{o({style:Pn(s,n,m)})}:m=>{o(eEe(m))};if(!i)return null;let h={...(0,u1.getBlockSupport)(t,[yy,"__experimentalDefaultControls"]),...(0,u1.getBlockSupport)(t,[d1,"__experimentalDefaultControls"])};return(0,f$.jsx)(ID,{as:FYe,panelId:e,settings:r,value:f,onChange:p,defaultControls:h,inheritedValue:u})}function KD(e,t="any"){let o=(0,u1.getBlockSupport)(e,yy);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}function hy({blockName:e,hasBorderControl:t,hasShadowControl:o}={}){let r=xl(e),n=e1(r);return!t&&!o&&e&&(t=n?.hasBorderColor||n?.hasBorderStyle||n?.hasBorderWidth||n?.hasBorderRadius,o=n?.hasShadow),t&&o?(0,WD.__)("Border & Shadow"):o?(0,WD.__)("Shadow"):(0,WD.__)("Border")}function zYe(e){return!KD(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function rEe(e,t,o){if(!KD(t,"color")||$t(t,yy,"color"))return e;let r=p$(o),n=K(e.className,r);return e.className=n||void 0,e}function p$(e){let{borderColor:t,style:o}=e,r=xa("border-color",t);return K({"has-border-color":t||o?.border?.color,[r]:!!r})}function jYe({name:e,borderColor:t,style:o}){let{colors:r}=Ym();if(!KD(e,"color")||$t(e,yy,"color"))return{};let{color:n}=by({colors:r,namedColor:t}),{color:i}=by({colors:r,namedColor:GD(o?.border?.top?.color)}),{color:s}=by({colors:r,namedColor:GD(o?.border?.right?.color)}),{color:a}=by({colors:r,namedColor:GD(o?.border?.bottom?.color)}),{color:l}=by({colors:r,namedColor:GD(o?.border?.left?.color)});return rEe({style:Ge({borderTopColor:i||n,borderRightColor:s||n,borderBottomColor:a||n,borderLeftColor:l||n})||{}},e,{borderColor:t,style:o})}var m$={useBlockProps:jYe,addSaveProps:rEe,attributeKeys:["borderColor","style"],hasSupport(e){return KD(e,"color")}};(0,QCe.addFilter)("blocks.registerBlockType","core/border/addAttributes",zYe);var S$=c(ue(),1),JD=c(F(),1),mEe=c(Q(),1),hEe=c(G(),1);var b$=c(go(),1),G_=c(ue(),1),fEe=c(F(),1);var U_=c(ue(),1),lEe=c(Q(),1),cEe=c(G(),1);var vy=c(F(),1),iEe=c(Q(),1),sEe=c(ue(),1);var aEe=c(Qr(),1);function YD(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function nEe(e,t){if(!e||!t)return{};let o=js(t,"color.text",{fallback:!0}),r=js(t,"color.background",{fallback:!0}),n=e.querySelector(o)||e,i=e.querySelector(r)||e,s=e.querySelector("a"),a=YD(n,"color"),l=s&&s.textContent?YD(s,"color"):void 0,u=i,d=YD(u,"background-color");for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=YD(u,"background-color");return{textColor:a,backgroundColor:d,linkColor:l}}function HYe(e,t){return Object.keys(t).some(r=>e[r]!==t[r])?t:e}function H_({clientId:e,name:t,enabled:o=!0,checkTextColor:r=!0,checkLinkColor:n=!0,messageOverride:i}){let s=Nt(e),[a,l]=(0,vy.useReducer)(HYe,{}),u=(0,iEe.useSelect)(p=>t&&o?p(sEe.store).getBlockType(t):void 0,[t,o]);(0,vy.useLayoutEffect)(()=>{!o||!s||!u||window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>l(nEe(s,u))))}),(0,vy.useLayoutEffect)(()=>{if(!o||!s||!u)return;let p=new window.MutationObserver(()=>{l(nEe(s,u))});return p.observe(s,{attributes:!0,attributeFilter:["class","style"],subtree:!0}),()=>{p.disconnect()}},[o,s,u]);let d=o?LG({backgroundColor:a.backgroundColor,textColor:r?a.textColor:void 0,linkColor:n?a.linkColor:void 0,messageOverride:i,enableAlphaChecker:!0}):null,f=d?.speakMessage;return(0,vy.useEffect)(()=>{f&&(0,aEe.speak)(f)},[f]),d?.message}var g$=c(E(),1),Sy="background",h$={backgroundSize:"cover",backgroundPosition:"50% 50%"};function f1(e,t="any"){let o=(0,U_.getBlockSupport)(e,Sy);return o===!0?!0:t==="any"?!!o?.backgroundImage||!!o?.backgroundSize||!!o?.backgroundRepeat||!!o?.gradient:!!o?.[t]}function qD(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:h$.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:h$.backgroundPosition}),t}function UYe({name:e,style:t}){if(!f1(e)||!t?.background?.backgroundImage)return;let o=qD(t?.background);if(o)return{style:{...o}}}function uEe(e){return Ec(e)||i$(e)?"has-background":""}function GYe(e){let t=e.className?.includes("has-background")?e.className.split(" ").filter(o=>o!=="has-background").join(" ")||void 0:e.className;return{...e,className:t,backgroundColor:void 0,gradient:void 0,style:Ge({...e.style,background:void 0,color:{...e.style?.color,background:void 0,gradient:void 0}})}}function WYe({children:e}){return(0,g$.jsx)(Oe,{group:"background",resetAllFilter:GYe,children:e})}function ZD({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n}){let i=Ja(),{style:s,className:a,backgroundColor:l,gradient:u}=(0,lEe.useSelect)(R=>{let{getBlockAttributes:I}=R(C),A=I(e);return{style:A?.style,className:A?.className,backgroundColor:A?.backgroundColor,gradient:A?.gradient}},[e]),{value:d}=_l(t,a,i),f=f1(t,"gradient")&&!!r?.background?.gradient,p=(0,U_.getBlockSupport)(t,"color"),h=p&&p.background!==!1,m=!!p?.gradients,g=!Bn(i),b={...s,color:{...s?.color,background:l?"var:preset|color|"+l:s?.color?.background,gradient:!f&&u?"var:preset|gradient|"+u:s?.color?.gradient},...f&&{background:{...s?.background,gradient:u?"var:preset|gradient|"+u:s?.background?.gradient??s?.color?.gradient}}},v=g?To(s,i):b,y=!v?.color?.gradient&&!v?.background?.gradient&&!!v?.color?.background&&(r?.color?.text||r?.color?.link)&&(0,U_.getBlockSupport)(t,["color","enableContrastChecker"])!==!1,k=H_({clientId:e,name:t,enabled:!!y,messageOverride:(0,cEe.__)("This color combination has poor contrast. Consider increasing contrast between background and foreground.")});if(!FD(r)||!f1(t)&&!h&&!m)return null;let S=R=>{if(g){o({style:Pn(s,i,R)});return}let I=R?.color?.background,A=Po(I,"color"),P=f?R?.background?.gradient:R?.color?.gradient,O=Po(P,"gradient"),N=O?void 0:R?.color?.gradient,z={...R,color:{...R?.color,background:A?void 0:I,gradient:f?void 0:N}};f&&(z.background={...z.background,gradient:R?.background?.gradient});let V=f&&!!s?.color?.gradient,M={style:Ge(z),backgroundColor:A,gradient:f?void 0:O},D=!!O||!!P;V&&D?M.className=K(a,"has-background"):!D&&a?.includes("has-background")&&(M.className=a.split(" ").filter(L=>L!=="has-background").join(" ")||void 0),o(M)},_={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&f1(t,"backgroundSize")}},x=(0,U_.getBlockSupport)(t,[Sy,"__experimentalDefaultControls"]),w=(0,U_.getBlockSupport)(t,["color","__experimentalDefaultControls"]),T={...x,backgroundColor:w?.background,gradient:x?.gradient??w?.background};return(0,g$.jsx)(zD,{as:n||WYe,panelId:e,defaultValues:h$,settings:_,onChange:S,defaultControls:T,value:g?To(s,i):b,contrastWarning:k,inheritedValue:d})}var dEe={useBlockProps:UYe,attributeKeys:["style"],hasSupport:f1};var Mn="color",XD=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},$Ye=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t!==null&&typeof t=="object"&&!!t.link},y$=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t!==null&&typeof t=="object"&&!!t.gradients},KYe=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&t.background!==!1},YYe=e=>{let t=(0,G_.getBlockSupport)(e,Mn);return t&&t.text!==!1};function qYe(e){return XD(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),y$(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function pEe(e,t,o){if(!XD(t)||$t(t,Mn))return e;let r=y$(t),{backgroundColor:n,textColor:i,gradient:s,style:a}=o,l=g=>!$t(t,Mn,g),u=l("text")?xa("color",i):void 0,d=l("gradients")?gv(s):void 0,f=l("background")?xa("background-color",n):void 0,p=l("background")||l("gradients"),h=n||a?.color?.background||r&&(s||a?.color?.gradient),m=K(e.className,u,d,{[f]:(!r||!a?.color?.gradient)&&!!f,"has-text-color":l("text")&&(i||a?.color?.text),"has-background":p&&h,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=m||void 0,e}function ZYe({name:e,backgroundColor:t,textColor:o,gradient:r,style:n}){let[i,s,a]=Le("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,fEe.useMemo)(()=>[...i||[],...s||[],...a||[]],[i,s,a]);if(!XD(e)||$t(e,Mn))return{};let u={};o&&!$t(e,Mn,"text")&&(u.color=jc(l,o)?.color),t&&!$t(e,Mn,"background")&&(u.backgroundColor=jc(l,t)?.color);let d=pEe({style:u},e,{textColor:o,backgroundColor:t,gradient:r,style:n}),f=t||n?.color?.background||r||n?.color?.gradient;return{...d,className:K(d.className,!f&&uEe(n))}}var v$={useBlockProps:ZYe,addSaveProps:pEe,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:XD},XYe={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function QYe(e,t,o,r){let n=e.name,i={linkColor:$Ye(n),textColor:YYe(n),backgroundColor:KYe(n),gradient:y$(n)};return QD(i,XYe,e,t,o,r)}(0,b$.addFilter)("blocks.registerBlockType","core/color/addAttribute",qYe);(0,b$.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",QYe);var k$=c(E(),1);function JYe({children:e,resetAllFilter:t}){let o=(0,JD.useCallback)(r=>{let n=t(r.style);return{...r,style:Ge(n)}},[t]);return(0,k$.jsx)(Oe,{group:"elements",resetAllFilter:o,children:e})}function eV({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n,label:i,defaultControls:s}){let a=Ja(),l=bD(r),{style:u,className:d}=(0,mEe.useSelect)(y=>{if(!l)return{};let k=y(C).getBlockAttributes(e);return{style:k?.style,className:k?.className}},[e,l]),{value:f}=_l(t,d,a),p=!Bn(a),h=(0,JD.useMemo)(()=>p?To(u,a):u,[p,a,u]),m=p?y=>{o({style:Pn(u,a,y)})}:y=>{o({style:Ge(y)})},g=!!h?.elements?.link?.color?.text&&r?.color?.link&&(0,S$.getBlockSupport)(t,[Mn,"enableContrastChecker"])!==!1,b=H_({clientId:e,name:t,enabled:!!g,checkTextColor:!1,messageOverride:(0,hEe.__)("This link color has poor contrast against the background. Consider increasing contrast.")});return l?(s=s||(0,S$.getBlockSupport)(t,[Mn,"__experimentalDefaultControls"]),(0,k$.jsx)(yD,{as:n||JYe,panelId:e,settings:r,value:h,onChange:m,defaultControls:s,label:i,contrastWarning:b,inheritedValue:f})):null}var h1=c(ue(),1),aV=c(F(),1),LEe=c(Q(),1),MEe=c(G(),1);var eqe=c(ue(),1);var tqe=c(E(),1),gEe="typography.lineHeight";var bEe=c(go(),1),tV=c(ue(),1),yEe=c(WL(),1),vEe=c(U(),1);var p1="typography.__experimentalFontFamily",{kebabCase:oqe}=H(vEe.privateApis);function rqe(e){return(0,tV.hasBlockSupport)(e,p1)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function SEe(e,t,o){if(!(0,tV.hasBlockSupport)(t,p1)||$t(t,wl,"fontFamily")||!o?.fontFamily)return e;let r=new yEe.default(e.className);r.add(`has-${oqe(o?.fontFamily)}-font-family`);let n=r.value;return e.className=n||void 0,e}function nqe({name:e,fontFamily:t}){return SEe({},e,{fontFamily:t})}var _$={useBlockProps:nqe,addSaveProps:SEe,attributeKeys:["fontFamily"],hasSupport(e){return(0,tV.hasBlockSupport)(e,p1)}};(0,bEe.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",rqe);var x$=c(go(),1),W_=c(ue(),1),kEe=c(WL(),1);var iqe=c(E(),1),ky="typography.fontSize";function sqe(e){return(0,W_.hasBlockSupport)(e,ky)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function _Ee(e,t,o){if(!(0,W_.hasBlockSupport)(t,ky)||$t(t,wl,"fontSize"))return e;let r=new kEe.default(e.className);r.add(yp(o.fontSize));let n=r.value;return e.className=n||void 0,e}function aqe({name:e,fontSize:t,style:o}){let[r,n,i]=Le("typography.fontSizes","typography.fluid","layout");if(!(0,W_.hasBlockSupport)(e,ky)||$t(e,wl,"fontSize")||!t&&!o?.typography?.fontSize)return;let s;if(o?.typography?.fontSize&&(s={style:{fontSize:ld({size:o.typography.fontSize},{typography:{fluid:n},layout:i})}}),t&&(s={style:{fontSize:bv(r,t,o?.typography?.fontSize).size}}),!!s)return _Ee(s,e,{fontSize:t})}var w$={useBlockProps:aqe,addSaveProps:_Ee,attributeKeys:["fontSize","style"],hasSupport(e){return(0,W_.hasBlockSupport)(e,ky)}},lqe={fontSize:[["fontSize"],["style","typography","fontSize"]]};function cqe(e,t,o,r){let n=e.name,i={fontSize:(0,W_.hasBlockSupport)(n,ky)};return QD(i,lqe,e,t,o,r)}(0,x$.addFilter)("blocks.registerBlockType","core/font/addAttribute",sqe);(0,x$.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",cqe);var rV=c(G(),1),$_=c(ue(),1);var CEe=c(Q(),1);var oV=c(Q(),1),xEe=c(F(),1);function Er(e){let t=ht(),{clientId:o=""}=t,r=(0,oV.useRegistry)(),n=(0,oV.useSelect)(i=>o?null:i(C).getBlockEditingMode(),[o]);return(0,xEe.useEffect)(()=>{if(!e)return;let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:a}=r.dispatch(C);return a(),i(o,e),()=>{a(),s(o)}},[r,o,e]),o?t[Fy]:n}var C$=c(E(),1),K_="typography.textAlign",uqe=[{icon:tp,title:(0,rV.__)("Align text left"),align:"left"},{icon:Qh,title:(0,rV.__)("Align text center"),align:"center"},{icon:op,title:(0,rV.__)("Align text right"),align:"right"}],wEe=["left","center","right"],dqe=[];function E$(e){return Array.isArray(e)?wEe.filter(t=>e.includes(t)):e===!0?wEe:dqe}function fqe(e,t){return e&&Hi(t)?"style-state":"block"}function pqe({clientId:e,style:t,name:o,setAttributes:r}){let i=xl(o)?.typography?.textAlign,s=Er(),{selectedState:a,isResponsiveEditing:l}=(0,CEe.useSelect)(m=>{let{getSelectedBlockStyleState:g,isResponsiveEditing:b}=H(m(C));return{selectedState:g(e),isResponsiveEditing:b()}},[e]);if(!i||s!=="default")return null;let u=E$((0,$_.getBlockSupport)(o,K_));if(!u.length)return null;let d=uqe.filter(m=>u.includes(m.align)),f=To(t,a),p=fqe(l,a),h=m=>{let g={...f,typography:{...f?.typography,textAlign:m}};r({style:Pn(t,a,g)})};return(0,C$.jsx)(No,{group:p,children:(0,C$.jsx)(qB,{value:f?.typography?.textAlign,onChange:h,alignmentControls:d})})}var nV={edit:pqe,useBlockProps:mqe,addSaveProps:hqe,attributeKeys:["style"],hasSupport(e){return(0,$_.hasBlockSupport)(e,K_,!1)}};function mqe({name:e,style:t}){if(!t?.typography?.textAlign||!E$((0,$_.getBlockSupport)(e,K_)).length||$t(e,wl,"textAlign"))return null;let r=t.typography.textAlign;return{className:K({[`has-text-align-${r}`]:r})}}function hqe(e,t,o){if(!o?.style?.typography?.textAlign)return e;let{textAlign:r}=o.style.typography,n=(0,$_.getBlockSupport)(t,K_);return E$(n).includes(r)&&!$t(t,wl,"textAlign")&&(e.className=K(`has-text-align-${r}`,e.className)),e}var R$=c(go(),1),uh=c(ue(),1),_y=c(F(),1),B$=c(Q(),1),m1=c(G(),1),iV=c(U(),1),OEe=c(fe(),1);function gqe(e,t){let o=e.scrollHeight>e.clientHeight,r=0,n=2400,i=r,s=window.getComputedStyle(e),a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingRight)||0,u=document.createRange();u.selectNodeContents(e);let d=e,f=e.parentElement;if(f){let h=window.getComputedStyle(f);h?.display==="flex"&&(d=f,a+=parseFloat(h.paddingLeft)||0,l+=parseFloat(h.paddingRight)||0)}let p=d.clientHeight;for(;r<=n;){let h=Math.floor((r+n)/2);t(h);let g=u.getBoundingClientRect().width,b=e.scrollWidth<=d.clientWidth&&g<=d.clientWidth-a-l,v=o||e.scrollHeight<=d.clientHeight||e.scrollHeight<=p;d.clientHeight>p&&(p=d.clientHeight),b&&v?(i=h,r=h+1):n=h-1}return u.detach(),i}function EEe(e,t){if(!e)return;t(0);let o=gqe(e,t);return t(o),o}var TEe=c(F(),1),REe=c(G(),1),BEe=c(U(),1),PEe=c(Qr(),1),T$=c(E(),1);function IEe(){let e=(0,REe.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,TEe.useEffect)(()=>{(0,PEe.speak)(e)},[e]),(0,T$.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,T$.jsx)(BEe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var Rs=c(E(),1),bqe={},yqe=12,Tf="typography.fitText";function vqe(e){return!(0,uh.hasBlockSupport)(e,Tf)||e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}}function Sqe({fitText:e,name:t,clientId:o}){let[r,n]=(0,_y.useState)(null),i=(0,uh.hasBlockSupport)(t,Tf),s=Nt(o),{blockAttributes:a,parentId:l,blockMode:u}=(0,B$.useSelect)(f=>{if(!o||!i||!e)return bqe;let p=f(C).getBlockMode(o);return p==="html"?{blockMode:p}:{blockAttributes:f(C).getBlockAttributes(o),parentId:f(C).getBlockRootClientId(o),blockMode:p}},[o,i,e]),d=(0,_y.useCallback)(()=>{if(!s||!i||!e)return;let f=`fit-text-${o}`,p=s.ownerDocument.getElementById(f);p||(p=s.ownerDocument.createElement("style"),p.id=f,s.ownerDocument.head.appendChild(p));let h=`#block-${o}`,g=EEe(s,b=>{b===0?p.textContent="":p.textContent=`${h} { font-size: ${b}px !important; }`});n(g)},[s,o,i,e]);return(0,_y.useEffect)(()=>{if(!e||!s||!o||!i||u==="html")return;let f=s,p=f.style.visibility,h=null,m=null,g=null;h=window.requestAnimationFrame(()=>{f.style.visibility="hidden",m=window.requestAnimationFrame(()=>{d(),g=setTimeout(()=>{f.style.visibility=p},10)})});let b;return window.ResizeObserver&&f.parentElement&&(b=new window.ResizeObserver(d),b.observe(f.parentElement),b.observe(f)),()=>{h!==null&&window.cancelAnimationFrame(h),m!==null&&window.cancelAnimationFrame(m),g!==null&&clearTimeout(g),b&&b.disconnect();let v=`fit-text-${o}`,y=f.ownerDocument.getElementById(v);y&&y.remove()}},[e,o,l,d,s,i,u]),(0,_y.useEffect)(()=>{if(e&&s&&i&&u!=="html"){let f=window.requestAnimationFrame(()=>{s&&d()});return()=>window.cancelAnimationFrame(f)}},[a,e,d,s,i,u]),{fontSize:r}}function kqe({clientId:e,fitText:t=!1,setAttributes:o,name:r,fontSize:n,style:i}){let s=(0,B$.useSelect)(a=>{let{hasSelectedStyleState:l}=H(a(C));return l(e)},[e]);return!(0,uh.hasBlockSupport)(r,Tf)||s?null:(0,Rs.jsx)(iV.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,m1.__)("Fit text"),onDeselect:()=>o({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:(0,Rs.jsx)(iV.ToggleControl,{label:(0,m1.__)("Fit text"),checked:t,onChange:()=>{let a=!t||void 0,l={fitText:a};a&&(n&&(l.fontSize=void 0),i?.typography?.fontSize&&(l.style={...i,typography:{...i?.typography,fontSize:void 0}})),o(l)},help:t?(0,m1.__)("Text will resize to fit its container."):(0,m1.__)("The text will resize to fit its container, resetting other font size settings.")})})}function _qe(e,t,o){if(!(0,uh.hasBlockSupport)(t,Tf))return e;let{fitText:r}=o;if(!r)return e;let n=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:n}}function xqe({name:e,fitText:t}){return t&&(0,uh.hasBlockSupport)(e,Tf)?{className:"has-fit-text"}:{}}(0,R$.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",vqe);var wqe=e=>(0,uh.hasBlockSupport)(e,Tf);function Cqe({fitText:e,name:t,clientId:o,isSelected:r}){let{fontSize:n}=Sqe({fitText:e,name:t,clientId:o});return r&&n&&nfunction(o){let{name:r,attributes:n,clientId:i,isSelected:s,setAttributes:a}=o,{fitText:l}=n;return(0,uh.hasBlockSupport)(r,Tf)?(0,Rs.jsxs)(Rs.Fragment,{children:[(0,Rs.jsx)(e,{...o}),(0,Rs.jsx)(Oe,{group:"typography",children:(0,Rs.jsx)(kqe,{clientId:i,fitText:l,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style})}),l&&(0,Rs.jsx)(Cqe,{fitText:l,name:r,clientId:i,isSelected:s})]}):(0,Rs.jsx)(e,{...o})},"addFitTextControl");(0,R$.addFilter)("editor.BlockEdit","core/fit-text/add-fit-text-control",Eqe);var sV={useBlockProps:xqe,addSaveProps:_qe,attributeKeys:["fitText","fontSize","style"],hasSupport:wqe,edit:()=>null};var P$=c(E(),1);function AEe(e,t){return Object.fromEntries(Object.entries(e).filter(([o])=>!t.includes(o)))}var Tqe="typography.__experimentalLetterSpacing",Rqe="typography.__experimentalTextTransform",Bqe="typography.__experimentalTextDecoration",Pqe="typography.textIndent",Iqe="typography.textColumns",Oqe="typography.__experimentalFontStyle",Aqe="typography.__experimentalFontWeight",Lqe="typography.__experimentalWritingMode",wl="typography",NEe=[gEe,ky,Oqe,Aqe,p1,K_,Iqe,Bqe,Pqe,Lqe,Rqe,Tqe,Tf];function DEe(e){let t={...AEe(e,["fontFamily"])},o=e?.typography?.fontSize,r=e?.typography?.fontFamily,n=e?.color?.text,i=typeof o=="string"&&o?.startsWith("var:preset|font-size|")?o.substring(21):void 0,s=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0,a=Po(n,"color");return t.typography={...AEe(t.typography,["fontFamily"]),fontSize:i?void 0:o},t.color={...t.color,text:a?void 0:n},{style:Ge(t),fontFamily:s,fontSize:i,textColor:a}}function VEe(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize},color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text}}}function Mqe({children:e,resetAllFilter:t}){let o=(0,aV.useCallback)(r=>{let n=VEe(r),i=t(n);return{...r,...DEe(i)}},[t]);return(0,P$.jsx)(Oe,{group:"typography",resetAllFilter:o,children:e})}function lV({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n}){let i=Ja(),s=vD(r),{style:a,fontFamily:l,fontSize:u,fitText:d,textColor:f,className:p}=(0,LEe.useSelect)(w=>{if(!s)return{};let{style:T,fontFamily:B,fontSize:R,fitText:I,textColor:A,className:P}=w(C).getBlockAttributes(e)||{};return{style:T,fontFamily:B,fontSize:R,fitText:I,textColor:A,className:P}},[e,s]),h=!Bn(i),{value:m}=_l(t,p,i),g=(0,aV.useMemo)(()=>h?To(a,i):VEe({style:a,fontFamily:l,fontSize:u,textColor:f}),[h,i,a,u,l,f]),b=h?w=>{o({style:Pn(a,i,w)})}:w=>{let T=DEe(w);(T.fontSize||T.style?.typography?.fontSize)&&d&&(T.fitText=void 0),o(T)},v=!g?.color?.gradient&&!!g?.color?.text&&r?.color?.text&&(0,h1.getBlockSupport)(t,["color","enableContrastChecker"])!==!1,y=H_({clientId:e,name:t,enabled:!!v,checkLinkColor:!1,messageOverride:(0,MEe.__)("This color has poor contrast against the background. Consider increasing contrast.")});if(!s)return null;let k=(0,h1.getBlockSupport)(t,[wl,"__experimentalDefaultControls"]),S=(0,h1.getBlockSupport)(t,["color","__experimentalDefaultControls"]),_={...k,textColor:S?.text};return(0,P$.jsx)(SD,{as:n||Mqe,panelId:e,settings:r,value:g,onChange:b,defaultControls:_,contrastWarning:y,inheritedValue:m})}var Jo=c(E(),1);function O$({blockName:e,clientId:t,contentClientIds:o}){let r=xl(e),{updateBlockAttributes:n}=(0,cV.useDispatch)(C),{hasButtons:i,hasHeading:s}=(0,cV.useSelect)(d=>{let f=d(C).getBlockNamesByClientId(o);return{hasButtons:f.includes("core/buttons"),hasHeading:f.includes("core/heading")}},[o]),a=d=>{n(t,d)},l=(0,I$.useMemo)(()=>({...r,typography:{}}),[r]),u=(0,I$.useMemo)(()=>({...r,background:{...r.background,backgroundImage:!1,backgroundSize:!1}}),[r]);return(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(lV,{clientId:t,name:e,settings:l,setAttributes:a,asWrapper:QW}),(0,Jo.jsx)(ZD,{clientId:t,name:e,settings:u,setAttributes:a,asWrapper:s$}),(0,Jo.jsx)(eV,{clientId:t,name:e,settings:r,setAttributes:a,asWrapper:ZW,label:(0,dh.__)("Elements"),defaultControls:{button:i,heading:s}})]})}var Nqe=({blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:r,contentClientIds:n})=>{let i=hy({blockName:e});return(0,Jo.jsxs)(Jo.Fragment,{children:[o&&(0,Jo.jsx)(Xk,{clientId:t}),r&&e!=="core/template-part"&&(0,Jo.jsx)(O$,{blockName:e,clientId:t,contentClientIds:n}),(!r||e==="core/template-part")&&(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(Oe.Slot,{group:"typography",label:(0,dh.__)("Typography")}),(0,Jo.jsx)(Oe.Slot,{group:"color",label:(0,dh.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(Oe.Slot,{group:"background",label:(0,dh.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(Oe.Slot,{group:"filter"}),(0,Jo.jsx)(Oe.Slot,{group:"layout",label:(0,dh.__)("Layout")}),(0,Jo.jsx)(Oe.Slot,{group:"dimensions",label:(0,dh.__)("Dimensions")}),(0,Jo.jsx)(Oe.Slot,{group:"border",label:i}),(0,Jo.jsx)(Oe.Slot,{group:"elements",label:(0,dh.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"}),(0,Jo.jsx)(dD,{}),(0,Jo.jsx)(Oe.Slot,{group:"styles"})]})]})},FEe=Nqe;var jEe=c(U(),1),HEe=c(G(),1);var zEe=c(ue(),1),uV=c(Q(),1),fa=c(U(),1);var Cl=c(E(),1);function dV({clientIds:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){return e.length?(0,Cl.jsx)(fa.__experimentalVStack,{spacing:1,children:e.map(n=>(0,Cl.jsx)(Dqe,{onSelect:t,onSwitchToListView:o,hasListViewTab:r,clientId:n},n))}):null}function Dqe({clientId:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){let n=Do(e),{isSelected:i,childBlocks:s,shouldRenderListView:a,blockName:l}=(0,uV.useSelect)(g=>{let{isBlockSelected:b,hasSelectedInnerBlock:v,getBlockOrder:y,getBlockName:k,shouldRenderBlockListView:S}=H(g(C)),_=k(e);return{isSelected:b(e)||v(e,!0),childBlocks:y(e),shouldRenderListView:S(e),blockName:_}},[e]),u=(0,zEe.getBlockType)(l),f=jn({clientId:e,context:"list-view"})||u?.title||l,{selectBlock:p}=(0,uV.useDispatch)(C),m=s&&s.length>0&&r&&a;return(0,Cl.jsx)(fa.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:i,onClick:async()=>{await p(e),m&&o&&o(e),t&&t(e)},children:(0,Cl.jsxs)(fa.Flex,{children:[(0,Cl.jsx)(fa.FlexItem,{children:(0,Cl.jsx)(Et,{icon:n?.icon})}),(0,Cl.jsx)(fa.FlexBlock,{style:{textAlign:"left"},children:(0,Cl.jsx)(fa.__experimentalTruncate,{children:f})}),m&&(0,Cl.jsx)(fa.FlexItem,{children:(0,Cl.jsx)(gt,{icon:un,size:24})})]})})}var Y_=c(E(),1),Vqe=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:o})=>{if(!e||e.length===0)return null;let r=window?.__experimentalContentOnlyInspectorFields;return(0,Y_.jsx)(Y_.Fragment,{children:!r&&(0,Y_.jsx)(jEe.PanelBody,{title:(0,HEe.__)("Content"),children:(0,Y_.jsx)(dV,{clientIds:e,onSwitchToListView:t,hasListViewTab:o})})})},fV=Vqe;var qr=c(E(),1),{Tabs:fh}=H(pV.privateApis);function A$({blockName:e,clientId:t,hasBlockStyles:o,tabs:r,isSectionBlock:n,contentClientIds:i}){let s=(0,Bc.useRef)(null),a=(0,q_.useSelect)(S=>S(UEe.store).get("core","showIconLabels"),[]),{requestedTab:l}=(0,q_.useSelect)(S=>({requestedTab:H(S(C)).getRequestedInspectorTab()})),[u,d]=(0,Bc.useState)(()=>l?.tabName??r[0]?.name),f=(0,Bc.useRef)(!1),p=(0,Bc.useRef)(!1),{__unstableSetOpenListViewPanel:h,__unstableIncrementListViewExpandRevision:m,__unstableSetAllListViewPanelsOpen:g}=(0,q_.useDispatch)(C),{clearRequestedInspectorTab:b}=H((0,q_.useDispatch)(C));(0,Bc.useEffect)(()=>{f.current=!1},[t]),(0,Bc.useEffect)(()=>{l&&(d(l.tabName),l.tabName===Sf.name&&l.options?.openPanel&&(h(l.options.openPanel),m()),p.current=!0,f.current=!0,b())},[l,h,m,b]),(0,Bc.useEffect)(()=>{u===Sf.name&&!f.current&&(g(),m())},[t,u,g,m]),(0,Bc.useEffect)(()=>{if(!r?.length||f.current&&r.some(_=>_.name===u))return;let S=r[0]?.name;u!==S&&d(S)},[r,u]);let v=S=>{d(S),f.current=!0,S===Sf.name&&!p.current&&(g(),m()),p.current=!1},y=r.some(S=>S.name===Sf.name),k=S=>{y&&(h(S),m(),p.current=!0,v(Sf.name))};return(0,qr.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,qr.jsxs)(fh,{selectedTabId:u,onSelect:v,children:[(0,qr.jsx)(fh.TabList,{children:r.map(S=>a?(0,qr.jsx)(fh.Tab,{tabId:S.name,children:S.title},S.name):(0,qr.jsxs)(kt.Root,{children:[(0,qr.jsx)(fh.Tab,{tabId:S.name,"aria-label":S.title,render:(0,qr.jsx)(kt.Trigger,{}),children:(0,qr.jsx)(pV.Icon,{icon:S.icon})}),(0,qr.jsx)(kt.Popup,{children:S.title})]},S.name))}),(0,qr.jsxs)(fh.TabPanel,{tabId:lD.name,focusable:!1,children:[(0,qr.jsx)(fV,{contentClientIds:i,onSwitchToListView:k,hasListViewTab:y}),(0,qr.jsx)(Oe.Slot,{group:"content"})]}),(0,qr.jsxs)(fh.TabPanel,{tabId:Sf.name,focusable:!1,children:[(0,qr.jsx)(Oe.Slot,{group:"list",ref:s}),(0,qr.jsx)(J2,{listViewRef:s})]}),(0,qr.jsx)(fh.TabPanel,{tabId:sD.name,focusable:!1,children:(0,qr.jsx)(I0e,{showAdvancedControls:!!e})}),(0,qr.jsx)(fh.TabPanel,{tabId:aD.name,focusable:!1,children:(0,qr.jsx)(FEe,{blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:n,contentClientIds:i})})]},t)})}var Bs=c(U(),1),GEe=c(Q(),1);var Fqe=[];function zqe(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function WEe(e,t,o,r){let n=[],{bindings:i,border:s,color:a,content:l,default:u,layout:d,dimensions:f,list:p,position:h,styles:m,typography:g,effects:b}=dc,v=(0,Bs.__experimentalUseSlotFills)(p.name),y=!!v&&v.length,k=(0,Bs.__experimentalUseSlotFills)(l.name),S=!!k&&k.length,x=[...(0,Bs.__experimentalUseSlotFills)(s.name)||[],...(0,Bs.__experimentalUseSlotFills)(a.name)||[],...(0,Bs.__experimentalUseSlotFills)(d.name)||[],...(0,Bs.__experimentalUseSlotFills)(h.name)||[],...(0,Bs.__experimentalUseSlotFills)(f.name)||[],...(0,Bs.__experimentalUseSlotFills)(m.name)||[],...(0,Bs.__experimentalUseSlotFills)(g.name)||[],...(0,Bs.__experimentalUseSlotFills)(b.name)||[]].length,w=[...(0,Bs.__experimentalUseSlotFills)(Cm.slotName)||[],...(0,Bs.__experimentalUseSlotFills)(i.name)||[]],T=[...(0,Bs.__experimentalUseSlotFills)(u.name)||[],...y&&x>1?w:[]],B=window?.__experimentalContentOnlyInspectorFields,R=S||!B&&t?.length;R&&n.push(lD),y&&n.push(Sf),(T.length||w.length&&(R||y))&&n.push(sD);let{tabSettings:I,isPreviewMode:A}=(0,GEe.useSelect)(O=>{let N=O(C).getSettings();return{tabSettings:N.blockInspectorTabs,isPreviewMode:N.isPreviewMode}},[]);return!A&&(r||x)&&n.push(aD),zqe(e,I)?n:Fqe}var $Ee=c(U(),1);var L$=c(E(),1),{Fill:jqe,Slot:Hqe}=(0,$Ee.createSlotFill)(Symbol("InspectorControlsLastItem")),KEe=e=>ht()[Dl]?(0,L$.jsx)(jqe,{...e}):null;KEe.Slot=function(t){return(0,L$.jsx)(Hqe,{...t})};var mV=KEe;var YEe=c(Q(),1);function qEe(e){return(0,YEe.useSelect)(t=>{if(e){let o=t(C).getSettings().blockInspectorAnimation,r=o?.animationParent,{getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=t(C),s=n();return!i(s,r,!0)[0]&&e.name!==r?null:o?.[e.name]}return null},[e])}var hV=c(F(),1);var ph=c(G(),1);var N$=c(E(),1),{getViewportBreakpoints:Uqe}=H(Sr),ZEe={":hover":(0,ph._x)("Hover","Name for the CSS pseudo-class selector"),":focus":(0,ph._x)("Focus","Name for the CSS pseudo-class selector"),":focus-visible":(0,ph._x)("Focus-visible","Name for the CSS pseudo-class selector"),":active":(0,ph._x)("Active","Name for the CSS pseudo-class selector")},Gqe={"@tablet":(0,ph.__)("Tablet"),"@mobile":(0,ph.__)("Mobile")};function Wqe(e){let t=Uqe(e);return Object.entries(Gqe).filter(([o])=>(o!=="@tablet"||t.tablet!==void 0)&&(o!=="@mobile"||t.mobile!==void 0)).map(([o,r])=>({value:o,label:r}))}var gV={"core/button":[":hover",":focus",":focus-visible",":active"],"core/navigation-link":[":hover",":focus",":focus-visible",":active"]};function XEe(e){return(gV[e]??[]).filter(o=>ZEe[o]).map(o=>({value:o,label:ZEe[o]}))}var M$="default",$qe=[];function QEe({name:e,value:t,onChange:o}){let r=(0,hV.useMemo)(()=>XEe(e),[e]),n=xr();return r.length?(0,N$.jsx)(jD,{pseudoStates:r,pseudoStateValue:t?.pseudo??M$,onChangePseudoState:i=>o({pseudo:i}),popoverProps:n.popoverProps,showText:!1}):null}function JEe({name:e,value:t,isResponsiveEditing:o}){let r=(0,hV.useMemo)(()=>XEe(e),[e]),[n]=Le("viewport"),i=(0,hV.useMemo)(()=>Wqe(n),[n]);return!r.length&&!o?null:(0,N$.jsx)(HD,{viewportStates:o?i:$qe,pseudoStates:r,viewportValue:t?.viewport??M$,pseudoStateValue:t?.pseudo??M$})}var Fe=c(E(),1);function t1e({blockName:e,showAdvancedControls:t=!0,showPositionControls:o=!0,showBindingsControls:r=!0}){let n=hy({blockName:e});return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Oe.Slot,{}),(0,Fe.jsx)(Oe.Slot,{group:"typography",label:(0,qi.__)("Typography")}),(0,Fe.jsx)(Oe.Slot,{group:"color",label:(0,qi.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"background",label:(0,qi.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"layout",label:(0,qi.__)("Layout")}),(0,Fe.jsx)(Oe.Slot,{group:"dimensions",label:(0,qi.__)("Dimensions")}),(0,Fe.jsx)(Oe.Slot,{group:"border",label:n}),(0,Fe.jsx)(Oe.Slot,{group:"elements",label:(0,qi.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"}),o&&(0,Fe.jsx)(dD,{}),(0,Fe.jsx)(Oe.Slot,{group:"styles"}),r&&(0,Fe.jsx)(Oe.Slot,{group:"bindings"}),t&&(0,Fe.jsx)("div",{children:(0,Fe.jsx)(cD,{})})]})}function Kqe({blockName:e,clientId:t,contentClientIds:o,isSectionBlock:r,selectedBlockStyleState:n}){let i=hy({blockName:e}),s=Hi(n)&&!ea(n),a=r&&e!=="core/template-part";return(0,Fe.jsxs)(Fe.Fragment,{children:[a&&(0,Fe.jsx)(q2,{value:n,children:(0,Fe.jsx)(O$,{blockName:e,clientId:t,contentClientIds:o})}),!a&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Oe.Slot,{group:"typography",label:(0,qi.__)("Typography")}),(0,Fe.jsx)(Oe.Slot,{group:"color",label:(0,qi.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Fe.jsx)(Oe.Slot,{group:"background",label:(0,qi.__)("Background"),className:"background-block-support-panel__inner-wrapper"}),s&&(0,Fe.jsx)(Oe.Slot,{group:"layout",label:(0,qi.__)("Layout")}),(0,Fe.jsx)(Oe.Slot,{group:"dimensions",label:(0,qi.__)("Dimensions")}),(0,Fe.jsx)(Oe.Slot,{group:"border",label:i}),(0,Fe.jsx)(Oe.Slot,{group:"elements",label:(0,qi.__)("Elements"),className:"elements-block-support-panel__inner-wrapper"})]})]})}function Yqe(){let{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:o,blockType:r,isSectionBlock:n,isSectionBlockInSelection:i,hasBlockStyles:s,editedContentOnlySection:a,blockEditingMode:l,selectedBlockStyleState:u,showStateOnCanvas:d,isResponsiveEditing:f,blockStatesEditingEnabled:p}=(0,g1.useSelect)(_=>{let{getSettings:x,getSelectedBlockClientId:w,getSelectedBlockClientIds:T,getSelectedBlockCount:B,getBlockName:R,getParentSectionBlock:I,isSectionBlock:A,getEditedContentOnlySection:P,isWithinEditedContentOnlySection:O,getBlockEditingMode:N,getSelectedBlockStyleState:z,isSelectedBlockStyleStateShownOnCanvas:V,isResponsiveEditing:M}=H(_(C)),{getBlockStyles:D}=_(Z_.store),L=w(),q=O(L)?L:I(L)||L,J=q&&R(q),te=J&&(0,Z_.getBlockType)(J),$=T().some(Z=>A(Z)),W=J&&D(J),Y=W&&W.length>0;return{selectedBlockCount:B(),renderedBlockClientId:q,renderedBlockName:J,blockType:te,isSectionBlockInSelection:$,isSectionBlock:A(q),hasBlockStyles:Y,editedContentOnlySection:P(),blockEditingMode:N(q),selectedBlockStyleState:z(q),showStateOnCanvas:V(q),isResponsiveEditing:M(),blockStatesEditingEnabled:x().blockStatesEditingEnabled}},[]),h=(0,g1.useSelect)(_=>{if(!n||!o)return[];let{getClientIdsOfDescendants:x,getBlockEditingMode:w,shouldRenderBlockListView:T}=H(_(C)),B=x(o),R=new Set;return B.forEach(I=>{T(I)&&x(I).forEach(P=>R.add(P))}),B.filter(I=>!R.has(I)&&w(I)==="contentOnly")},[n,o]),m=WEe(r?.name,h,n,s),g=m?.length>1,b=qEe(r),v=e>1,y=!Bn(u);if(v&&!i)return(0,Fe.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Fe.jsx)(HW,{}),g?(0,Fe.jsx)(A$,{tabs:m}):(0,Fe.jsx)(t1e,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(v&&i)return(0,Fe.jsx)("div",{className:"block-editor-block-inspector",children:(0,Fe.jsx)(HW,{})});let k=t===(0,Z_.getUnregisteredTypeHandlerName)();return!r||!o||k?(0,Fe.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,qi.__)("No block selected.")}):(0,Fe.jsx)(qqe,{animate:b,wrapper:_=>(0,Fe.jsx)(Zqe,{blockInspectorAnimationSettings:b,renderedBlockClientId:o,children:_}),children:(0,Fe.jsx)(Xqe,{renderedBlockClientId:o,blockName:r.name,isSectionBlock:n,availableTabs:m,contentClientIds:h,hasBlockStyles:s,editedContentOnlySection:a,blockEditingMode:l,selectedBlockStyleState:u,showStateOnCanvas:d,isResponsiveEditing:f,blockStatesEditingEnabled:p,isBlockStyleStateSelected:y})})}var qqe=({animate:e,wrapper:t,children:o})=>e?t(o):o,Zqe=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:o})=>{let r=e&&e.enterDirection==="leftToRight"?-50:50;return(0,Fe.jsx)(X_.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:o},t)},Xqe=({renderedBlockClientId:e,blockName:t,isSectionBlock:o,availableTabs:r,contentClientIds:n,hasBlockStyles:i,editedContentOnlySection:s,blockEditingMode:a,selectedBlockStyleState:l,showStateOnCanvas:u,isResponsiveEditing:d,blockStatesEditingEnabled:f=!0})=>{let p=(0,e1e.useRef)(null),h=r?.length>1,m=ea(l),g=Hi(l)&&d||ea(l),b=s&&s!==e,v=Do(s),y=Do(e),k=y.isSynced,{setSelectedBlockStyleState:S,setSelectedBlockStyleStateCanvasPreview:_}=H((0,g1.useDispatch)(C)),x=T=>{S(e,T)},w=T=>{_(e,T)};return(0,Fe.jsxs)("div",{className:"block-editor-block-inspector",children:[b&&(0,Fe.jsx)(cC,{...v,className:v?.isSynced&&"is-synced",parentClientId:s}),(0,Fe.jsx)(cC,{...y,allowParentNavigation:!0,className:k&&"is-synced",isChild:b,clientId:e,controls:a==="default"&&f&&(0,Fe.jsx)(QEe,{name:t,value:l,onChange:x})}),a==="default"&&g&&(0,Fe.jsxs)(X_.__experimentalSpacer,{paddingX:4,paddingY:2,children:[m&&(0,Fe.jsx)(X_.ToggleControl,{label:(0,qi.__)("Show state on canvas"),checked:u,onChange:w}),(0,Fe.jsx)(JEe,{name:t,value:l,isResponsiveEditing:d})]}),(0,Fe.jsx)(cte,{clientId:e}),(0,Fe.jsx)(S0e,{clientId:e}),!g&&(0,Fe.jsx)(AM,{blockClientId:e}),(0,Fe.jsx)(B0e,{}),g&&(0,Fe.jsx)(Kqe,{blockName:t,clientId:e,contentClientIds:n,isSectionBlock:o,selectedBlockStyleState:l}),!g&&h&&(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(A$,{hasBlockStyles:i,clientId:e,blockName:t,tabs:r,isSectionBlock:o,contentClientIds:n})}),!g&&!h&&(0,Fe.jsxs)(Fe.Fragment,{children:[i&&(0,Fe.jsx)(Xk,{clientId:e}),(0,Fe.jsx)(fV,{contentClientIds:n}),(0,Fe.jsx)(Oe.Slot,{group:"content"}),(0,Fe.jsx)(Oe.Slot,{group:"list",ref:p}),(0,Fe.jsx)(J2,{listViewRef:p}),!o&&(0,Fe.jsx)(t1e,{blockName:t})]}),!g&&(0,Fe.jsx)(mV.Slot,{}),(0,Fe.jsx)(nD,{},"back")]})},o1e=Yqe;var D$=c(Rt(),1);var r1e=c(E(),1),n1e=()=>((0,D$.default)("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),pC());function i1e(e){return(0,D$.default)("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,r1e.jsx)("div",{...e,ref:pC()})}var s1e=c(Q(),1),V$=c(F(),1);var F$=c(E(),1),Qqe=()=>{};function Jqe({rootClientId:e,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:l,onPatternCategorySelection:u,onSelect:d=Qqe,shouldFocusBlock:f=!1,onClose:p},h){let{destinationRootClientId:m}=(0,s1e.useSelect)(g=>{let{getBlockRootClientId:b}=g(C);return{destinationRootClientId:e||b(t)||void 0}},[t,e]);return(0,F$.jsx)(s9,{onSelect:d,rootClientId:m,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n,__experimentalInsertionIndex:i,__experimentalFilterValue:l,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:f,ref:h,onClose:p})}var z$=(0,V$.forwardRef)(Jqe);function eZe(e,t){return(0,F$.jsx)(z$,{...e,onPatternCategorySelection:void 0,ref:t})}var a1e=(0,V$.forwardRef)(eZe);var l1e=c(Rt(),1);function c1e(){return(0,l1e.default)("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}var u1e=c(fe(),1),b1=c(Tt(),1),mh=c(io(),1),d1e=c(E(),1),tZe=window.navigator.userAgent.indexOf("Trident")!==-1,oZe=new Set([mh.UP,mh.DOWN,mh.LEFT,mh.RIGHT]),rZe=.75;function j$(){return(0,u1e.useRefEffect)(e=>{let{ownerDocument:t}=e,{defaultView:o}=t,r,n,i;function s(){r||(r=o.requestAnimationFrame(()=>{f(),r=null}))}function a(g){n&&o.cancelAnimationFrame(n),n=o.requestAnimationFrame(()=>{l(g),n=null})}function l({keyCode:g}){if(!h())return;let b=(0,b1.computeCaretRect)(o);if(!b)return;if(!i){i=b;return}if(oZe.has(g)){i=b;return}let v=b.top-i.top;if(v===0)return;let y=(0,b1.getScrollContainer)(e);if(!y)return;let k=y===t.body||y===t.documentElement,S=k?o.scrollY:y.scrollTop,_=k?0:y.getBoundingClientRect().top,x=k?i.top/o.innerHeight:(i.top-_)/(o.innerHeight-_);if(S===0&&x_+w||i.top<_){i=b;return}k?o.scrollBy(0,v):y.scrollTop+=v}function u(){t.addEventListener("selectionchange",d)}function d(){t.removeEventListener("selectionchange",d),f()}function f(){h()&&(i=(0,b1.computeCaretRect)(o))}function p(){let{activeElement:g}=t;if(!g)return null;if(!g.isContentEditable||!g.contains(e))return g;let{anchorNode:b}=o.getSelection();return b?(b.nodeType===b.ELEMENT_NODE?b:b.parentElement)?.closest('[contenteditable="true"]')??null:null}function h(){let g=p();return!!g&&e.contains(g)&&g.isContentEditable}function m(){let g=e.querySelectorAll('[contenteditable="true"]');return g[g.length-1]===p()}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),e.addEventListener("keydown",a),e.addEventListener("keyup",l),e.addEventListener("mousedown",u),e.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),e.removeEventListener("keydown",a),e.removeEventListener("keyup",l),e.removeEventListener("mousedown",u),e.removeEventListener("touchstart",u),t.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(n)}},[])}function nZe({children:e}){return(0,d1e.jsx)("div",{ref:j$(),className:"block-editor__typewriter",children:e})}var iZe=tZe?e=>e.children:nZe,f1e=iZe;var xy=c(F(),1),H$=c(Rt(),1);var U$=c(E(),1),bV=(0,xy.createContext)({});bV.displayName="RenderedRefsContext";function sZe(e,t,o){let r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(o),r}function G$({children:e,uniqueId:t,blockName:o=""}){let r=(0,xy.useContext)(bV),{name:n}=ht();o=o||n;let i=(0,xy.useMemo)(()=>sZe(r,o,t),[r,o,t]);return(0,U$.jsx)(bV.Provider,{value:i,children:e})}function W$(e,t=""){let o=(0,xy.useContext)(bV),{name:r}=ht();return t=t||r,!!o[t]?.has(e)}var p1e=e=>((0,H$.default)("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,U$.jsx)(G$,{...e})),m1e=(...e)=>((0,H$.default)("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),W$(...e));var vV=c(U(),1),$$=c(G(),1),K$=c(F(),1),g1e=c(Tu(),1);var pa=c(U(),1);var h1e=c(G(),1),Rf=c(E(),1);function yV({title:e,help:t,actions:o=[],onClose:r}){return(0,Rf.jsxs)(pa.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Rf.jsxs)(pa.__experimentalHStack,{alignment:"center",children:[(0,Rf.jsx)(pa.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Rf.jsx)(pa.__experimentalSpacer,{}),o.map(({label:n,icon:i,onClick:s})=>(0,Rf.jsx)(pa.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:n,icon:i,variant:!i&&"tertiary",onClick:s,children:!i&&n},n)),r&&(0,Rf.jsx)(pa.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,h1e.__)("Close"),icon:tg,onClick:r})]}),t&&(0,Rf.jsx)(pa.__experimentalText,{children:t})]})}var Q_=c(E(),1);function aZe({onClose:e,onChange:t,showPopoverHeaderActions:o,isCompact:r,currentDate:n,title:i,...s},a){let l={startOfWeek:(0,g1e.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:n,currentTime:r?n:void 0,...s},u=r?vV.TimePicker:vV.DateTimePicker;return(0,Q_.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,Q_.jsx)(yV,{title:i||(0,$$.__)("Publish"),actions:o?[{label:(0,$$.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,Q_.jsx)(u,{...l})]})}var Y$=(0,K$.forwardRef)(aZe);function lZe(e,t){return(0,Q_.jsx)(Y$,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}var b1e=(0,K$.forwardRef)(lZe);var y1e=c(Rt(),1),v1e=c(F(),1);function cZe(){return(0,y1e.default)("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null}var S1e=(0,v1e.forwardRef)(cZe);var v1=c(E(),1),Ge=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;let t=Object.entries(e).map(([o,r])=>[o,Ge(r)]).filter(([,o])=>o!==void 0);return t.length?Object.fromEntries(t):void 0};function QD(e,t,o,r,n,i){if(Object.values(e??{}).every(l=>!l)||i.length===1&&o.innerBlocks.length===r.length)return o;let s=r[0]?.attributes;if(i.length>1&&r.length>1)if(r[n])s=r[n]?.attributes;else return o;let a=o;return Object.entries(e).forEach(([l,u])=>{u&&t[l].forEach(d=>{let f=cd(s,d);f&&(a={...a,attributes:De(a.attributes,d,f)})})}),a}function $t(e,t,o){let n=(0,k1e.getBlockSupport)(e,t)?.__experimentalSkipSerialization;return Array.isArray(n)?n.includes(o):n}var Bf=new WeakMap;function el({id:e,css:t}){return Rc({id:e,css:t})}function Rc({id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i}={}){let{setStyleOverride:s,deleteStyleOverride:a}=H((0,SV.useDispatch)(C)),l=(0,SV.useRegistry)(),u=(0,El.useId)();(0,El.useEffect)(()=>{if(!t&&!o)return;let d=e||u,f={id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i};return Bf.get(l)||Bf.set(l,[]),Bf.get(l).push([d,f]),window.queueMicrotask(()=>{Bf.get(l)?.length&&l.batch(()=>{Bf.get(l).forEach(p=>{s(...p)}),Bf.set(l,[])})}),()=>{Bf.get(l)?.find(([h])=>h===d)?Bf.set(l,Bf.get(l).filter(([h])=>h!==d)):a(d)}},[e,t,i,o,r,u,s,a,l,n])}function xl(e,t){let[o,r,n,i,s,a,l,u,d,f,p,h,m,g,b,v,y,k,S,_,x,w,T,B,R,I,A,P,O,N,z,V,M,D,L,j,q,J,te,ee,$,W,Y,Z,oe,ne,X,re,ae,ve,xe,ge,be,he,ke,_e,we,Re,se,ie,Ae,ye,Ee]=Le("background.backgroundImage","background.backgroundSize","background.gradient","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.minWidth","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),qe=(0,El.useMemo)(()=>({background:{backgroundImage:o,backgroundSize:r,gradient:n},color:{palette:{custom:Z,theme:ne,default:X},gradients:{custom:be,theme:he,default:ke},duotone:{custom:ve,theme:xe,default:ge},defaultGradients:_e,defaultPalette:re,defaultDuotone:ae,custom:Y,customGradient:we,customDuotone:oe,background:Re,link:se,heading:Ae,button:ye,text:ie},typography:{fontFamilies:{custom:i,default:s,theme:a},fontSizes:{custom:u,default:d,theme:f},customFontSize:p,defaultFontSizes:l,fontStyle:h,fontWeight:m,lineHeight:g,textAlign:b,textColumns:v,textDecoration:y,textIndent:k,textTransform:_,letterSpacing:x,writingMode:S},spacing:{spacingSizes:{custom:A,default:P,theme:O},customSpacingSize:I,defaultSpacingSizes:R,padding:w,margin:T,blockGap:B,units:N},border:{color:J,radius:te,style:ee,width:$,radiusSizes:W},dimensions:{aspectRatio:z,height:V,minHeight:M,minWidth:D,width:L,dimensionSizes:j},layout:q,parentLayout:t,shadow:Ee}),[o,r,n,i,s,a,l,u,d,f,p,h,m,g,b,v,y,k,_,x,S,w,T,B,R,I,A,P,O,N,z,V,M,D,L,j,q,t,J,te,ee,$,W,Y,Z,oe,ne,X,re,ae,ve,xe,ge,be,he,ke,_e,we,Re,se,ie,Ae,ye,Ee]);return fD(qe,e)}function _1e(e){e=e.map(o=>({...o,Edit:(0,El.memo)(o.edit)}));let t=(0,q$.createHigherOrderComponent)(o=>function(n){let i=ht();return[...e.map((s,a)=>{let{Edit:l,hasSupport:u,attributeKeys:d=[],shareWithChildBlocks:f,supportsPatternEditing:p}=s;if(!(p&&i[Kf]||i[Dl]||i[Vy]&&f)||!u(n.name))return null;let m={};for(let g of d)n.attributes[g]&&(m[g]=n.attributes[g]);return(0,v1.jsx)(l,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...m},a)}),(0,v1.jsx)(o,{...n},"edit")]},"withBlockEditHooks");(0,y1.addFilter)("editor.BlockEdit","core/editor/hooks",t)}function uZe({index:e,useBlockProps:t,setAllWrapperProps:o,...r}){let n=t(r),i=s=>o(a=>{let l=[...a];return l[e]=s,l});return(0,El.useEffect)(()=>(i(n),()=>{i(void 0)})),null}var dZe=(0,El.memo)(uZe);function x1e(e){let t=(0,q$.createHigherOrderComponent)(o=>function(n){let[i,s]=(0,El.useState)(Array(e.length).fill(void 0));return[...e.map((a,l)=>{let{hasSupport:u,attributeKeys:d=[],useBlockProps:f,isMatch:p}=a,h={};for(let m of d)n.attributes[m]&&(h[m]=n.attributes[m]);return!Object.keys(h).length||!u(n.name)||p&&!p(h)?null:(0,v1.jsx)(dZe,{index:l,useBlockProps:f,setAllWrapperProps:s,name:n.name,clientId:n.clientId,...h},l)}),(0,v1.jsx)(o,{...n,wrapperProps:i.filter(Boolean).reduce((a,l)=>({...a,...l,className:K(a.className,l.className),style:{...a.style,...l.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,y1.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}function w1e(e){function t(o,r,n){return e.reduce((i,s)=>{let{hasSupport:a,attributeKeys:l=[],addSaveProps:u}=s,d={};for(let f of l)n[f]&&(d[f]=n[f]);return!Object.keys(d).length||!a(r)?i:u(i,r,d)},o)}(0,y1.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),(0,y1.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",o=>(o.hasOwnProperty("className")&&!o.className&&delete o.className,o))}var C1e=c(ue(),1),E1e=c(go(),1);function fZe(e){let{apiVersion:t=1}=e;return t<2&&(0,C1e.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}(0,E1e.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",fZe);function T1e(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};pZe=e;let t=new window.MutationObserver(o=>{o.forEach(r=>{[r.addedNodes,r.target].forEach(n=>{(n instanceof window.NodeList?n:[n]).forEach(s=>{let a=s;a.querySelectorAll&&(a.querySelectorAll("source,script,video,link").forEach(l=>{T1e(l)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(a.nodeName)&&T1e(a))})})})});e()}var pZe;var R1e=c(go(),1),Tl=c(ue(),1);var Z$=c(E(),1),X$=["left","center","right","wide","full"],mZe=["wide","full"];function Q$(e,t=!0,o=!0){let r;return Array.isArray(e)?r=X$.filter(n=>e.includes(n)):e===!0?r=[...X$]:r=[],!o||e===!0&&!t?r.filter(n=>!mZe.includes(n)):r}function hZe(e){return"type"in(e.attributes?.align??{})||(0,Tl.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...X$,""]}}),e}function gZe({name:e,align:t,setAttributes:o}){let r=Q$((0,Tl.getBlockSupport)(e,"align"),(0,Tl.hasBlockSupport)(e,"alignWide",!0)),n=Fw(r).map(({name:a})=>a),i=Er();return!n.length||i!=="default"?null:(0,Z$.jsx)(No,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Z$.jsx)(pP,{value:t,onChange:a=>{a||(0,Tl.getBlockType)(e)?.attributes?.align?.default&&(a=""),o({align:a})},controls:n})})}var kV={shareWithChildBlocks:!0,edit:gZe,useBlockProps:bZe,addSaveProps:yZe,attributeKeys:["align"],hasSupport(e){return(0,Tl.hasBlockSupport)(e,"align",!1)}};function bZe({name:e,align:t}){let o=Q$((0,Tl.getBlockSupport)(e,"align"),(0,Tl.hasBlockSupport)(e,"alignWide",!0));return Fw(o).some(n=>n.name===t)?{"data-align":t}:{}}function yZe(e,t,o){let{align:r}=o,n=(0,Tl.getBlockSupport)(t,"align"),i=(0,Tl.hasBlockSupport)(t,"alignWide",!0);return Q$(n,i).includes(r)&&(e.className=K(`align${r}`,e.className)),e}(0,R1e.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",hZe);var B1e=c(go(),1);function vZe(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}(0,B1e.addFilter)("blocks.registerBlockType","core/lock/addAttribute",vZe);var rK=c(go(),1),rx=c(ue(),1);var S1=c(U(),1),wV=c(G(),1),j1e=c(F(),1),H1e=c(Q(),1),CV=c(ue(),1);var Ps=c(U(),1),V1e=c(F(),1),ox=c(G(),1),F1e=c(Q(),1);var tK=c(ue(),1),M1e=c(Q(),1),tx=c(U(),1),Pc=c(G(),1),_V=c(F(),1),N1e=c(fe(),1),D1e=c(Qr(),1);var J$=c(F(),1),O1e=c(fe(),1),A1e=c(U(),1);var P1e=c(U(),1);var J_=c(E(),1);function SZe({blockTypes:e,value:t,onItemChange:o}){return(0,J_.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(r=>(0,J_.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,J_.jsx)(P1e.CheckboxControl,{label:r.title,checked:t.includes(r.name),onChange:(...n)=>o(r,...n)}),(0,J_.jsx)(Et,{icon:r.icon})]},r.name))})}var I1e=SZe;var ex=c(E(),1);function L1e({title:e,blockTypes:t,selectedBlockTypes:o,onChange:r}){let n=(0,O1e.useInstanceId)(L1e),i=(0,J$.useCallback)((f,p)=>{r(p?[...o,f]:o.filter(({name:h})=>h!==f.name))},[o,r]),s=(0,J$.useCallback)(f=>{r(f?[...o,...t.filter(p=>!o.find(({name:h})=>h===p.name))]:o.filter(p=>!t.find(({name:h})=>h===p.name)))},[t,o,r]);if(!t.length)return null;let a=t.map(({name:f})=>f).filter(f=>(o??[]).some(p=>p.name===f)),l="block-editor-block-manager__category-title-"+n,u=a.length===t.length,d=!u&&a.length>0;return(0,ex.jsxs)("div",{role:"group","aria-labelledby":l,className:"block-editor-block-manager__category",children:[(0,ex.jsx)(A1e.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,ex.jsx)("span",{id:l,children:e})}),(0,ex.jsx)(I1e,{blockTypes:t,value:a,onItemChange:i})]})}var eK=L1e;var Pf=c(E(),1);function xV({blockTypes:e,selectedBlockTypes:t,onChange:o,showSelectAll:r=!0}){let n=(0,N1e.useDebounce)(D1e.speak,500),[i,s]=(0,_V.useState)(""),{categories:a,isMatchingSearchTerm:l}=(0,M1e.useSelect)(p=>({categories:p(tK.store).getCategories(),isMatchingSearchTerm:p(tK.store).isMatchingSearchTerm}),[]),u=e.filter(p=>!i||l(p,i)),d=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,_V.useEffect)(()=>{if(!i)return;let p=u.length,h=(0,Pc.sprintf)((0,Pc._n)("%d result found.","%d results found.",p),p);n(h)},[u?.length,i,n]),(0,Pf.jsxs)(tx.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Pf.jsx)(tx.SearchControl,{label:(0,Pc.__)("Search for a block"),placeholder:(0,Pc.__)("Search for a block"),value:i,onChange:p=>s(p),className:"block-editor-block-manager__search"}),r&&(0,Pf.jsx)(tx.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,Pc.__)("Select all"),checked:f,onChange:()=>{o(f?[]:e)},indeterminate:d}),(0,Pf.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,Pc.__)("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&(0,Pf.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,Pc.__)("No blocks found.")}),a.map(p=>(0,Pf.jsx)(eK,{title:p.title,blockTypes:u.filter(h=>h.category===p.slug),selectedBlockTypes:t,onChange:o},p.slug)),(0,Pf.jsx)(eK,{title:(0,Pc.__)("Uncategorized"),blockTypes:u.filter(({category:p})=>!p),selectedBlockTypes:t,onChange:o})]})]})}var Ic=c(E(),1);function z1e({clientId:e,blockTypes:t,selectedBlockTypes:o,onClose:r}){let[n,i]=(0,V1e.useState)(o),{updateBlockAttributes:s}=(0,F1e.useDispatch)(C),a=()=>{let l=n.length===t.length,u=n.map(({name:d})=>d);s(e,{allowedBlocks:l?void 0:u}),r()};return(0,Ic.jsx)(Ps.Modal,{title:(0,ox._x)("Manage allowed blocks","modal title"),onRequestClose:r,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,Ic.jsxs)(Ps.__experimentalVStack,{as:"form",onSubmit:l=>{l.preventDefault(),a()},spacing:"4",children:[(0,Ic.jsx)(Ps.__experimentalText,{children:(0,ox.__)("Select which blocks can be added inside this container.")}),(0,Ic.jsx)(xV,{blockTypes:t,selectedBlockTypes:n,onChange:l=>{i(l)}}),(0,Ic.jsxs)(Ps.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Ic.jsx)(Ps.FlexItem,{children:(0,Ic.jsx)(Ps.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,ox.__)("Cancel")})}),(0,Ic.jsx)(Ps.FlexItem,{children:(0,Ic.jsx)(Ps.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,ox.__)("Apply")})})]})]})})}var wy=c(E(),1);function U1e({clientId:e}){let[t,o]=(0,j1e.useState)(!1),{blockTypes:r,selectedBlockNames:n}=(0,H1e.useSelect)(a=>{let{getBlockAttributes:l}=a(C);return{blockTypes:a(CV.store).getBlockTypes(),selectedBlockNames:l(e)?.allowedBlocks}},[e]),i=r.filter(a=>(0,CV.hasBlockSupport)(a,"inserter",!0)&&(!a.parent||a.parent.includes("core/post-content")));if(!i)return null;let s=n===void 0?i:i.filter(a=>n.includes(a.name));return(0,wy.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,wy.jsxs)(S1.BaseControl,{help:(0,wV.__)("Specify which blocks are allowed inside this container."),children:[(0,wy.jsx)(S1.BaseControl.VisualLabel,{children:(0,wV.__)("Allowed Blocks")}),(0,wy.jsx)(S1.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,wV.__)("Manage allowed blocks")})]}),t&&(0,wy.jsx)(z1e,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>o(!1)})]})}var oK=c(E(),1);function kZe({clientId:e}){return Er()==="contentOnly"?null:(0,oK.jsx)(YC.Fill,{children:(0,oK.jsx)(U1e,{clientId:e})})}var G1e={edit:kZe,attributeKeys:["allowedBlocks"],hasSupport(e){return(0,rx.hasBlockSupport)(e,"allowedBlocks")}};function _Ze(e){return e?.attributes?.allowedBlocks?.type||(0,rx.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}(0,rK.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",_Ze);function xZe(e,t,o,r){if(!(0,rx.hasBlockSupport)(e.name,"allowedBlocks")||t.length!==1&&r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length||e.attributes.allowedBlocks)return e;let n=t[o]?.attributes?.allowedBlocks;if(!n)return e;let s=(0,rx.getBlockType)(e.name)?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:n}};let a=n.filter(l=>s.includes(l));return{...e,attributes:{...e.attributes,allowedBlocks:a}}}(0,rK.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",xZe);var W1e=c(go(),1),EV=c(U(),1),k1=c(G(),1),TV=c(ue(),1);var hh=c(E(),1),wZe=/[\s#]/g;function CZe(e){return"type"in(e.attributes?.anchor??{})||(0,TV.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e}function EZe({anchor:e,setAttributes:t}){return Er()!=="default"?null:(0,hh.jsx)(Oe,{group:"advanced",children:(0,hh.jsx)(EV.TextControl,{className:"html-anchor-control",label:(0,k1.__)("HTML anchor"),help:(0,hh.jsxs)(hh.Fragment,{children:[(0,k1.__)("Enter a word or two\u2014without spaces\u2014to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page.")," ",(0,hh.jsx)(EV.ExternalLink,{href:(0,k1.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,k1.__)("Learn more about anchors")})]}),value:e||"",placeholder:null,onChange:r=>{r=r.replace(wZe,"-"),t({anchor:r!==""?r:void 0})},autoCapitalize:"none",autoComplete:"off"})})}var nK={addSaveProps:TZe,edit:EZe,attributeKeys:["anchor"],hasSupport(e){return(0,TV.hasBlockSupport)(e,"anchor")}};function TZe(e,t,o){return(0,TV.hasBlockSupport)(t,"anchor")&&(e.id=o.anchor===""?null:o.anchor),e}(0,W1e.addFilter)("blocks.registerBlockType","core/anchor/attribute",CZe);var $1e=c(go(),1),RV=c(ue(),1);function RZe(e){return e?.attributes?.ariaLabel?.type||(0,RV.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}function BZe(e,t,o){return(0,RV.hasBlockSupport)(t,"ariaLabel")&&!$t(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=o.ariaLabel===""?null:o.ariaLabel),e}var K1e={addSaveProps:BZe,attributeKeys:["ariaLabel"],hasSupport(e){return(0,RV.hasBlockSupport)(e,"ariaLabel")}};(0,$1e.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",RZe);var bx=c(ue(),1),tPe=c(fe(),1),P5=c(U(),1),I5=c(Q(),1);var iK=c(G(),1);var er="isAny",tr="isNone",Si="isAll",ki="isNotAll",Zi="between",Xi="inThePast",Is="over",hr="is",gr="isNot",gh="lessThan",bh="greaterThan",yh="lessThanOrEqual",vh="greaterThanOrEqual",Sh="before",kh="after",_h="beforeInc",xh="afterInc",Hu="contains",Uu="notContains",Gu="startsWith",wh="on",Ch="notOn";var Fno={asc:(0,iK.__)("Sort ascending"),desc:(0,iK.__)("Sort descending")};var Y1e=c(Ix(),1),{lock:jno,unlock:so}=(0,Y1e.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews");var _1=c(F(),1),PZe=[];function Os({elements:e,getElements:t}){let o=Array.isArray(e)&&e.length>0?e:PZe,[r,n]=(0,_1.useState)(o),[i,s]=(0,_1.useState)(!1);return(0,_1.useEffect)(()=>{if(!t){n(o);return}let a=!1;return s(!0),t().then(l=>{if(!a){let u=Array.isArray(l)&&l.length>0?l:o;n(u)}}).catch(()=>{a||n(o)}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t,o]),{elements:r,isLoading:i}}var IZe=Math.pow(10,8)*24*60*60*1e3,Gno=-IZe,BV=6048e5,q1e=864e5;var OZe=3600;var Z1e=OZe*24,Wno=Z1e*7,AZe=Z1e*365.2425,LZe=AZe/12,$no=LZe*3,sK=Symbol.for("constructDateFrom");function yn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&sK in e?e[sK](t):e instanceof Date?new e.constructor(t):new Date(t)}function po(e,t){return yn(t||e,e)}function PV(e,t,o){let r=po(e,o?.in);return isNaN(t)?yn(o?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function IV(e,t,o){let r=po(e,o?.in);if(isNaN(t))return yn(o?.in||e,NaN);if(!t)return r;let n=r.getDate(),i=yn(o?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);let s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}var MZe={};function Eh(){return MZe}function If(e,t){let o=Eh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,n=po(e,t?.in),i=n.getDay(),s=(i=i.getTime()?r+1:o.getTime()>=a.getTime()?r:r-1}function aK(e){let t=po(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function X1e(e,...t){let o=yn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function lK(e,t){let o=po(e,t?.in);return o.setHours(0,0,0,0),o}function Q1e(e,t,o){let[r,n]=X1e(o?.in,e,t),i=lK(r),s=lK(n),a=+i-aK(i),l=+s-aK(s);return Math.round((a-l)/q1e)}function J1e(e,t){let o=OV(e,t),r=yn(t?.in||e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),Cy(r)}function eTe(e,t,o){return PV(e,t*7,o)}function tTe(e,t,o){return IV(e,t*12,o)}function oTe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Of(e){return!(!oTe(e)&&typeof e!="number"||isNaN(+po(e)))}function rTe(e,t){let o=po(e,t?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function AV(e,t){let o=po(e,t?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}var NZe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},nTe=(e,t,o)=>{let r,n=NZe[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function LV(e){return(t={})=>{let o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}var DZe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VZe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FZe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iTe={date:LV({formats:DZe,defaultWidth:"full"}),time:LV({formats:VZe,defaultWidth:"full"}),dateTime:LV({formats:FZe,defaultWidth:"full"})};var zZe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sTe=(e,t,o,r)=>zZe[e];function nx(e){return(t,o)=>{let r=o?.context?String(o.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let s=e.defaultFormattingWidth||e.defaultWidth,a=o?.width?String(o.width):s;n=e.formattingValues[a]||e.formattingValues[s]}else{let s=e.defaultWidth,a=o?.width?String(o.width):e.defaultWidth;n=e.values[a]||e.values[s]}let i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}var jZe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},HZe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UZe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},GZe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},WZe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$Ze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KZe=(e,t)=>{let o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},aTe={ordinalNumber:KZe,era:nx({values:jZe,defaultWidth:"wide"}),quarter:nx({values:HZe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:nx({values:UZe,defaultWidth:"wide"}),day:nx({values:GZe,defaultWidth:"wide"}),dayPeriod:nx({values:WZe,defaultWidth:"wide",formattingValues:$Ze,defaultFormattingWidth:"wide"})};function ix(e){return(t,o={})=>{let r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;let s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?qZe(a,f=>f.test(s)):YZe(a,f=>f.test(s)),u;u=e.valueCallback?e.valueCallback(l):l,u=o.valueCallback?o.valueCallback(u):u;let d=t.slice(s.length);return{value:u,rest:d}}}function YZe(e,t){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function qZe(e,t){for(let o=0;o{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=o.valueCallback?o.valueCallback(s):s;let a=t.slice(n.length);return{value:s,rest:a}}}var ZZe=/^(\d+)(th|st|nd|rd)?/i,XZe=/\d+/i,QZe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},JZe={any:[/^b/i,/^(a|c)/i]},eXe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tXe={any:[/1/i,/2/i,/3/i,/4/i]},oXe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rXe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nXe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},iXe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sXe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},aXe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cTe={ordinalNumber:lTe({matchPattern:ZZe,parsePattern:XZe,valueCallback:e=>parseInt(e,10)}),era:ix({matchPatterns:QZe,defaultMatchWidth:"wide",parsePatterns:JZe,defaultParseWidth:"any"}),quarter:ix({matchPatterns:eXe,defaultMatchWidth:"wide",parsePatterns:tXe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ix({matchPatterns:oXe,defaultMatchWidth:"wide",parsePatterns:rXe,defaultParseWidth:"any"}),day:ix({matchPatterns:nXe,defaultMatchWidth:"wide",parsePatterns:iXe,defaultParseWidth:"any"}),dayPeriod:ix({matchPatterns:sXe,defaultMatchWidth:"any",parsePatterns:aXe,defaultParseWidth:"any"})};var cK={code:"en-US",formatDistance:nTe,formatLong:iTe,formatRelative:sTe,localize:aTe,match:cTe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uTe(e,t){let o=po(e,t?.in);return Q1e(o,AV(o))+1}function dTe(e,t){let o=po(e,t?.in),r=+Cy(o)-+J1e(o);return Math.round(r/BV)+1}function MV(e,t){let o=po(e,t?.in),r=o.getFullYear(),n=Eh(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=yn(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);let a=If(s,t),l=yn(t?.in||e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);let u=If(l,t);return+o>=+a?r+1:+o>=+u?r:r-1}function fTe(e,t){let o=Eh(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=MV(e,t),i=yn(t?.in||e,0);return i.setFullYear(n,0,r),i.setHours(0,0,0,0),If(i,t)}function pTe(e,t){let o=po(e,t?.in),r=+If(o,t)-+fTe(o,t);return Math.round(r/BV)+1}function Xt(e,t){let o=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return o+r}var Af={y(e,t){let o=e.getFullYear(),r=o>0?o:1-o;return Xt(t==="yy"?r%100:r,t.length)},M(e,t){let o=e.getMonth();return t==="M"?String(o+1):Xt(o+1,2)},d(e,t){return Xt(e.getDate(),t.length)},a(e,t){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];default:return o==="am"?"a.m.":"p.m."}},h(e,t){return Xt(e.getHours()%12||12,t.length)},H(e,t){return Xt(e.getHours(),t.length)},m(e,t){return Xt(e.getMinutes(),t.length)},s(e,t){return Xt(e.getSeconds(),t.length)},S(e,t){let o=t.length,r=e.getMilliseconds(),n=Math.trunc(r*Math.pow(10,o-3));return Xt(n,t.length)}};var sx={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uK={G:function(e,t,o){let r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});default:return o.era(r,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){let r=e.getFullYear(),n=r>0?r:1-r;return o.ordinalNumber(n,{unit:"year"})}return Af.y(e,t)},Y:function(e,t,o,r){let n=MV(e,r),i=n>0?n:1-n;if(t==="YY"){let s=i%100;return Xt(s,2)}return t==="Yo"?o.ordinalNumber(i,{unit:"year"}):Xt(i,t.length)},R:function(e,t){let o=OV(e);return Xt(o,t.length)},u:function(e,t){let o=e.getFullYear();return Xt(o,t.length)},Q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Xt(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Xt(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,o){let r=e.getMonth();switch(t){case"M":case"MM":return Af.M(e,t);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,o){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Xt(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,o,r){let n=pTe(e,r);return t==="wo"?o.ordinalNumber(n,{unit:"week"}):Xt(n,t.length)},I:function(e,t,o){let r=dTe(e);return t==="Io"?o.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Af.d(e,t)},D:function(e,t,o){let r=uTe(e);return t==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Xt(r,t.length)},E:function(e,t,o){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xt(i,2);case"eo":return o.ordinalNumber(i,{unit:"day"});case"eee":return o.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"});default:return o.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xt(i,t.length);case"co":return o.ordinalNumber(i,{unit:"day"});case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"});default:return o.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,o){let r=e.getDay(),n=r===0?7:r;switch(t){case"i":return String(n);case"ii":return Xt(n,t.length);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,o){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,o){let r=e.getHours(),n;switch(r===12?n=sx.noon:r===0?n=sx.midnight:n=r/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,o){let r=e.getHours(),n;switch(r>=17?n=sx.evening:r>=12?n=sx.afternoon:r>=4?n=sx.morning:n=sx.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Af.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Af.H(e,t)},K:function(e,t,o){let r=e.getHours()%12;return t==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},k:function(e,t,o){let r=e.getHours();return r===0&&(r=24),t==="ko"?o.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Af.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Af.s(e,t)},S:function(e,t){return Af.S(e,t)},X:function(e,t,o){let r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return hTe(r);case"XXXX":case"XX":return Ey(r);default:return Ey(r,":")}},x:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"x":return hTe(r);case"xxxx":case"xx":return Ey(r);default:return Ey(r,":")}},O:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mTe(r,":");default:return"GMT"+Ey(r,":")}},z:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mTe(r,":");default:return"GMT"+Ey(r,":")}},t:function(e,t,o){let r=Math.trunc(+e/1e3);return Xt(r,t.length)},T:function(e,t,o){return Xt(+e,t.length)}};function mTe(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Math.trunc(r/60),i=r%60;return i===0?o+String(n):o+String(n)+t+Xt(i,2)}function hTe(e,t){return e%60===0?(e>0?"-":"+")+Xt(Math.abs(e)/60,2):Ey(e,t)}function Ey(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Xt(Math.trunc(r/60),2),i=Xt(r%60,2);return o+n+t+i}var gTe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},bTe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},lXe=(e,t)=>{let o=e.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return gTe(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",gTe(r,t)).replace("{{time}}",bTe(n,t))},yTe={p:bTe,P:lXe};var cXe=/^D+$/,uXe=/^Y+$/,dXe=["D","DD","YY","YYYY"];function vTe(e){return cXe.test(e)}function STe(e){return uXe.test(e)}function kTe(e,t,o){let r=fXe(e,t,o);if(console.warn(r),dXe.includes(e))throw new RangeError(r)}function fXe(e,t,o){let r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var pXe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mXe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hXe=/^'([^]*?)'?$/,gXe=/''/g,bXe=/[a-zA-Z]/;function dK(e,t,o){let r=Eh(),n=o?.locale??r.locale??cK,i=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=po(e,o?.in);if(!Of(a))throw new RangeError("Invalid time value");let l=t.match(mXe).map(d=>{let f=d[0];if(f==="p"||f==="P"){let p=yTe[f];return p(d,n.formatLong)}return d}).join("").match(pXe).map(d=>{if(d==="''")return{isToken:!1,value:"'"};let f=d[0];if(f==="'")return{isToken:!1,value:yXe(d)};if(uK[f])return{isToken:!0,value:d};if(f.match(bXe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));let u={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return l.map(d=>{if(!d.isToken)return d.value;let f=d.value;(!o?.useAdditionalWeekYearTokens&&STe(f)||!o?.useAdditionalDayOfYearTokens&&vTe(f))&&kTe(f,t,String(e));let p=uK[f[0]];return p(a,f,n.localize,u)}).join("")}function yXe(e){let t=e.match(hXe);return t?t[1].replace(gXe,"'"):e}function Ty(e,t,o){return PV(e,-t,o)}function NV(e,t,o){return IV(e,-t,o)}function _Te(e,t,o){return eTe(e,-t,o)}function DV(e,t,o){return tTe(e,-t,o)}var He=c(G(),1),Tr=c(F(),1),Qi=c(Tu(),1);var fK=c(E(),1),Zr={Name:(0,fK.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,fK.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};function xTe(e,t){switch(t){case"days":return Ty(new Date,e);case"weeks":return _Te(new Date,e);case"months":return NV(new Date,e);case"years":return DV(new Date,e);default:return new Date}}var wTe={label:(0,He.__)("Is none of"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is none of: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter:((e,t,o)=>{if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?!o.some(n=>r.includes(n)):typeof r=="string"?!o.includes(r):!1}),selection:"multi"},CTe=[{name:er,label:(0,He.__)("Includes"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s includes: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter(e,t,o){if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?o.some(n=>r.includes(n)):typeof r=="string"?o.includes(r):!1},selection:"multi"},{name:tr,...wTe},{name:Si,label:(0,He.__)("Includes all"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s includes all: %2$s"),e.name,t.map(o=>o.label).join(", ")),Zr),filter(e,t,o){return o?.length?o.every(r=>t.getValue({item:e})?.includes(r)):!0},selection:"multi"},{name:ki,...wTe},{name:Zi,label:(0,He.__)("Between (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s between (inc): %2$s and %3$s"),e.name,t[0].label[0],t[0].label[1]),Zr),filter(e,t,o){if(!Array.isArray(o)||o.length!==2||o[0]===void 0||o[1]===void 0)return!0;let r=t.getValue({item:e});return typeof r=="number"||r instanceof Date||typeof r=="string"?r>=o[0]&&r<=o[1]:!1},selection:"custom"},{name:Xi,label:(0,He.__)("In the past"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is in the past: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),Zr),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=xTe(o.value,o.unit),n=(0,Qi.getDate)(t.getValue({item:e}));return n>=r&&n<=new Date},selection:"custom"},{name:Is,label:(0,He.__)("Over"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is over: %2$s"),e.name,`${t[0].value.value} ${t[0].value.unit}`),Zr),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=xTe(o.value,o.unit);return(0,Qi.getDate)(t.getValue({item:e}))(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===t.getValue({item:e})||o===void 0},selection:"single"},{name:gr,label:(0,He.__)("Is not"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is not: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o!==t.getValue({item:e})},selection:"single"},{name:gh,label:(0,He.__)("Less than"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is less than: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is greater than: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>o},selection:"single"},{name:yh,label:(0,He.__)("Less than or equal"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is less than or equal to: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<=o},selection:"single"},{name:vh,label:(0,He.__)("Greater than or equal"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is greater than or equal to: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>=o},selection:"single"},{name:Sh,label:(0,He.__)("Before"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is before: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is after: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))>r},selection:"single"},{name:_h,label:(0,He.__)("Before (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is on or before: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))<=r},selection:"single"},{name:xh,label:(0,He.__)("After (inc)"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is on or after: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o);return(0,Qi.getDate)(t.getValue({item:e}))>=r},selection:"single"},{name:Hu,label:(0,He.__)("Contains"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s contains: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:Uu,label:(0,He.__)("Doesn't contain"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s doesn't contain: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&!r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:Gu,label:(0,He.__)("Starts with"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s starts with: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().startsWith(String(o).toLowerCase())},selection:"single"},{name:wh,label:(0,He.__)("On"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o),n=(0,Qi.getDate)(t.getValue({item:e}));return r.getTime()===n.getTime()},selection:"single"},{name:Ch,label:(0,He.__)("Not on"),filterText:(e,t)=>(0,Tr.createInterpolateElement)((0,He.sprintf)((0,He.__)("%1$s is not: %2$s"),e.name,t[0].label),Zr),filter(e,t,o){if(o===void 0)return!0;let r=(0,Qi.getDate)(o),n=(0,Qi.getDate)(t.getValue({item:e}));return r.getTime()!==n.getTime()},selection:"single"}],ETe=e=>CTe.find(t=>t.name===e),TTe=()=>CTe.map(e=>e.name);var RTe=c(U(),1),BTe=c(F(),1);function ao(e,t){let o;return e?.required&&t?.required?o=t?.required?.message?t.required:void 0:e?.pattern&&t?.pattern?o=t.pattern:e?.min&&t?.min?o=t.min:e?.max&&t?.max?o=t.max:e?.minLength&&t?.minLength?o=t.minLength:e?.maxLength&&t?.maxLength?o=t.maxLength:e?.elements&&t?.elements?o=t.elements:t?.custom&&(o=t.custom),o}var PTe=c(E(),1),{ValidatedCheckboxControl:vXe}=so(RTe.privateApis);function ITe({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,label:l,description:u,isValid:d}=e,f=e.isDisabled({item:o,field:e}),p=(0,BTe.useCallback)(()=>{t(a({item:o,value:!s({item:o})}))},[o,s,t,a]);return(0,PTe.jsx)(vXe,{required:!!e.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),hidden:r,label:l,help:u,checked:s({item:o}),onChange:p,disabled:f})}var VV=c(U(),1),OTe=c(F(),1);var pK=c(E(),1),{ValidatedComboboxControl:SXe}=so(VV.privateApis);function FV({data:e,field:t,onChange:o,hideLabelFromVision:r,validity:n}){let{label:i,description:s,placeholder:a,getValue:l,setValue:u,isValid:d}=t,f=l({item:e})??"",p=(0,OTe.useCallback)(g=>o(u({item:e,value:g??""})),[e,o,u]),{elements:h,isLoading:m}=Os({elements:t.elements,getElements:t.getElements});return m?(0,pK.jsx)(VV.Spinner,{}):(0,pK.jsx)(SXe,{required:!!t.isValid?.required,customValidity:ao(d,n),label:i,value:f,help:s,placeholder:a,options:h,onChange:p,hideLabelFromVision:r,allowReset:!0,expandOnFocus:!0})}var HV=c(U(),1),Rl=c(F(),1),jV=c(G(),1),ma=c(Tu(),1);var lx=c(U(),1),mK=c(F(),1),Wu=c(G(),1);var ax=c(E(),1),kXe={[Xi]:[{value:"days",label:(0,Wu.__)("Days")},{value:"weeks",label:(0,Wu.__)("Weeks")},{value:"months",label:(0,Wu.__)("Months")},{value:"years",label:(0,Wu.__)("Years")}],[Is]:[{value:"days",label:(0,Wu.__)("Days ago")},{value:"weeks",label:(0,Wu.__)("Weeks ago")},{value:"months",label:(0,Wu.__)("Months ago")},{value:"years",label:(0,Wu.__)("Years ago")}]};function zV({className:e,data:t,field:o,onChange:r,hideLabelFromVision:n,operator:i}){let s=kXe[i===Xi?"inThePast":"over"],{id:a,label:l,description:u,getValue:d,setValue:f}=o,p=o.isDisabled({item:t,field:o}),h=d({item:t}),{value:m="",unit:g=s[0].value}=h&&typeof h=="object"?h:{},b=(0,mK.useCallback)(y=>r(f({item:t,value:{value:Number(y),unit:g}})),[r,f,t,g]),v=(0,mK.useCallback)(y=>r(f({item:t,value:{value:m,unit:y}})),[r,f,t,m]);return(0,ax.jsx)(lx.BaseControl,{id:a,className:K(e,"dataviews-controls__relative-date"),label:l,hideLabelFromVision:n,help:u,children:(0,ax.jsxs)(Qe,{direction:"row",gap:"sm",children:[(0,ax.jsx)(lx.__experimentalNumberControl,{className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:m,onChange:b,disabled:p}),(0,ax.jsx)(lx.SelectControl,{className:"dataviews-controls__relative-date-unit",label:(0,Wu.__)("Unit"),value:g,options:s,onChange:v,hideLabelFromVision:!0,disabled:p})]})})}var ATe=c(F(),1);function x1(e,t){let o=typeof e.min?.constraint=="string"?e.min.constraint:void 0,r=typeof e.max?.constraint=="string"?e.max.constraint:void 0,n=(0,ATe.useMemo)(()=>{let i=[];if(o){let s=t(o);s&&i.push({before:s})}if(r){let s=t(r);s&&i.push({after:s})}return i.length>0?i:void 0},[o,r,t]);return{minConstraint:o,maxConstraint:r,disabledMatchers:n}}var LTe=c(Tu(),1);function w1(e){if(!e)return null;let t=(0,LTe.getDate)(e);return t&&Of(t)?t:null}var Th=c(E(),1),{DateCalendar:_Xe,ValidatedInputControl:xXe}=so(HV.privateApis),hK=e=>e?(0,ma.dateI18n)("Y-m-d\\TH:i",(0,ma.getDate)(e)):"";function wXe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,config:s}){let{compact:a}=s||{},{id:l,label:u,description:d,setValue:f,getValue:p,isValid:h}=t,m=t.isDisabled({item:e,field:t}),g=p({item:e}),b=typeof g=="string"?g:void 0,[v,y]=(0,Rl.useState)(()=>w1(b)||new Date),k=(0,Rl.useRef)(null),S=(0,Rl.useRef)(void 0),_=(0,Rl.useRef)(null),{minConstraint:x,maxConstraint:w,disabledMatchers:T}=x1(h,w1),B=(0,Rl.useCallback)(z=>o(f({item:e,value:z})),[e,o,f]);(0,Rl.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let R=(0,Rl.useCallback)(z=>{let V;if(z){let M=(0,ma.dateI18n)("Y-m-d",z),D;b?D=(0,ma.dateI18n)("H:i",(0,ma.getDate)(b)):D=(0,ma.dateI18n)("H:i",z),V=(0,ma.getDate)(`${M}T${D}`).toISOString(),B(V),S.current&&clearTimeout(S.current)}else B(void 0);_.current=k.current&&k.current.ownerDocument.activeElement,S.current=setTimeout(()=>{k.current&&(k.current.focus(),k.current.blur(),B(V),_.current&&_.current instanceof HTMLElement&&_.current.focus())},0)},[B,b]),I=(0,Rl.useCallback)(z=>{if(z){let V=(0,ma.getDate)(z);B(V.toISOString());let M=w1(V.toISOString());M&&y(M)}else B(void 0)},[B]),{format:A}=t,P=A.weekStartsOn??(0,ma.getSettings)().l10n.startOfWeek,{timezone:{string:O}}=(0,ma.getSettings)(),N=u;return h?.required&&!n&&!r?N=`${u} (${(0,jV.__)("Required")})`:!h?.required&&n&&!r&&(N=`${u} (${(0,jV.__)("Optional")})`),(0,Th.jsx)(HV.BaseControl,{id:l,label:N,help:d,hideLabelFromVision:r,children:(0,Th.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Th.jsx)(xXe,{ref:k,required:!!h?.required,customValidity:ao(h,i),type:"datetime-local",label:(0,jV.__)("Date time"),hideLabelFromVision:!0,value:hK(b),onChange:I,disabled:m,min:x?hK(x):void 0,max:w?hK(w):void 0}),!a&&(0,Th.jsx)(_Xe,{style:{width:"100%"},selected:b&&w1(b)||void 0,onSelect:R,month:v,onMonthChange:y,timeZone:O||void 0,weekStartsOn:P,disabled:m||T})]})})}function MTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s,config:a}){return i===Xi||i===Is?(0,Th.jsx)(zV,{className:"dataviews-controls__datetime",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):(0,Th.jsx)(wXe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,config:a})}var xi=c(U(),1),NTe=c(Qr(),1),ro=c(F(),1),vn=c(G(),1),_i=c(Tu(),1);var Io=c(E(),1),{DateCalendar:CXe,DateRangeCalendar:EXe}=so(xi.privateApis),TXe=[{id:"today",label:(0,vn.__)("Today"),getValue:()=>(0,_i.getDate)(null)},{id:"yesterday",label:(0,vn.__)("Yesterday"),getValue:()=>{let e=(0,_i.getDate)(null);return Ty(e,1)}},{id:"past-week",label:(0,vn.__)("Past week"),getValue:()=>{let e=(0,_i.getDate)(null);return Ty(e,7)}},{id:"past-month",label:(0,vn.__)("Past month"),getValue:()=>{let e=(0,_i.getDate)(null);return NV(e,1)}}],RXe=[{id:"last-7-days",label:(0,vn.__)("Last 7 days"),getValue:()=>{let e=(0,_i.getDate)(null);return[Ty(e,7),e]}},{id:"last-30-days",label:(0,vn.__)("Last 30 days"),getValue:()=>{let e=(0,_i.getDate)(null);return[Ty(e,30),e]}},{id:"month-to-date",label:(0,vn.__)("Month to date"),getValue:()=>{let e=(0,_i.getDate)(null);return[rTe(e),e]}},{id:"last-year",label:(0,vn.__)("Last year"),getValue:()=>{let e=(0,_i.getDate)(null);return[DV(e,1),e]}},{id:"year-to-date",label:(0,vn.__)("Year to date"),getValue:()=>{let e=(0,_i.getDate)(null);return[AV(e),e]}}],Rh=e=>{if(!e)return null;let t=(0,_i.getDate)(e);return t&&Of(t)?t:null},gK=e=>e?typeof e=="string"?e:dK(e,"yyyy-MM-dd"):"";function DTe({field:e,validity:t,inputRefs:o,isTouched:r,setIsTouched:n,children:i}){let{isValid:s}=e,[a,l]=(0,ro.useState)(void 0),u=(0,ro.useCallback)(()=>{let f=Array.isArray(o)?o:[o];for(let p of f){let h=p.current;if(h&&!h.validity.valid){l({type:"invalid",message:h.validationMessage});return}}l(void 0)},[o]);return(0,ro.useEffect)(()=>{let f=Array.isArray(o)?o:[o],p=t?ao(s,t):void 0;for(let h of f){let m=h.current;m&&m.setCustomValidity(p?.type==="invalid"&&p.message?p.message:"")}},[o,s,t]),(0,ro.useEffect)(()=>{let f=Array.isArray(o)?o:[o],p=h=>{h.preventDefault(),n(!0)};for(let h of f)h.current?.addEventListener("invalid",p);return()=>{for(let h of f)h.current?.removeEventListener("invalid",p)}},[o,n]),(0,ro.useEffect)(()=>{if(!r)return;let f=t?ao(s,t):void 0;f?l(f):u()},[r,s,t,u]),(0,ro.useEffect)(()=>{r&&a?.message&&(0,NTe.speak)(a.message)},[r,a?.message]),(0,Io.jsxs)("div",{onBlur:f=>{r||(!f.relatedTarget||!f.currentTarget.contains(f.relatedTarget))&&n(!0)},children:[i,a&&(0,Io.jsxs)("p",{className:K("components-validated-control__indicator",a.type==="invalid"?"is-invalid":void 0),children:[(0,Io.jsx)(xi.Icon,{className:"components-validated-control__indicator-icon",icon:ag,size:16,fill:"currentColor"}),a.message]})]})}function BXe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:l,setValue:u,getValue:d,isValid:f,format:p}=t,h=t.isDisabled({item:e,field:t}),[m,g]=(0,ro.useState)(null),b=p.weekStartsOn??(0,_i.getSettings)().l10n.startOfWeek,v=d({item:e}),y=typeof v=="string"?v:void 0,[k,S]=(0,ro.useState)(()=>Rh(y)||new Date),[_,x]=(0,ro.useState)(!1),w=(0,ro.useRef)(null),{minConstraint:T,maxConstraint:B,disabledMatchers:R}=x1(f,Rh),I=(0,ro.useCallback)(V=>o(u({item:e,value:V})),[e,o,u]),A=(0,ro.useCallback)(V=>{let M=V?dK(V,"yyyy-MM-dd"):void 0;I(M),g(null),x(!0)},[I]),P=(0,ro.useCallback)(V=>{let M=V.getValue(),D=gK(M);S(M),I(D),g(V.id),x(!0)},[I]),O=(0,ro.useCallback)(V=>{if(I(V),V){let M=Rh(V);M&&S(M)}g(null),x(!0)},[I]),{timezone:{string:N}}=(0,_i.getSettings)(),z=a;return f?.required&&!n?z=`${a} (${(0,vn.__)("Required")})`:!f?.required&&n&&(z=`${a} (${(0,vn.__)("Optional")})`),(0,Io.jsx)(DTe,{field:t,validity:i,inputRefs:w,isTouched:_,setIsTouched:x,children:(0,Io.jsx)(xi.BaseControl,{id:s,className:"dataviews-controls__date",label:z,help:l,hideLabelFromVision:r,children:(0,Io.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[TXe.map(V=>{let M=m===V.id;return(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:M,size:"small",disabled:h,accessibleWhenDisabled:!0,onClick:()=>P(V),children:V.label},V.id)}),(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!m,size:"small",disabled:!!m||h,accessibleWhenDisabled:!0,children:(0,vn.__)("Custom")})]}),(0,Io.jsx)(xi.__experimentalInputControl,{ref:w,type:"date",label:(0,vn.__)("Date"),hideLabelFromVision:!0,value:y,onChange:O,required:!!t.isValid?.required,disabled:h,min:T,max:B}),(0,Io.jsx)(CXe,{style:{width:"100%"},selected:y&&Rh(y)||void 0,onSelect:A,month:k,onMonthChange:S,timeZone:N||void 0,weekStartsOn:b,disabled:h||R,disableNavigation:h})]})})})}function PXe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:l,getValue:u,setValue:d,isValid:f,format:p}=t,h=t.isDisabled({item:e,field:t}),m,g=u({item:e});Array.isArray(g)&&g.length===2&&g.every(L=>typeof L=="string")&&(m=g);let b=p.weekStartsOn??(0,_i.getSettings)().l10n.startOfWeek,{minConstraint:v,maxConstraint:y,disabledMatchers:k}=x1(f,Rh),S=(0,ro.useCallback)(L=>{o(d({item:e,value:L}))},[e,o,d]),[_,x]=(0,ro.useState)(null),w=(0,ro.useMemo)(()=>{if(!m)return{from:void 0,to:void 0};let[L,j]=m;return{from:Rh(L)||void 0,to:Rh(j)||void 0}},[m]),[T,B]=(0,ro.useState)(()=>w.from||new Date),[R,I]=(0,ro.useState)(!1),A=(0,ro.useRef)(null),P=(0,ro.useRef)(null),O=(0,ro.useCallback)((L,j)=>{L&&j?S([gK(L),gK(j)]):!L&&!j&&S(void 0)},[S]),N=(0,ro.useCallback)(L=>{O(L?.from,L?.to),x(null),I(!0)},[O]),z=(0,ro.useCallback)(L=>{let[j,q]=L.getValue();B(j),O(j,q),x(L.id),I(!0)},[O]),V=(0,ro.useCallback)((L,j)=>{let[q,J]=m||[void 0,void 0];if(O(L==="from"?j:q,L==="to"?j:J),j){let $=Rh(j);$&&B($)}x(null),I(!0)},[m,O]),{timezone:M}=(0,_i.getSettings)(),D=a;return t.isValid?.required&&!n?D=`${a} (${(0,vn.__)("Required")})`:!t.isValid?.required&&n&&(D=`${a} (${(0,vn.__)("Optional")})`),(0,Io.jsx)(DTe,{field:t,validity:i,inputRefs:[A,P],isTouched:R,setIsTouched:I,children:(0,Io.jsx)(xi.BaseControl,{id:s,className:"dataviews-controls__date",label:D,help:l,hideLabelFromVision:r,children:(0,Io.jsxs)(Qe,{direction:"column",gap:"lg",children:[(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[RXe.map(L=>{let j=_===L.id;return(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:j,size:"small",disabled:h,accessibleWhenDisabled:!0,onClick:()=>z(L),children:L.label},L.id)}),(0,Io.jsx)(xi.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!_,size:"small",accessibleWhenDisabled:!0,disabled:!!_||h,children:(0,vn.__)("Custom")})]}),(0,Io.jsxs)(Qe,{direction:"row",gap:"sm",justify:"space-between",className:"dataviews-controls__date-range-inputs",children:[(0,Io.jsx)(xi.__experimentalInputControl,{ref:A,type:"date",label:(0,vn.__)("From"),hideLabelFromVision:!0,value:m?.[0],onChange:L=>V("from",L),required:!!t.isValid?.required,disabled:h,min:v,max:y}),(0,Io.jsx)(xi.__experimentalInputControl,{ref:P,type:"date",label:(0,vn.__)("To"),hideLabelFromVision:!0,value:m?.[1],onChange:L=>V("to",L),required:!!t.isValid?.required,disabled:h,min:v,max:y})]}),(0,Io.jsx)(EXe,{style:{width:"100%"},selected:w,onSelect:N,month:T,onMonthChange:B,timeZone:M.string||void 0,weekStartsOn:b,disabled:h||k})]})})})}function VTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===Xi||i===Is?(0,Io.jsx)(zV,{className:"dataviews-controls__date",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):i===Zi?(0,Io.jsx)(PXe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s}):(0,Io.jsx)(BXe,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var UV=c(U(),1),FTe=c(F(),1);var bK=c(E(),1),{ValidatedSelectControl:IXe}=so(UV.privateApis);function GV({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{type:s,label:a,description:l,getValue:u,setValue:d,isValid:f}=t,p=t.isDisabled({item:e,field:t}),h=s==="array",m=u({item:e})??(h?[]:""),g=(0,FTe.useCallback)(y=>o(d({item:e,value:y})),[e,o,d]),{elements:b,isLoading:v}=Os({elements:t.elements,getElements:t.getElements});return v?(0,bK.jsx)(UV.Spinner,{}):(0,bK.jsx)(IXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(f,i),label:a,value:m,help:l,options:b,onChange:g,hideLabelFromVision:r,multiple:h,disabled:p})}var yK=c(E(),1),OXe=10;function zTe(e){let{field:t}=e,{elements:o}=Os({elements:t.elements,getElements:t.getElements});return o.length>=OXe?(0,yK.jsx)(FV,{...e}):(0,yK.jsx)(GV,{...e})}var $V=c(U(),1);var jTe=c(U(),1),HTe=c(F(),1);var UTe=c(E(),1),{ValidatedInputControl:AXe}=so(jTe.privateApis);function $u({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,type:i,prefix:s,suffix:a,validity:l}){let{label:u,placeholder:d,description:f,getValue:p,setValue:h,isValid:m}=t,g=p({item:e}),b=t.isDisabled({item:e,field:t}),v=(0,HTe.useCallback)(y=>o(h({item:e,value:y})),[e,h,o]);return(0,UTe.jsx)(AXe,{required:!!m.required,markWhenOptional:n,customValidity:ao(m,l),label:u,placeholder:d,value:g??"",help:f,onChange:v,hideLabelFromVision:r,type:i,prefix:s,suffix:a,disabled:b,pattern:m.pattern?m.pattern.constraint:void 0,minLength:m.minLength?m.minLength.constraint:void 0,maxLength:m.maxLength?m.maxLength.constraint:void 0})}var WV=c(E(),1);function GTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,WV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"email",prefix:(0,WV.jsx)($V.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,WV.jsx)($V.Icon,{icon:k3})})})}var YV=c(U(),1);var KV=c(E(),1);function WTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,KV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"tel",prefix:(0,KV.jsx)(YV.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,KV.jsx)(YV.Icon,{icon:tw})})})}var ZV=c(U(),1);var qV=c(E(),1);function $Te({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,qV.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"url",prefix:(0,qV.jsx)(ZV.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,qV.jsx)(ZV.Icon,{icon:ss})})})}var Lf=c(U(),1),C1=c(F(),1),XV=c(G(),1);var Bh=c(E(),1),{ValidatedNumberControl:LXe}=so(Lf.privateApis);function KTe(e){if(e===""||e===void 0)return"";let t=Number(e);return Number.isFinite(t)?t:""}function MXe({value:e,onChange:t,hideLabelFromVision:o,step:r}){let[n="",i=""]=e,s=(0,C1.useCallback)(l=>t([KTe(l),i]),[t,i]),a=(0,C1.useCallback)(l=>t([n,KTe(l)]),[t,n]);return(0,Bh.jsx)(Lf.BaseControl,{help:(0,XV.__)("The max. value must be greater than the min. value."),children:(0,Bh.jsxs)(Lf.Flex,{direction:"row",gap:4,children:[(0,Bh.jsx)(Lf.__experimentalNumberControl,{label:(0,XV.__)("Min."),value:n,max:i?Number(i)-r:void 0,onChange:s,hideLabelFromVision:o,step:r}),(0,Bh.jsx)(Lf.__experimentalNumberControl,{label:(0,XV.__)("Max."),value:i,min:n?Number(n)+r:void 0,onChange:a,hideLabelFromVision:o,step:r})]})})}function QV({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){let a=t.format?.decimals??0,l=Math.pow(10,Math.abs(a)*-1),{label:u,description:d,getValue:f,setValue:p,isValid:h}=t,m=f({item:e})??"",g=t.isDisabled({item:e,field:t}),b=(0,C1.useCallback)(y=>{o(p({item:e,value:["",void 0].includes(y)?void 0:Number(y)}))},[e,o,p]),v=(0,C1.useCallback)(y=>{o(p({item:e,value:y}))},[e,o,p]);if(i===Zi){let y=["",""];return Array.isArray(m)&&m.length===2&&m.every(k=>typeof k=="number"||k==="")&&(y=m),(0,Bh.jsx)(MXe,{value:y,onChange:v,hideLabelFromVision:r,step:l})}return(0,Bh.jsx)(LXe,{required:!!h.required,markWhenOptional:n,customValidity:ao(h,s),label:u,help:d,value:m,onChange:b,hideLabelFromVision:r,step:l,min:h.min?h.min.constraint:void 0,max:h.max?h.max.constraint:void 0,disabled:g})}var YTe=c(E(),1);function qTe(e){return(0,YTe.jsx)(QV,{...e})}var ZTe=c(E(),1);function XTe(e){return(0,ZTe.jsx)(QV,{...e})}var JV=c(U(),1),QTe=c(F(),1);var vK=c(E(),1),{ValidatedRadioControl:NXe}=so(JV.privateApis);function JTe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:l,setValue:u,isValid:d}=t,f=t.isDisabled({item:e,field:t}),{elements:p,isLoading:h}=Os({elements:t.elements,getElements:t.getElements}),m=l({item:e}),g=(0,QTe.useCallback)(b=>o(u({item:e,value:b})),[e,o,u]);return h?(0,vK.jsx)(JV.Spinner,{}):(0,vK.jsx)(NXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),label:s,help:a,onChange:g,options:p,selected:m,hideLabelFromVision:r,disabled:f})}var SK=c(F(),1);var eRe=c(E(),1);function tRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{prefix:a,suffix:l}=i||{};return(0,eRe.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,prefix:a?(0,SK.createElement)(a):void 0,suffix:l?(0,SK.createElement)(l):void 0})}var oRe=c(U(),1),rRe=c(F(),1);var nRe=c(E(),1),{ValidatedToggleControl:DXe}=so(oRe.privateApis);function iRe({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:l,setValue:u,isValid:d}=e,f=e.isDisabled({item:o,field:e}),p=(0,rRe.useCallback)(()=>{t(u({item:o,value:!l({item:o})}))},[t,u,o,l]);return(0,nRe.jsx)(DXe,{required:!!d.required,markWhenOptional:n,customValidity:ao(d,i),hidden:r,label:s,help:a,checked:l({item:o}),onChange:p,disabled:f})}var sRe=c(U(),1),aRe=c(F(),1);var lRe=c(E(),1),{ValidatedTextareaControl:VXe}=so(sRe.privateApis);function cRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{rows:a=4}=i||{},l=t.isDisabled({item:e,field:t}),{label:u,placeholder:d,description:f,setValue:p,isValid:h}=t,m=t.getValue({item:e}),g=(0,aRe.useCallback)(b=>o(p({item:e,value:b})),[e,o,p]);return(0,lRe.jsx)(VXe,{required:!!h.required,markWhenOptional:n,customValidity:ao(h,s),label:u,placeholder:d,value:m??"",help:f,onChange:g,rows:a,disabled:l,minLength:h.minLength?h.minLength.constraint:void 0,maxLength:h.maxLength?h.maxLength.constraint:void 0,__next40pxDefaultSize:!0,hideLabelFromVision:r})}var hRe=c(F(),1);var cx=c(U(),1),Ih=c(fe(),1),ha=c(F(),1),t5=c(Ko(),1);var FXe=[];function uRe({allowedFormats:e,disableFormats:t}){return t?FXe:e}var e5=c(Ko(),1),dRe=c(E(),1),fRe=c(ce(),1),zXe={};function jXe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a}=n;if(!a)return null;let l=(0,e5.getActiveFormat)(o,s),u=l!==void 0,d=(0,e5.getActiveObject)(o),f=d!==void 0&&d.type===s;return(0,dRe.jsx)(a,{isActive:u,isVisible:i,activeAttributes:u?l.attributes||{}:{},isObjectActive:f,activeObjectAttributes:f?d.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:zXe},s)}function pRe({formatTypes:e,...t}){return e.map(o=>(0,fRe.createElement)(jXe,{settings:o,...t,key:o.name}))}var Ph=c(E(),1),{ValidatedContentEditableControl:HXe,withIgnoreIMEEvents:UXe}=so(cx.privateApis),{useRichText:GXe,KeyboardShortcutContext:WXe,InputEventContext:$Xe,shortcutsListener:KXe,inputEventsListener:YXe}=so(t5.privateApis),qXe=[];function mRe({label:e,value:t,onChange:o,placeholder:r,id:n,clientId:i,className:s,hideLabelFromVision:a,help:l,disabled:u,required:d,markWhenOptional:f,customValidity:p,allowedFormats:h,disableFormats:m,withoutInteractiveFormatting:g,preserveWhiteSpace:b,disableLineBreaks:v,focusOnMount:y,completers:k=qXe}){let[S,_]=(0,ha.useState)({start:void 0,end:void 0}),[x,w]=(0,ha.useState)(!1),T=(0,ha.useRef)(void 0),B=(0,ha.useRef)(new Set),R=(0,ha.useRef)(new Set),I=(0,Ih.__experimentalUseFocusOutside)(()=>w(!1)),A=uRe({allowedFormats:h,disableFormats:m}),{value:P,onChange:O,ref:N,formatTypes:z,getValue:V}=GXe({value:t,onChange:o,selectionStart:S.start,selectionEnd:S.end,onSelectionChange:(W,Y)=>_({start:W,end:Y}),__unstableIsSelected:x,preserveWhiteSpace:!!b,placeholder:r,__unstableDisableFormats:m,allowedFormats:A,withoutInteractiveFormatting:g,__unstableFormatTypeHandlerContext:(0,ha.useMemo)(()=>({richTextIdentifier:n,blockClientId:i}),[n,i])});function M(){T.current?.focus()}let D=(0,ha.useRef)({keyboardShortcuts:R,inputEvents:B}),L=(0,ha.useRef)({formatTypes:z,getValue:V,onChange:O});(0,ha.useInsertionEffect)(()=>{L.current={formatTypes:z,getValue:V,onChange:O}});let j=(0,Ih.useRefEffect)(W=>{if(u)return;let Y=UXe(Z=>{if(Z.key!=="Enter"||Z.defaultPrevented||Z.metaKey||Z.ctrlKey||(Z.preventDefault(),v))return;let{getValue:oe,onChange:ne}=L.current,X=oe();ne((0,t5.insert)(X,` `,X.start??X.text.length,X.end??X.text.length))});return W.addEventListener("keydown",Y),()=>W.removeEventListener("keydown",Y)},[v,u]),q=(0,Ih.useRefEffect)(W=>{if(!x)return;let Y=KXe(D)(W),Z=YXe(D)(W);function oe(ne){if(ne.inputType!=="insertText"&&ne.type!=="compositionend")return;let{formatTypes:X,getValue:re,onChange:ae}=L.current,ve=re(),xe=X.reduce((ge,{__unstableInputRule:be})=>be?be(ge):ge,ve);xe!==ve&&ae({...xe,activeFormats:ve.activeFormats})}return W.addEventListener("input",oe),W.addEventListener("compositionend",oe),()=>{Y(),Z(),W.removeEventListener("input",oe),W.removeEventListener("compositionend",oe)}},[x]),{ref:J,...te}=(0,cx.__unstableUseAutocompleteProps)({completers:k,record:P,onChange:O,onReplace:()=>{}}),ee=(0,Ih.useRefEffect)(W=>{y&&!u&&W.focus()},[y,u]),$=(0,Ih.useMergeRefs)([N,T,q,j,ee,J]);return(0,Ph.jsx)("div",{...I,onFocus:W=>{w(!0),I.onFocus(W)},children:(0,Ph.jsxs)(cx.SlotFillProvider,{children:[(0,Ph.jsx)(HXe,{label:e,id:n,className:K("dataviews-controls__richtext",s),placeholder:r,hideLabelFromVision:a,help:l,disabled:u,required:d,markWhenOptional:f,customValidity:p,value:P.text,"aria-multiline":!v,...te,ref:$}),x&&!u&&(0,Ph.jsx)(WXe.Provider,{value:R,children:(0,Ph.jsx)($Xe.Provider,{value:B,children:(0,Ph.jsx)(pRe,{value:P,onChange:O,onFocus:M,formatTypes:z,forwardedRef:T,isVisible:!0})})})]})})}var gRe=c(E(),1);function bRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{className:a,clientId:l,allowedFormats:u,disableFormats:d,withoutInteractiveFormatting:f,preserveWhiteSpace:p,disableLineBreaks:h}=i||{},m=t.isDisabled({item:e,field:t}),{label:g,placeholder:b,description:v,id:y,setValue:k,isValid:S}=t,_=t.getValue({item:e})??"",x=(0,hRe.useCallback)(w=>o(k({item:e,value:w})),[e,o,k]);return(0,gRe.jsx)(mRe,{label:g,value:_,onChange:x,placeholder:b,id:y,hideLabelFromVision:r,help:v,disabled:m,required:!!S.required,markWhenOptional:n,customValidity:ao(S,s),className:a,clientId:l,allowedFormats:u,disableFormats:d,withoutInteractiveFormatting:f,preserveWhiteSpace:p,disableLineBreaks:h})}var ux=c(U(),1),yRe=c(F(),1);var o5=c(E(),1),{ValidatedToggleGroupControl:ZXe}=so(ux.privateApis);function vRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,isValid:l}=t,u=t.isDisabled({item:e,field:t}),d=s({item:e}),f=(0,yRe.useCallback)(g=>o(a({item:e,value:g})),[e,o,a]),{elements:p,isLoading:h}=Os({elements:t.elements,getElements:t.getElements});if(h)return(0,o5.jsx)(ux.Spinner,{});if(p.length===0)return null;let m=p.find(g=>g.value===d);return(0,o5.jsx)(ZXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(l,i),isBlock:!0,label:t.label,help:m?.description||t.description,onChange:f,value:d,hideLabelFromVision:r,children:p.map(g=>(0,o5.jsx)(ux.__experimentalToggleGroupControlOption,{label:g.label,value:g.value,disabled:u},g.value))})}var r5=c(U(),1),n5=c(F(),1);var E1=c(E(),1),{ValidatedFormTokenField:XXe}=so(r5.privateApis);function SRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:l,getValue:u,setValue:d,isValid:f}=t,p=u({item:e}),h=t.isDisabled({item:e,field:t}),{elements:m,isLoading:g}=Os({elements:t.elements,getElements:t.getElements}),b=(0,n5.useMemo)(()=>Array.isArray(p)?p.map(y=>m?.find(S=>S.value===y)||{value:y,label:y}):[],[p,m]),v=(0,n5.useCallback)(y=>{let k=y.map(S=>typeof S=="object"&&"value"in S?S.value:S);o(d({item:e,value:k}))},[o,d,e]);return g?(0,E1.jsx)(r5.Spinner,{}):(0,E1.jsx)(XXe,{required:!!f?.required,markWhenOptional:n,customValidity:ao(f,i),label:r?void 0:s,value:b,onChange:v,placeholder:a,suggestions:m?.map(y=>y.value),disabled:h,__experimentalValidateInput:y=>t.isValid?.elements&&m?m.some(k=>k.value===y||k.label===y):!0,__experimentalExpandOnFocus:m&&m.length>0,help:l??(t.isValid?.elements?"":void 0),displayTransform:y=>typeof y=="object"&&"label"in y?y.label:typeof y=="string"&&m&&m.find(S=>S.value===y)?.label||y,__experimentalRenderItem:({item:y})=>{if(typeof y=="string"&&m){let k=m.find(S=>S.value===y);return(0,E1.jsx)("span",{children:k?.label||y})}return(0,E1.jsx)("span",{children:y})}})}var As=c(U(),1),kK=c(F(),1),kRe=c(G(),1);var Mf=c(E(),1),{ValidatedInputControl:QXe}=so(As.privateApis),JXe=({color:e,onColorChange:t,disabled:o})=>{let r=e&&Lo(e).isValid()?e:"#ffffff";return(0,Mf.jsx)(As.Dropdown,{className:"dataviews-controls__color-picker-dropdown",popoverProps:{resize:!1},renderToggle:({onToggle:n})=>(0,Mf.jsx)(As.Button,{onClick:n,"aria-label":(0,kRe.__)("Open color picker"),size:"small",disabled:o,accessibleWhenDisabled:!0,icon:()=>(0,Mf.jsx)(As.ColorIndicator,{colorValue:r})}),renderContent:()=>(0,Mf.jsx)(As.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Mf.jsx)(As.ColorPicker,{color:r,onChange:t,enableAlpha:!0})})})};function _Re({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:l,setValue:u,isValid:d}=t,f=t.isDisabled({item:e,field:t}),p=t.getValue({item:e})||"",h=(0,kK.useCallback)(g=>{o(u({item:e,value:g}))},[e,o,u]),m=(0,kK.useCallback)(g=>{o(u({item:e,value:g||""}))},[e,o,u]);return(0,Mf.jsx)(QXe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:ao(d,i),label:s,placeholder:a,value:p,help:l,onChange:m,hideLabelFromVision:r,type:"text",disabled:f,prefix:(0,Mf.jsx)(As.__experimentalInputControlPrefixWrapper,{variant:"control",children:(0,Mf.jsx)(JXe,{color:p,onColorChange:h,disabled:f})})})}var s5=c(U(),1),a5=c(F(),1),_K=c(G(),1);var i5=c(E(),1);function xRe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let[s,a]=(0,a5.useState)(!1),l=t.isDisabled({item:e,field:t}),u=(0,a5.useCallback)(()=>{a(d=>!d)},[]);return(0,i5.jsx)($u,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:s?"text":"password",suffix:(0,i5.jsx)(s5.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,i5.jsx)(s5.Button,{icon:s?Vl:dg,onClick:u,size:"small",label:s?(0,_K.__)("Hide password"):(0,_K.__)("Show password"),disabled:l,accessibleWhenDisabled:!0})})})}function l5(e){return Array.isArray(e.elements)&&e.elements.length>0||typeof e.getElements=="function"}var CRe=c(E(),1),wRe={adaptiveSelect:zTe,array:SRe,checkbox:ITe,color:_Re,combobox:FV,datetime:MTe,date:VTe,email:GTe,telephone:WTe,url:$Te,integer:qTe,number:XTe,password:xRe,radio:JTe,select:GV,text:tRe,toggle:iRe,textarea:cRe,richtext:bRe,toggleGroup:vRe};function eQe(e){return e&&typeof e=="object"&&typeof e.control=="string"}function tQe(e){let{control:t,...o}=e,r=c5(t);return r===null?null:function(i){return(0,CRe.jsx)(r,{...i,config:o})}}function ERe(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?c5(e.Edit):eQe(e.Edit)?tQe(e.Edit):l5(e)&&e.type!=="array"?c5("adaptiveSelect"):t===null?null:c5(t)}function c5(e){return Object.keys(wRe).includes(e)?wRe[e]:null}function oQe(e,t,o){if(e.filterBy===!1)return!1;let r=e.filterBy?.operators?.filter(n=>o.includes(n))??t;return r.length===0?!1:{isPrimary:!!e.filterBy?.isPrimary,operators:r}}var TRe=oQe;var rQe=e=>({item:t})=>{let o=e.split("."),r=t;for(let n of o)r.hasOwnProperty(n)?r=r[n]:r=void 0;return r},RRe=rQe;var nQe=e=>({value:t})=>{let o=e.split("."),r={},n=r;for(let i of o.slice(0,-1))n[i]={},n=n[i];return n[o.at(-1)]=t,r},BRe=nQe;var IRe=c(G(),1);function u5({item:e,field:t}){let{elements:o,isLoading:r}=Os({elements:t.elements,getElements:t.getElements}),n=t.getValue({item:e});return r||o.length===0?n:o?.find(i=>i.value===n)?.label||t.getValue({item:e})}var PRe=c(E(),1);function Rr({item:e,field:t}){return t.hasElements?(0,PRe.jsx)(u5,{item:e,field:t}):t.getValueFormatted({item:e,field:t})}var Ku=(e,t,o)=>o==="asc"?e.localeCompare(t):t.localeCompare(e);function Br(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)}function Yu(e,t){if(typeof t.isValid.minLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length>=t.isValid.minLength.constraint}function qu(e,t){if(typeof t.isValid.maxLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length<=t.isValid.maxLength.constraint}function Zu(e,t){if(t.isValid.pattern?.constraint===void 0)return!0;try{let o=new RegExp(t.isValid.pattern.constraint),r=t.getValue({item:e});return[void 0,"",null].includes(r)?!0:o.test(String(r))}catch{return!1}}function Oo(e,t){let r=(t.elements??[]).map(i=>i.value);if(r.length===0)return!0;let n=t.getValue({item:e});return[].concat(n).every(i=>r.includes(i))}function iQe({item:e,field:t}){return t.getValue({item:e})}var Ji=iQe;var sQe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function aQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!sQe.test(o)?(0,IRe.__)("Value must be a valid email address."):null}var ORe={type:"email",render:Rr,Edit:"email",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo,custom:aQe}};var ARe=c(G(),1);var dx=(e,t,o)=>o==="asc"?e-t:t-e;function d5(e,t){if(typeof t.isValid.min?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)>=t.isValid.min.constraint}function f5(e,t){if(typeof t.isValid.max?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)<=t.isValid.max.constraint}var LRe={separatorThousand:","};function lQe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="integer"?r=LRe:r=t.format;let{separatorThousand:n}=r,i=Math.trunc(o);return n?String(i).replace(/\B(?=(\d{3})+(?!\d))/g,n):String(i)}function cQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Number.isInteger(o)?(0,ARe.__)("Value must be an integer."):null}var MRe={type:"integer",render:Rr,Edit:"integer",sort:dx,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr,gh,bh,yh,vh,Zi],validOperators:[hr,gr,gh,bh,yh,vh,Zi,er,tr,Si,ki],format:LRe,getValueFormatted:lQe,validate:{required:Br,min:d5,max:f5,elements:Oo,custom:cQe}};var NRe=c(G(),1);var DRe={separatorThousand:",",separatorDecimal:".",decimals:2};function uQe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="number"?r=DRe:r=t.format;let{separatorThousand:n,separatorDecimal:i,decimals:s}=r,a=o.toFixed(s),[l,u]=a.split("."),d=n?l.replace(/\B(?=(\d{3})+(?!\d))/g,n):l;return s===0?d:d+i+u}function dQe(e){return e===""||e===void 0||e===null}function fQe(e,t){let o=t.getValue({item:e});return!dQe(o)&&!Number.isFinite(o)?(0,NRe.__)("Value must be a number."):null}var VRe={type:"number",render:Rr,Edit:"number",sort:dx,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr,gh,bh,yh,vh,Zi],validOperators:[hr,gr,gh,bh,yh,vh,Zi,er,tr,Si,ki],format:DRe,getValueFormatted:uQe,validate:{required:Br,min:d5,max:f5,elements:Oo,custom:fQe}};var FRe={type:"text",render:Rr,Edit:"text",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var Ry=c(Tu(),1);var jRe=c(Tu(),1);function zRe(e){if(!e||!Of(new Date(e)))return null;let t=(0,jRe.getDate)(e);return t&&Of(t)?t:null}function HRe(e,t,o){let r=t.isValid[o]?.constraint;if(typeof r!="string")return!1;let n=t.getValue({item:e}),i=Array.isArray(n)?n[o==="min"?0:n.length-1]:n;if(i==null||i==="")return!0;let s=zRe(r),a=zRe(String(i));return!!s&&!!a&&(o==="min"?a.getTime()>=s.getTime():a.getTime()<=s.getTime())}function p5(e,t){return HRe(e,t,"min")}function m5(e,t){return HRe(e,t,"max")}var URe={datetime:(0,Ry.getSettings)().formats.datetime,weekStartsOn:(0,Ry.getSettings)().l10n.startOfWeek};function pQe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="datetime"?r=URe:r=t.format,(0,Ry.dateI18n)(r.datetime,(0,Ry.getDate)(o))}var mQe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},GRe={type:"datetime",render:Rr,Edit:"datetime",sort:mQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[wh,Ch,Sh,kh,_h,xh,Xi,Is],validOperators:[wh,Ch,Sh,kh,_h,xh,Xi,Is],format:URe,getValueFormatted:pQe,validate:{required:Br,elements:Oo,min:p5,max:m5}};var By=c(Tu(),1);var WRe={date:(0,By.getSettings)().formats.date,weekStartsOn:(0,By.getSettings)().l10n.startOfWeek};function hQe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="date"?r=WRe:r=t.format,(0,By.dateI18n)(r.date,(0,By.getDate)(o))}var gQe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},$Re={type:"date",render:Rr,Edit:"date",sort:gQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[wh,Ch,Sh,kh,_h,xh,Xi,Is,Zi],validOperators:[wh,Ch,Sh,kh,_h,xh,Xi,Is,Zi],format:WRe,getValueFormatted:hQe,validate:{required:Br,elements:Oo,min:p5,max:m5}};var h5=c(G(),1);function KRe(e,t){return t.getValue({item:e})===!0}function bQe({item:e,field:t}){let o=t.getValue({item:e});return o===!0?(0,h5.__)("True"):o===!1?(0,h5.__)("False"):""}function yQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&![!0,!1].includes(o)?(0,h5.__)("Value must be true, false, or undefined"):null}var vQe=(e,t,o)=>{let r=!!e;return r===!!t?0:o==="asc"?r?1:-1:r?-1:1},YRe={type:"boolean",render:Rr,Edit:"checkbox",sort:vQe,validate:{required:KRe,elements:Oo,custom:yQe},enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr],validOperators:[hr,gr],format:{},getValueFormatted:bQe};var qRe={type:"media",render:()=>null,Edit:null,sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:Ji,validate:{}};var xK=c(G(),1);function ZRe(e,t){let o=t.getValue({item:e});return Array.isArray(o)&&o.length>0&&o.every(r=>![void 0,"",null].includes(r))}function XRe({item:e,field:t}){let o=t.getValue({item:e});return(Array.isArray(o)?o:[]).join(", ")}function SQe({item:e,field:t}){return XRe({item:e,field:t})}function kQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Array.isArray(o)?(0,xK.__)("Value must be an array."):o.every(r=>typeof r=="string")?null:(0,xK.__)("Every value must be a string.")}var _Qe=(e,t,o)=>{let r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return o==="asc"?r.length-n.length:n.length-r.length;let i=r.join(","),s=n.join(",");return o==="asc"?i.localeCompare(s):s.localeCompare(i)},QRe={type:"array",render:SQe,Edit:"array",sort:_Qe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[er,tr,Si,ki],format:{},getValueFormatted:XRe,validate:{required:ZRe,elements:Oo,custom:kQe}};function xQe({item:e,field:t}){return t.getValue({item:e})?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":""}var JRe={type:"password",render:Rr,Edit:"password",sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:xQe,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var eBe={type:"telephone",render:Rr,Edit:"telephone",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var tBe=c(G(),1);var fx=c(E(),1);function wQe({item:e,field:t}){if(t.hasElements)return(0,fx.jsx)(u5,{item:e,field:t});let o=Ji({item:e,field:t});return!o||!Lo(o).isValid()?o:(0,fx.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,fx.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:o,border:"1px solid #ddd",flexShrink:0}}),(0,fx.jsx)("span",{children:o})]})}function CQe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Lo(o).isValid()?(0,tBe.__)("Value must be a valid color."):null}var EQe=(e,t,o)=>{let r=Lo(e),n=Lo(t);if(!r.isValid()&&!n.isValid())return 0;if(!r.isValid())return o==="asc"?1:-1;if(!n.isValid())return o==="asc"?-1:1;let i=r.toHsl(),s=n.toHsl();return i.h!==s.h?o==="asc"?i.h-s.h:s.h-i.h:i.s!==s.s?o==="asc"?i.s-s.s:s.s-i.s:o==="asc"?i.l-s.l:s.l-i.l},oBe={type:"color",render:wQe,Edit:"color",sort:EQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,er,tr],format:{},getValueFormatted:Ji,validate:{required:Br,elements:Oo,custom:CQe}};var rBe={type:"url",render:Rr,Edit:"url",sort:Ku,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[er,tr],validOperators:[hr,gr,Hu,Uu,Gu,er,tr,Si,ki],format:{},getValueFormatted:Ji,validate:{required:Br,pattern:Zu,minLength:Yu,maxLength:qu,elements:Oo}};var TQe=(e,t,o)=>typeof e=="number"&&typeof t=="number"?dx(e,t,o):Ku(e,t,o),nBe={render:Rr,Edit:null,sort:TQe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[hr,gr],validOperators:TTe(),format:{},getValueFormatted:Ji,validate:{required:Br,elements:Oo}};function RQe(e){return e==="integer"||e==="number"}function BQe(e){return e==="date"||e==="datetime"}function iBe(e,t,o){let r=t.validate[o];if(r&&(typeof e=="number"&&RQe(t.type)||typeof e=="string"&&BQe(t.type)))return{constraint:e,validate:r}}function sBe(e,t){let o=e.isValid,r;o?.required===!0&&t.validate.required!==void 0&&(r={constraint:!0,validate:t.validate.required});let n;(o?.elements===!0||o?.elements===void 0&&(e.elements||e.getElements))&&t.validate.elements!==void 0&&(n={constraint:!0,validate:t.validate.elements});let i=iBe(o?.min,t,"min"),s=iBe(o?.max,t,"max"),a=o?.minLength,l;typeof a=="number"&&t.validate.minLength!==void 0&&(l={constraint:a,validate:t.validate.minLength});let u=o?.maxLength,d;typeof u=="number"&&t.validate.maxLength!==void 0&&(d={constraint:u,validate:t.validate.maxLength});let f=o?.pattern,p;f!==void 0&&t.validate.pattern!==void 0&&(p={constraint:f,validate:t.validate.pattern});let h=o?.custom??t.validate.custom;return{required:r,elements:n,min:i,max:s,minLength:l,maxLength:d,pattern:p,custom:h}}function aBe(e){return e.validOperators.reduce((t,o)=>{let r=ETe(o);return r?.filter&&(t[o]=r.filter),t},{})}function PQe(e,t){return{...t.format,...e.format}}var lBe=PQe;function IQe(e){let t=[ORe,MRe,VRe,FRe,GRe,$Re,YRe,qRe,QRe,JRe,eBe,oBe,rBe].find(o=>o?.type===e);return t||nBe}function T1(e){return e.map(t=>{let o=IQe(t.type),r=t.getValue||RRe(t.id),n=function(i,s,a){let l=r({item:i}),u=r({item:s});return t.sort?t.sort(l,u,a):o.sort(l,u,a)};return{id:t.id,label:t.label||t.id,header:t.header||t.label||t.id,description:t.description,placeholder:t.placeholder,getValue:r,setValue:t.setValue||BRe(t.id),elements:t.elements,getElements:t.getElements,hasElements:l5(t),isVisible:t.isVisible,isDisabled:typeof t.isDisabled=="function"?t.isDisabled:()=>!!t.isDisabled,enableHiding:t.enableHiding??!0,readOnly:t.readOnly??!1,type:o.type,render:t.render??o.render,Edit:ERe(t,o.Edit),sort:n,enableSorting:t.enableSorting??o.enableSorting,enableGlobalSearch:t.enableGlobalSearch??o.enableGlobalSearch,isValid:sBe(t,o),filterBy:TRe(t,o.defaultOperators,o.validOperators),filter:aBe(o),format:lBe(t,o),getValueFormatted:t.getValueFormatted??o.getValueFormatted}})}var BK=c(F(),1);var cBe=c(F(),1),uBe=c(E(),1),wK=(0,cBe.createContext)({fields:[]});wK.displayName="DataFormContext";function dBe({fields:e,children:t}){return(0,uBe.jsx)(wK.Provider,{value:{fields:e},children:t})}var Bl=wK;var C5=c(F(),1);var b5=c(F(),1),B1=c(U(),1);var R1=c(G(),1),wi={type:"regular",labelPosition:"top"},OQe=e=>typeof e=="string"?[{id:e,visibility:"when-collapsed"}]:e.map(t=>typeof t=="string"?{id:t,visibility:"when-collapsed"}:{id:t.id,visibility:t.visibility});function fBe(e){let t=wi;if(e?.type==="regular")t={type:"regular",labelPosition:e?.labelPosition??"top"};else if(e?.type==="panel"){let o=e.summary??[],r=Array.isArray(o)?o:[o],n=e?.openAs,i;typeof n=="object"&&n.type==="modal"?i={type:"modal",applyLabel:n.applyLabel?.trim()||(0,R1.__)("Apply"),cancelLabel:n.cancelLabel?.trim()||(0,R1.__)("Cancel")}:n==="modal"?i={type:"modal",applyLabel:(0,R1.__)("Apply"),cancelLabel:(0,R1.__)("Cancel")}:i={type:"dropdown"},t={type:"panel",labelPosition:e?.labelPosition??"side",openAs:i,summary:r,editVisibility:e?.editVisibility??"on-hover"}}else if(e?.type==="card")if(e.withHeader===!1)t={type:"card",withHeader:!1,isOpened:!0,summary:[],isCollapsible:!1};else{let o=e.summary??[];t={type:"card",withHeader:!0,isOpened:typeof e.isOpened=="boolean"?e.isOpened:!0,summary:OQe(o),isCollapsible:e.isCollapsible===void 0?!0:e.isCollapsible}}else e?.type==="row"?t={type:"row",alignment:e?.alignment??"center",styles:e?.styles??{}}:e?.type==="details"&&(t={type:"details",summary:e?.summary??""});return t}function pBe(e){let t=fBe(e?.layout),o=(e.fields??[]).map(r=>{if(typeof r=="string")return{id:r,layout:t};let n=r.layout?fBe(r.layout):t;return{id:r.id,layout:n,...!!r.label&&{label:r.label},...!!r.description&&{description:r.description},..."children"in r&&Array.isArray(r.children)&&{children:pBe({fields:r.children,layout:wi}).fields}}});return{layout:t,fields:o}}var g5=pBe;var or=c(E(),1);function AQe({title:e}){return(0,or.jsx)(Qe,{direction:"column",className:"dataforms-layouts-regular__header",gap:"lg",children:(0,or.jsx)(Qe,{direction:"row",align:"center",children:(0,or.jsx)(B1.__experimentalHeading,{level:2,size:13,children:e})})})}function mBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,b5.useContext)(Bl),a=t.layout,l=(0,b5.useMemo)(()=>({layout:wi,fields:t.children?t.children:[]}),[t]);if(t.children)return(0,or.jsxs)(or.Fragment,{children:[!r&&t.label&&(0,or.jsx)(AQe,{title:t.label}),(0,or.jsx)(Ls,{data:e,form:l,onChange:o,validity:i?.children})]});let u=a.labelPosition,d=s.find(f=>f.id===t.id);return!d||!d.Edit?null:u==="side"?(0,or.jsxs)(Qe,{direction:"row",className:"dataforms-layouts-regular__field",gap:"sm",children:[(0,or.jsx)("div",{className:K("dataforms-layouts-regular__field-label",`dataforms-layouts-regular__field-label--label-position-${u}`),children:(0,or.jsx)(B1.BaseControl.VisualLabel,{children:d.label})}),(0,or.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:d.readOnly===!0?(0,or.jsx)(d.render,{item:e,field:d}):(0,or.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:!0,markWhenOptional:n,validity:i},d.id)})]}):(0,or.jsx)("div",{className:"dataforms-layouts-regular__field",children:d.readOnly===!0?(0,or.jsx)(or.Fragment,{children:(0,or.jsxs)(or.Fragment,{children:[!r&&u!=="none"&&(0,or.jsx)(B1.BaseControl.VisualLabel,{children:d.label}),(0,or.jsx)(d.render,{item:e,field:d})]})}):(0,or.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:u==="none"?!0:r,markWhenOptional:n,validity:i})})}var TK=c(bB(),1),Py=c(U(),1),Oc=c(F(),1),k5=c(fe(),1);var y5=c(U(),1),px=c(G(),1);var SBe=c(fe(),1);var CK=c(F(),1);function LQe(e,t){return K("dataforms-layouts-panel__field-label",`dataforms-layouts-panel__field-label--label-position-${e}`,{"has-error":t})}var hBe=LQe;var gBe=c(U(),1);var Oh=c(E(),1);function MQe(e,t,o){return e?(0,Oh.jsxs)(kt.Root,{children:[(0,Oh.jsx)(kt.Trigger,{render:(0,Oh.jsxs)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:[(0,Oh.jsx)(gBe.Icon,{icon:ag,size:16}),(0,Oh.jsxs)(bt,{children:[t,": "]}),o]})}),(0,Oh.jsx)(kt.Popup,{children:t})]}):o}var bBe=MQe;function yBe(e){if(!e)return;let t=Object.keys(e).filter(o=>o!=="children");for(let o of t){let r=e[o];if(r!==void 0&&r.type==="invalid")return r.message?r.message:o==="required"?"A required field is empty":"Unidentified validation error"}if(e.children)for(let o of Object.values(e.children)){let r=yBe(o);if(r)return r}}var vBe=yBe;var es=c(E(),1);function P1({data:e,field:t,fieldLabel:o,summaryFields:r,validity:n,touched:i,disabled:s,isOpen:a,onClick:l}){let{labelPosition:u,editVisibility:d}=t.layout,f=vBe(n),p=i&&!!f,h=hBe(u,p),m=bBe(p,f,o),g=K("dataforms-layouts-panel__field-trigger",`dataforms-layouts-panel__field-trigger--label-${u}`,{"is-disabled":s,"dataforms-layouts-panel__field-trigger--edit-always":d==="always"}),b=(0,SBe.useInstanceId)(P1,"dataforms-layouts-panel__field-control"),v=p?(0,px.sprintf)((0,px._x)("Edit %s (has errors)","field"),o||""):(0,px.sprintf)((0,px._x)("Edit %s","field"),o||""),y=(0,CK.useRef)(null),k=(0,CK.useRef)(null);return(0,es.jsxs)("div",{ref:y,className:g,onClick:s?void 0:x=>{!a&&x.detail<2&&!k.current?.contains(x.target)&&y.current?.ownerDocument.defaultView?.getSelection()?.toString()||l()},onKeyDown:s?void 0:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},children:[u!=="none"&&(0,es.jsx)("span",{className:h,children:m}),u==="none"&&p&&(0,es.jsxs)(kt.Root,{children:[(0,es.jsx)(kt.Trigger,{render:(0,es.jsx)("span",{className:"dataforms-layouts-panel__field-label-error-content",role:"img","aria-label":f,children:(0,es.jsx)(y5.Icon,{icon:ag,size:16})})}),(0,es.jsx)(kt.Popup,{children:f})]}),(0,es.jsx)("span",{id:`${b}`,className:"dataforms-layouts-panel__field-control",children:r.length>1?(0,es.jsx)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",gap:"2px"},children:r.map(x=>(0,es.jsx)("span",{style:{width:"100%"},children:(0,es.jsx)(x.render,{item:e,field:x})},x.id))}):r.map(x=>(0,es.jsx)(x.render,{item:e,field:x},x.id))}),!s&&(0,es.jsx)(y5.Button,{ref:k,className:"dataforms-layouts-panel__field-trigger-icon",label:v,icon:ug,size:"small","aria-expanded":a,"aria-haspopup":"dialog","aria-describedby":`${b}`})]})}var kBe=c(bB(),1),EK=c(Xh(),1),Xu=c(F(),1),ts=c(G(),1);function _Be(e){return e?Object.values(e).every(t=>Object.entries(t).every(([o,r])=>o==="children"&&r&&typeof r=="object"?_Be(r):r.type!=="invalid"&&r.type!=="validating")):!0}function NQe(e,t){let o=g5(e);if(o.fields.length===0)return[];let r=new Map;t.forEach(s=>{r.set(s.id,s)});function n(s){if("children"in s&&Array.isArray(s.children)){let u=s.children.map(n).filter(f=>f!==null);if(u.length===0)return null;let d=r.get(s.id);if(d){let[f]=T1([d]);return{id:s.id,children:u,field:f}}return{id:s.id,children:u}}let a=r.get(s.id);if(!a)return null;let[l]=T1([a]);return{id:s.id,children:[],field:l}}return o.fields.map(n).filter(s=>s!==null)}function mx(e,t,o){if(e||(e={}),o.length===0)return e;let r={...e},n=r;for(let s=0;s{if(a===r.current[t.id]){if(!Array.isArray(l)){n(u=>mx(u,{elements:{type:"invalid",message:(0,ts.__)("Could not validate elements.")}},[...i,t.id]));return}t.field?.isValid.elements&&!t.field.isValid.elements.validate(s,{...t.field,elements:l})?n(u=>mx(u,{elements:{type:"invalid",message:(0,ts.__)("Value must be one of the elements.")}},[...i,t.id])):n(u=>xBe(u,[...i,t.id],"elements"))}}).catch(l=>{if(a!==r.current[t.id])return;let u;l instanceof Error?u=l.message:u=String(l)||(0,ts.__)("Unknown error when running elements validation asynchronously."),n(d=>mx(d,{elements:{type:"invalid",message:u}},[...i,t.id]))})}function VQe(e,t,o){let{customCounterRef:r,setFormValidity:n,path:i}=o,s=(r.current[t.id]||0)+1;r.current[t.id]=s,e.then(a=>{if(s===r.current[t.id]){if(a===null){n(l=>xBe(l,[...i,t.id],"custom"));return}if(typeof a=="string"){n(l=>mx(l,{custom:{type:"invalid",message:a}},[...i,t.id]));return}n(l=>mx(l,{custom:{type:"invalid",message:(0,ts.__)("Validation could not be processed.")}},[...i,t.id]))}}).catch(a=>{if(s!==r.current[t.id])return;let l;a instanceof Error?l=a.message:l=String(a)||(0,ts.__)("Unknown error when running custom validation asynchronously."),n(u=>mx(u,{custom:{type:"invalid",message:l}},[...i,t.id]))})}function wBe(e,t,o){if(t.field?.isValid.required&&!t.field.isValid.required.validate(e,t.field))return{required:{type:"invalid"}};if(t.field?.isValid.pattern&&!t.field.isValid.pattern.validate(e,t.field))return{pattern:{type:"invalid",message:(0,ts.__)("Value does not match the required pattern.")}};if(t.field?.isValid.min&&!t.field.isValid.min.validate(e,t.field))return{min:{type:"invalid",message:(0,ts.__)("Value is below the minimum.")}};if(t.field?.isValid.max&&!t.field.isValid.max.validate(e,t.field))return{max:{type:"invalid",message:(0,ts.__)("Value is above the maximum.")}};if(t.field?.isValid.minLength&&!t.field.isValid.minLength.validate(e,t.field))return{minLength:{type:"invalid",message:(0,ts.__)("Value is too short.")}};if(t.field?.isValid.maxLength&&!t.field.isValid.maxLength.validate(e,t.field))return{maxLength:{type:"invalid",message:(0,ts.__)("Value is too long.")}};if(t.field?.isValid.elements&&t.field.hasElements&&!t.field.getElements&&Array.isArray(t.field.elements)&&!t.field.isValid.elements.validate(e,t.field))return{elements:{type:"invalid",message:(0,ts.__)("Value must be one of the elements.")}};let r;if(t.field&&t.field.isValid.custom)try{let i=t.field.getValue({item:e});r=t.field.isValid.custom((0,kBe.default)(e,t.field.setValue({item:e,value:i})),t.field)}catch(i){let s;return i instanceof Error?s=i.message:s=String(i)||(0,ts.__)("Unknown error when running custom validation."),{custom:{type:"invalid",message:s}}}if(typeof r=="string")return{custom:{type:"invalid",message:r}};let n={};if(t.field&&t.field.isValid.elements&&t.field.hasElements&&typeof t.field.getElements=="function"&&(DQe(t.field.getElements(),t,o),n.elements={type:"validating",message:(0,ts.__)("Validating\u2026")}),r instanceof Promise&&(VQe(r,t,o),n.custom={type:"validating",message:(0,ts.__)("Validating\u2026")}),Object.keys(n).length>0)return n;if(t.children.length>0){let i={};t.children.forEach(a=>{i[a.id]=wBe(e,a,{...o,path:[...o.path,t.id,"children"]})});let s={};return Object.entries(i).forEach(([a,l])=>{l!==void 0&&(s[a]=l)}),Object.keys(s).length===0?void 0:{children:s}}}function CBe(e,t){let o=e?.field?.getValue({item:t});if(e.children.length===0)return o;let r=e.children.map(n=>CBe(n,t));return r?{value:o,children:r}:o}function FQe(e,t,o){let[r,n]=(0,Xu.useState)(),i=(0,Xu.useRef)({}),s=(0,Xu.useRef)({}),a=(0,Xu.useRef)({}),l=(0,Xu.useCallback)(()=>{let u={customCounterRef:i,elementsCounterRef:s,setFormValidity:n,path:[],item:e},d=NQe(o,t);if(d.length===0){n(void 0);return}let f={},p=[];d.forEach(h=>{let m=CBe(h,e);if(a.current.hasOwnProperty(h.id)&&(0,EK.default)(a.current[h.id],m)){p.push(h.id);return}a.current[h.id]=m;let g=wBe(e,h,u);g!==void 0&&(f[h.id]=g)}),n(h=>{let m={...h,...f},g=[...p,...Object.keys(f)];return Object.keys(m).forEach(v=>{m&&!g.includes(v)&&delete m[v]}),Object.keys(m).length===0&&(m=void 0),(0,EK.default)(h,m)?h:m})},[e,t,o]);return(0,Xu.useEffect)(()=>{l()},[l]),{validity:r,isValid:_Be(r)}}var EBe=FQe;var TBe=c(F(),1);function Ah(e,t){(0,TBe.useEffect)(()=>{t&&e.current&&e.current.querySelectorAll("input, textarea, select").forEach(r=>{r.reportValidity()})},[t,e])}var RBe=c(F(),1);function zQe(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.id):[]}var v5=(e,t)=>Array.isArray(e)&&e.length>0?zQe(e).map(r=>t.find(n=>n.id===r)).filter(r=>r!==void 0):[];var jQe=(e,t)=>{let o=t.find(r=>r.id===e.id);return o||t.find(r=>{if(e.children){let n=e.children.filter(i=>!i.children);return n.length===0?!1:r.id===n[0].id}return r.id===e.id})};function HQe(e){let{fields:t}=(0,RBe.useContext)(Bl),o=e.layout,r=v5(o.summary,t),n=jQe(e,t),i=e.children?e.label:n?.label;return r.length===0?{summaryFields:n?[n]:[],fieldDefinition:n,fieldLabel:i}:{summaryFields:r,fieldDefinition:n,fieldLabel:i}}var S5=HQe;var os=c(E(),1);function UQe({data:e,field:t,onChange:o,fieldLabel:r,onClose:n,touched:i}){let{openAs:s}=t.layout,{applyLabel:a,cancelLabel:l}=s,{fields:u}=(0,Oc.useContext)(Bl),[d,f]=(0,Oc.useState)({}),p=(0,Oc.useMemo)(()=>(0,TK.default)(e,d,{arrayMerge:(_,x)=>x}),[e,d]),h=(0,Oc.useMemo)(()=>({layout:wi,fields:t.children?t.children:[{id:t.id,layout:wi}]}),[t]),m=u.map(_=>({..._,Edit:_.Edit===null?void 0:_.Edit,isValid:{required:_.isValid.required?.constraint,elements:_.isValid.elements?.constraint,min:_.isValid.min?.constraint,max:_.isValid.max?.constraint,pattern:_.isValid.pattern?.constraint,minLength:_.isValid.minLength?.constraint,maxLength:_.isValid.maxLength?.constraint}})),{validity:g}=EBe(p,m,h),b=()=>{o(d),n()},v=_=>{f(x=>(0,TK.default)(x,_,{arrayMerge:(w,T)=>T}))},y=(0,k5.useFocusOnMount)("firstInputElement"),k=(0,Oc.useRef)(null),S=(0,k5.useMergeRefs)([y,k]);return Ah(k,i),(0,os.jsxs)(Py.Modal,{className:"dataforms-layouts-panel__modal",onRequestClose:n,isFullScreen:!1,title:r,size:"medium",children:[(0,os.jsx)("div",{ref:S,children:(0,os.jsx)(Ls,{data:p,form:h,onChange:v,validity:g,children:(_,x,w,T)=>(0,os.jsx)(_,{data:p,field:x,onChange:v,hideLabelFromVision:h.fields.length<2,markWhenOptional:T,validity:w},x.id)})}),(0,os.jsxs)(Qe,{direction:"row",className:"dataforms-layouts-panel__modal-footer",gap:"md",children:[(0,os.jsx)(Py.__experimentalSpacer,{style:{flex:1}}),(0,os.jsx)(Py.Button,{variant:"tertiary",onClick:n,__next40pxDefaultSize:!0,children:l}),(0,os.jsx)(Py.Button,{variant:"primary",onClick:b,__next40pxDefaultSize:!0,children:a})]})]})}function GQe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Oc.useState)(!1),[s,a]=(0,Oc.useState)(!1),{fieldDefinition:l,fieldLabel:u,summaryFields:d}=S5(t);if(!l)return null;let f=()=>{a(!1),i(!0)};return(0,os.jsxs)(os.Fragment,{children:[(0,os.jsx)(P1,{data:e,field:t,fieldLabel:u,summaryFields:d,validity:r,touched:n,disabled:l.readOnly===!0,onClick:()=>a(!0),isOpen:s}),s&&(0,os.jsx)(UQe,{data:e,field:t,onChange:o,fieldLabel:u??"",onClose:f,touched:n})]})}var BBe=GQe;var Lh=c(U(),1),PBe=c(G(),1),Nf=c(F(),1);var IBe=c(fe(),1);var Ci=c(E(),1);function WQe({title:e,onClose:t}){return(0,Ci.jsx)(Qe,{direction:"column",className:"dataforms-layouts-panel__dropdown-header",gap:"lg",children:(0,Ci.jsxs)(Qe,{direction:"row",gap:"sm",align:"center",children:[e&&(0,Ci.jsx)(Lh.__experimentalHeading,{level:2,size:13,children:e}),(0,Ci.jsx)(Lh.__experimentalSpacer,{style:{flex:1}}),t&&(0,Ci.jsx)(Lh.Button,{label:(0,PBe.__)("Close"),icon:tg,onClick:t,size:"small"})]})})}function $Qe({touched:e,children:t}){let o=(0,Nf.useRef)(null);return Ah(o,e),(0,Ci.jsx)("div",{ref:o,children:t})}function KQe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Nf.useState)(!1),[s,a]=(0,Nf.useState)(null),l=(0,Nf.useMemo)(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]),[u,d]=(0,IBe.__experimentalUseDialog)({focusOnMount:"firstInputElement"}),f=(0,Nf.useMemo)(()=>({layout:wi,fields:t.children?t.children:[{id:t.id,layout:wi}]}),[t]),p=(0,Nf.useMemo)(()=>{if(r!==void 0)return t.children?r?.children:{[t.id]:r}},[r,t]),{fieldDefinition:h,fieldLabel:m,summaryFields:g}=S5(t);return h?(0,Ci.jsx)("div",{ref:a,className:"dataforms-layouts-panel__field-dropdown-anchor",children:(0,Ci.jsx)(Lh.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:l,focusOnMount:!1,onToggle:b=>{b||i(!0)},renderToggle:({isOpen:b,onToggle:v})=>(0,Ci.jsx)(P1,{data:e,field:t,fieldLabel:m,summaryFields:g,validity:r,touched:n,disabled:h.readOnly===!0,isOpen:b,onClick:v}),renderContent:({onClose:b})=>(0,Ci.jsx)($Qe,{touched:n,children:(0,Ci.jsxs)("div",{ref:u,...d,children:[(0,Ci.jsx)(WQe,{title:m,onClose:b}),(0,Ci.jsx)(Ls,{data:e,form:f,onChange:o,validity:p,children:(v,y,k,S)=>(0,Ci.jsx)(v,{data:e,field:y,onChange:o,hideLabelFromVision:(f?.fields??[]).length<2,markWhenOptional:S,validity:k},y.id)})]})})})}):null}var OBe=KQe;var RK=c(E(),1);function ABe({data:e,field:t,onChange:o,validity:r}){return t.layout.openAs.type==="modal"?(0,RK.jsx)(BBe,{data:e,field:t,onChange:o,validity:r}):(0,RK.jsx)(OBe,{data:e,field:t,onChange:o,validity:r})}var Ms=c(F(),1);var _5=c(G(),1),LBe=c(E(),1);function MBe(e){if(!e)return 0;let t=0,o=Object.keys(e).filter(r=>r!=="children");for(let r of o)e[r]?.type==="invalid"&&t++;if(e.children)for(let r of Object.values(e.children))t+=MBe(r);return t}function x5({validity:e}){let t=MBe(e);return t===0?null:(0,LBe.jsx)(UH,{intent:"high",children:(0,_5.sprintf)((0,_5._n)("%d field needs attention","%d fields need attention",t),t)})}var Pr=c(E(),1);function YQe(e,t,o){if(!t||Array.isArray(t)&&t.length===0)return!1;let n=(Array.isArray(t)?t:[t]).find(i=>typeof i=="string"?i===e.id:typeof i=="object"&&"id"in i?i.id===e.id:!1);return n?typeof n=="string"?!0:typeof n=="object"&&"visibility"in n?n.visibility==="always"||n.visibility==="when-collapsed"&&!o:!0:!1}function qQe({data:e,fields:t,label:o,layout:r,isOpen:n,touched:i,validity:s}){let l=v5(r.summary,t).filter(f=>YQe(f,r.summary,n)),u=i&&r.isCollapsible,d=l.length>0&&r.withHeader;return(0,Pr.jsxs)(Qe,{align:"center",justify:"space-between",className:"dataforms-layouts-card__field-header-content",children:[(0,Pr.jsx)(lu.Title,{children:o}),(u||d)&&(0,Pr.jsxs)(nb.HeaderDescription,{className:"dataforms-layouts-card__field-header-content-description",children:[u&&(0,Pr.jsx)(x5,{validity:s}),d&&(0,Pr.jsx)("div",{className:"dataforms-layouts-card__field-summary",children:l.map(f=>(0,Pr.jsx)(f.render,{item:e,field:f},f.id))})]})]})}function ZQe({data:e,field:t,form:o,onChange:r,hideLabelFromVision:n,markWhenOptional:i,validity:s,withHeader:a}){if(t.children)return(0,Pr.jsxs)(Pr.Fragment,{children:[t.description&&(0,Pr.jsx)("div",{className:"dataforms-layouts-card__field-description",children:t.description}),(0,Pr.jsx)(Ls,{data:e,form:o,onChange:r,validity:s?.children})]});let l=Iy("regular")?.component;return l?(0,Pr.jsx)(l,{data:e,field:t,onChange:r,hideLabelFromVision:n||a,markWhenOptional:i,validity:s}):null}function NBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,Ms.useContext)(Bl),a=t.layout,l=(0,Ms.useRef)(null),u=(0,Ms.useMemo)(()=>({layout:wi,fields:t.children??[]}),[t]),{isOpened:d,isCollapsible:f}=a,[p,h]=(0,Ms.useState)(d),[m,g]=(0,Ms.useState)(!1);(0,Ms.useEffect)(()=>{h(d)},[d]);let b=(0,Ms.useCallback)(x=>{x||g(!0),h(x)},[]),v=(0,Ms.useCallback)(()=>{g(!0)},[]);Ah(l,(f?p:!0)&&m);let y=t.label,k;if(t.children)k=!!y&&a.withHeader;else{let x=s.find(w=>w.id===t.id);if(!x||!x.Edit)return null;y=x.label,k=!!y&&a.withHeader}let S=(0,Pr.jsx)(ZQe,{data:e,field:t,form:u,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,withHeader:k}),_=(0,Pr.jsx)(qQe,{data:e,fields:s,label:y,layout:a,isOpen:f?!!p:!0,touched:m,validity:i});return k&&f?(0,Pr.jsxs)(nb.Root,{className:"dataforms-layouts-card__field",open:p,onOpenChange:b,children:[(0,Pr.jsx)(nb.Header,{children:_}),(0,Pr.jsx)(nb.Content,{ref:l,onBlur:v,children:S})]}):(0,Pr.jsxs)(lu.Root,{className:"dataforms-layouts-card__field",children:[k&&(0,Pr.jsx)(lu.Header,{children:_}),(0,Pr.jsx)(lu.Content,{ref:l,onBlur:v,children:S})]})}var DBe=c(U(),1);var Nn=c(E(),1);function XQe({title:e}){return(0,Nn.jsx)(Qe,{direction:"column",className:"dataforms-layouts-row__header",gap:"lg",children:(0,Nn.jsx)(Qe,{direction:"row",align:"center",children:(0,Nn.jsx)(DBe.__experimentalHeading,{level:2,size:13,children:e})})})}var QQe=({children:e})=>(0,Nn.jsx)(Nn.Fragment,{children:e});function VBe({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let s=t.layout;if(t.children){let l={layout:wi,fields:t.children};return(0,Nn.jsxs)("div",{className:"dataforms-layouts-row__field",children:[!r&&t.label&&(0,Nn.jsx)(XQe,{title:t.label}),(0,Nn.jsx)(Qe,{direction:"row",align:s.alignment,gap:"lg",children:(0,Nn.jsx)(Ls,{data:e,form:l,onChange:o,validity:i?.children,as:QQe,children:(u,d,f)=>(0,Nn.jsx)("div",{className:"dataforms-layouts-row__field-control",style:s.styles[d.id],children:(0,Nn.jsx)(u,{data:e,field:d,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:f})},d.id)})})]})}let a=Iy("regular")?.component;return a?(0,Nn.jsx)(Nn.Fragment,{children:(0,Nn.jsx)("div",{className:"dataforms-layouts-row__field-control",children:(0,Nn.jsx)(a,{data:e,field:t,onChange:o,markWhenOptional:n,validity:i})})}):null}var Ns=c(F(),1),FBe=c(G(),1);var Df=c(E(),1);function zBe({data:e,field:t,onChange:o,validity:r}){let{fields:n}=(0,Ns.useContext)(Bl),i=(0,Ns.useRef)(null),s=(0,Ns.useRef)(null),[a,l]=(0,Ns.useState)(!1),[u,d]=(0,Ns.useState)(!1),f=(0,Ns.useMemo)(()=>({layout:wi,fields:t.children??[]}),[t]);(0,Ns.useEffect)(()=>{let b=i.current;if(!b)return;let v=()=>{let y=b.open;y||l(!0),d(y)};return b.addEventListener("toggle",v),()=>{b.removeEventListener("toggle",v)}},[]),Ah(s,u&&a);let p=(0,Ns.useCallback)(()=>{l(!0)},[]);if(!t.children)return null;let h=t.layout.summary??"",m=h?n.find(b=>b.id===h):void 0,g;return m&&m.render?g=(0,Df.jsx)(m.render,{item:e,field:m}):g=t.label||(0,FBe.__)("More details"),(0,Df.jsxs)("details",{ref:i,className:"dataforms-layouts-details__details",children:[(0,Df.jsx)("summary",{className:"dataforms-layouts-details__summary",children:(0,Df.jsxs)(Qe,{direction:"row",align:"center",gap:"md",className:"dataforms-layouts-details__summary-content",children:[g,a&&(0,Df.jsx)(x5,{validity:r})]})}),(0,Df.jsx)("div",{ref:s,className:"dataforms-layouts-details__content",onBlur:p,children:(0,Df.jsx)(Ls,{data:e,form:f,onChange:o,validity:r?.children})})]})}var Oy=c(E(),1),JQe=[{type:"regular",component:mBe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e})},{type:"panel",component:ABe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"md",children:e})},{type:"card",component:NBe,wrapper:({children:e})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"xl",children:e})},{type:"row",component:VBe,wrapper:({children:e,layout:t})=>(0,Oy.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:(0,Oy.jsx)("div",{className:"dataforms-layouts-row__field",children:(0,Oy.jsx)(Qe,{direction:"row",gap:"lg",align:t.alignment,children:e})})})},{type:"details",component:zBe}];function Iy(e){return JQe.find(t=>t.type===e)}var w5=c(E(),1),eJe=({children:e})=>(0,w5.jsx)(Qe,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e});function Ls({data:e,form:t,onChange:o,validity:r,children:n,as:i}){let{fields:s}=(0,C5.useContext)(Bl),a=(0,C5.useMemo)(()=>{let d=s.filter(p=>!!p.isValid?.required).length,f=s.length-d;return d>f},[s]);function l(d){return s.find(f=>f.id===d.id)}let u=i??Iy(t.layout.type)?.wrapper??eJe;return(0,w5.jsx)(u,{layout:t.layout,children:t.fields.map(d=>{let f=Iy(d.layout.type)?.component;if(!f)return null;let p=d.children?void 0:l(d);return p&&p.isVisible&&!p.isVisible(e)?null:n?n(f,d,r?.[d.id],a):(0,w5.jsx)(f,{data:e,field:d,onChange:o,markWhenOptional:a,validity:r?.[d.id]},d.id)})})}var PK=c(E(),1);function I1({data:e,form:t,fields:o,onChange:r,validity:n}){let i=(0,BK.useMemo)(()=>g5(t),[t]),s=(0,BK.useMemo)(()=>T1(o),[o]);return t.fields?(0,PK.jsx)(dBe,{fields:s,children:(0,PK.jsx)(Ls,{data:e,form:i,onChange:r,validity:n})}):null}var Nh=c(F(),1),oPe=c(G(),1);var gx=c(U(),1);var IK=c(G(),1);var jBe=c(fe(),1);function hx({isControl:e}={isControl:!1}){return(0,jBe.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}var E5=c(E(),1);function HBe({fields:e,visibleFields:t,onToggleField:o}){let{popoverProps:r}=hx();return!e||e.length===0?null:(0,E5.jsx)(gx.DropdownMenu,{icon:zs,label:(0,IK.__)("Options"),popoverProps:r,toggleProps:{size:"small"},children:({onClose:n})=>(0,E5.jsx)(gx.MenuGroup,{label:(0,IK.__)("Show / Hide"),children:e.map(i=>{let s=t.includes(i.id);return(0,E5.jsx)(gx.MenuItem,{isSelected:s,onClick:()=>{o(i.id),n()},role:"menuitemcheckbox",icon:s?ns:null,children:i.label},i.id)})})})}var T5=c(U(),1),UBe=c(fe(),1),GBe=c(Q(),1),Vf=c(F(),1),WBe=c(Ko(),1);var Ac=c(E(),1),{useRichText:tJe,KeyboardShortcutContext:oJe,InputEventContext:rJe}=H(WBe.privateApis);function $Be({data:e,field:t,hideLabelFromVision:o,onChange:r,config:n={}}){let i=(0,GBe.useRegistry)(),s=t.getValue({item:e}),a=t.config||{},{clientId:l}=n,[u,d]=(0,Vf.useState)({start:void 0,end:void 0}),[f,p]=(0,Vf.useState)(!1),h=(0,Vf.useRef)(),m=(0,Vf.useRef)(new Set),g=(0,Vf.useRef)(new Set),b=k_({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats});function v(){h.current?.focus()}let{value:y,getValue:k,onChange:S,ref:_,formatTypes:x}=tJe({value:s,onChange(B){r(t.setValue({item:e,value:B}))},selectionStart:u.start,selectionEnd:u.end,onSelectionChange:(B,R)=>d({start:B,end:R}),__unstableIsSelected:f,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:b,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,Vf.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:l}),[t.id,l])}),{baseControlProps:w,controlProps:T}=(0,T5.useBaseControlProps)({hideLabelFromVision:o??t.hideLabelFromVision,label:t.label});return(0,Ac.jsxs)(Ac.Fragment,{children:[f&&(0,Ac.jsx)(oJe.Provider,{value:g,children:(0,Ac.jsx)(rJe.Provider,{value:m,children:(0,Ac.jsx)("div",{children:(0,Ac.jsx)(GN,{value:y,onChange:S,onFocus:v,formatTypes:x,forwardedRef:h,isVisible:!1})})})}),(0,Ac.jsx)(T5.BaseControl,{...w,children:(0,Ac.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,UBe.useMergeRefs)([_,jN({registry:i,getValue:k,onChange:S,formatTypes:x,selectionChange:d,isSelected:f,disableFormats:a?.disableFormats,value:y,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:g,inputEvents:m}),h]),onFocus:()=>p(!0),onBlur:()=>p(!1),contentEditable:!0,...T})})]})}var Mh=c(U(),1),KBe=c(Q(),1),YBe=c(Tt(),1),qBe=c(F(),1),Ay=c(G(),1);var br=c(E(),1),nJe=e=>{window.requestAnimationFrame(()=>{let[t]=YBe.focus.tabbable.find(e?.current);t&&t.focus()})};function iJe({data:e,field:t,attachment:o,config:r}){let{allowedTypes:n=[],multiple:i=!1}=r||{};if(i)return"todo multiple";if(o?.media_type==="image"||o?.poster)return(0,br.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,br.jsx)("img",{alt:"",width:20,height:20,src:o.media_type==="image"?o.source_url:o.poster})});if(n.length===1){let a=t.getValue({item:e})?.url;if(n[0]==="image"&&a)return(0,br.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,br.jsx)("img",{alt:"",width:20,height:20,src:a})});let l;if(n[0]==="image"?l=$x:n[0]==="video"?l=D6:n[0]==="audio"?l=$F:l=Qy,l)return(0,br.jsx)(Mh.Icon,{icon:l,size:20})}return(0,br.jsx)(Mh.Icon,{icon:Qy,size:20})}function ZBe({data:e,field:t,onChange:o,config:r={}}){let{popoverProps:n}=hx({isControl:!0}),i=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:l=!1}=r,u=i?.id,d=i?.url,f=(0,KBe.useSelect)(m=>{if(!u)return;let b=m(C).getSettings()[pT];if(b)return b(m,u)},[u]),p;if(s.length===1){let m=s[0];m==="image"?p=(0,Ay.__)("Image"):m==="video"?p=(0,Ay.__)("Video"):m==="application"?p=(0,Ay.__)("File"):p=(0,Ay.__)("Media")}else p=(0,Ay.__)("Media");let h=(0,qBe.useRef)();return(0,br.jsx)(Xs,{children:(0,br.jsxs)("div",{ref:h,className:"block-editor-content-only-controls",children:[(0,br.jsx)(b_,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:u,mediaURL:d,multiple:a,popoverProps:n,onReset:()=>{o(t.setValue({item:e,value:{}}))},...l&&{useFeaturedImage:!!i?.featuredImage,onToggleFeaturedImage:()=>{o(t.setValue({item:e,value:{featuredImage:!i?.featuredImage}}))}},onSelect:m=>{if(m.id&&m.url){let g={...m,mediaType:m.media_type};l&&(g.featuredImage=!1),o(t.setValue({item:e,value:g}))}},renderToggle:m=>(0,br.jsx)(Mh.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...m,children:(0,br.jsxs)(Mh.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"20px 1fr",className:"block-editor-content-only-controls__media-row",children:[d&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(iJe,{attachment:f,field:t,data:e,config:r}),(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:f?.title?.raw&&f?.title?.raw!==""?f?.title?.raw:d})]}),!d&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"20px",height:"20px"}}),(0,br.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:p})]})]})})}),d&&(0,br.jsx)(Mh.Button,{label:(0,Ay.__)("Reset"),className:"block-editor-content-only-controls__media-reset",size:"small",icon:dn,onClick:()=>{o(t.setValue({item:e,value:{}})),nJe(h)}})]})})}var Ff=c(U(),1),B5=c(F(),1),XBe=c(G(),1);var QBe=c(Fs(),1);var ti=c(E(),1),OK="noopener",JBe="_blank",R5="nofollow";function sJe({rel:e="",url:t="",opensInNewTab:o,nofollow:r}){let n,i=e;if(o)n=JBe,i=i?.includes(OK)?i:i+` ${OK}`;else{let s=new RegExp(`\\b${OK}\\s*`,"g");i=i?.replace(s,"").trim()}if(r)i=i?.includes(R5)?i:(i+` ${R5}`).trim();else{let s=new RegExp(`\\b${R5}\\s*`,"g");i=i?.replace(s,"").trim()}return{url:(0,QBe.prependHTTP)(t),linkTarget:n,rel:i||void 0}}function ePe({data:e,field:t,onChange:o}){let[r,n]=(0,B5.useState)(!1),{popoverProps:i}=hx({isControl:!0}),s=t.getValue({item:e}),a=s?.url,l=s?.rel||"",d=s?.linkTarget===JBe,f=l===R5,p=(0,B5.useMemo)(()=>({url:a,opensInNewTab:d,nofollow:f}),[a,d,f]);return(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{n(!0)},children:(0,ti.jsxs)(Ff.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Icon,{icon:ss,size:24}),(0,ti.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(Ff.Icon,{icon:ss,size:24,style:{opacity:.3}}),(0,ti.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,XBe.__)("Link")})]})]})}),r&&(0,ti.jsx)(Ff.Popover,{onClose:()=>{n(!1)},...i??{},children:(0,ti.jsx)(eh,{value:p,onChange:h=>{let m=sJe({rel:l,...h});o(t.setValue({item:e,value:m}))},onRemove:()=>{o(t.setValue({item:e,value:{}}))}})})]})}var oi=c(E(),1),{fieldsKey:rPe,formKey:AK}=H(bx.privateApis);function LK(e,t={}){return function(r){return(0,oi.jsx)(e,{...r,config:t})}}function aJe({clientId:e,blockType:t,setAttributes:o,isMultiBlock:r=!1}){let n=jn({clientId:e,context:"list-view"}),i=Do(e),s=t?.[rPe],a=(0,Nh.useContext)(_n),l=(0,I5.useSelect)(v=>{let y=v(C).getBlockAttributes(e);if(!y?.metadata?.bindings)return y;let{__experimentalBlockBindingsSupportedAttributes:k}=v(C).getSettings(),S=k?.[t?.name],_=S?aT(y.metadata.bindings,S):y.metadata.bindings,{getBlockBindingsSource:x}=H(v(bx.store));return Object.entries(_).reduce((w,[T,B])=>{if(T==="__default")return w;let R=x(B.source);if(!R)return w;let I=R.getValues({select:v,clientId:e,context:a,bindings:{[T]:B}});return{...w,...I}},y)},[a,e,t?.name]),{selectBlock:u,toggleBlockHighlight:d}=(0,I5.useDispatch)(C),f=(0,tPe.useDebounce)(d,50),p=(0,Nh.useMemo)(()=>r?{...t?.[AK],fields:[t?.[AK]?.fields?.[0]]}:t?.[AK],[t,r]),[h,m]=(0,Nh.useState)(p),g=(0,Nh.useMemo)(()=>s?.length?s.map(v=>{let y={...v};return typeof v.Edit=="string"&&v.Edit==="rich-text"?y.Edit=LK($Be,{clientId:e}):typeof v.Edit=="string"&&v.Edit==="link"?y.Edit=LK(ePe):typeof v.Edit=="object"&&v.Edit.control==="media"&&(y.Edit=LK(ZBe,{...v.Edit})),y}):[],[s,e]);if(!s?.length)return null;let b=v=>{m(y=>y.fields?.includes(v)?{...y,fields:y.fields.filter(k=>k!==v)}:{...y,fields:[...y.fields||[],v]})};return(0,oi.jsxs)("div",{className:"block-editor-block-fields__container",onMouseEnter:r?()=>f(e,!0):void 0,onMouseLeave:()=>r?f(e,!1):void 0,onFocus:r?()=>{u(e,null)}:void 0,children:[(0,oi.jsx)("div",{className:"block-editor-block-fields__header",children:(0,oi.jsxs)(P5.__experimentalHStack,{spacing:1,children:[r&&(0,oi.jsxs)(oi.Fragment,{children:[(0,oi.jsx)(Et,{className:"block-editor-block-fields__header-icon",icon:i?.icon}),(0,oi.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,oi.jsx)(P5.__experimentalTruncate,{numberOfLines:1,children:n})}),(0,oi.jsx)(HBe,{fields:g,visibleFields:h.fields,onToggleField:b})]}),!r&&(0,oi.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,oPe.__)("Content")})]})}),(0,oi.jsx)(I1,{data:l,fields:g,form:h,onChange:o})]})}function lJe(e){return!!(window?.__experimentalContentOnlyInspectorFields&&(0,bx.getBlockType)(e)?.[rPe])}function cJe(e){let{blockType:t,isSelectionWithinCurrentSection:o}=(0,Nh.useContext)(Fn);return(0,oi.jsx)(Rb,{group:"content",children:(0,oi.jsx)(aJe,{...e,blockType:t,isMultiBlock:o})})}var nPe={edit:cJe,hasSupport:lJe,attributeKeys:[],supportsPatternEditing:!0};var DK=c(go(),1),iPe=c(U(),1),MK=c(G(),1),O1=c(ue(),1);var NK=c(E(),1);function uJe(e){return(0,O1.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function dJe({className:e,setAttributes:t}){return Er()!=="default"?null:(0,NK.jsx)(Oe,{group:"advanced",children:(0,NK.jsx)(iPe.TextControl,{autoComplete:"off",label:(0,MK.__)("Additional CSS class(es)"),value:e||"",onChange:r=>{t({className:r!==""?r:void 0})},help:(0,MK.__)("Separate multiple classes with spaces.")})})}var VK={edit:dJe,addSaveProps:fJe,attributeKeys:["className"],hasSupport(e){return(0,O1.hasBlockSupport)(e,"customClassName",!0)}};function fJe(e,t,o){return(0,O1.hasBlockSupport)(t,"customClassName",!0)&&o.className&&(e.className=K(e.className,o.className)),e}function pJe(e,t,o,r){if(!(0,O1.hasBlockSupport)(e.name,"customClassName",!0)||r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1)return e;if(t[o]){let n=t[o]?.attributes.className;if(n&&e.attributes.className===void 0)return{...e,attributes:{...e.attributes,className:n}}}return e}(0,DK.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",uJe);(0,DK.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",pJe);var sPe=c(go(),1),A1=c(ue(),1);function mJe(e,t){return(0,A1.hasBlockSupport)(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([(0,A1.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,A1.getBlockDefaultClassName)(t.name)),e}(0,sPe.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",mJe);var HK=c(F(),1),bPe=c(go(),1),yPe=c(Q(),1);var Lc=c(ue(),1),vPe=c(fe(),1),ed=c(rv(),1);var yx=c(F(),1),A5=c(Q(),1),O5=c(ue(),1),dPe=c(Rt(),1);var Qu=c(F(),1),aPe=c(GC(),1);var L1=c(E(),1);function lPe({clientId:e,value:t,computeStyle:o,forceShow:r}){let n=Nt(e),[i,s]=(0,Qu.useReducer)(()=>o(n));(0,Qu.useEffect)(()=>{n&&r&&s()},[n,r]),(0,Qu.useEffect)(()=>{if(!n)return;let d=new window.MutationObserver(s);return d.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{d.disconnect()}},[n]);let a=(0,Qu.useRef)(t),[l,u]=(0,Qu.useState)(!1);return(0,Qu.useEffect)(()=>{if((0,aPe.isShallowEqual)(t,a.current)||r)return;u(!0),a.current=t;let d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,r]),!l&&!r?null:(0,L1.jsx)(Xa,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,L1.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})})}function Dh(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function cPe({clientId:e,value:t,forceShow:o}){return(0,L1.jsx)(lPe,{clientId:e,value:t?.spacing?.margin,computeStyle:r=>{let n=Dh(r,"margin-top"),i=Dh(r,"margin-right"),s=Dh(r,"margin-bottom"),a=Dh(r,"margin-left");return{borderTopWidth:n,borderRightWidth:i,borderBottomWidth:s,borderLeftWidth:a,top:n?`-${n}`:0,right:i?`-${i}`:0,bottom:s?`-${s}`:0,left:a?`-${a}`:0}},forceShow:o})}function uPe({clientId:e,value:t,forceShow:o}){return(0,L1.jsx)(lPe,{clientId:e,value:t?.spacing?.padding,computeStyle:r=>({borderTopWidth:Dh(r,"padding-top"),borderRightWidth:Dh(r,"padding-right"),borderBottomWidth:Dh(r,"padding-bottom"),borderLeftWidth:Dh(r,"padding-left")}),forceShow:o})}var zf=c(E(),1),Ju="dimensions",M1="spacing";function hJe(){let[e,t]=(0,yx.useState)(!1),{hideBlockInterface:o,showBlockInterface:r}=H((0,A5.useDispatch)(C));return(0,yx.useEffect)(()=>{e?o():r()},[e,r,o]),[e,t]}function gJe({children:e,resetAllFilter:t}){let o=(0,yx.useCallback)(r=>{let n=r.style,i=t(n);return{...r,style:i}},[t]);return(0,zf.jsx)(Oe,{group:"dimensions",resetAllFilter:o,children:e})}function fPe({clientId:e,name:t,setAttributes:o,settings:r}){let n=Ja(),i=!Bn(n),s=ED(r,n),{style:a,className:l}=(0,A5.useSelect)(v=>{if(!s)return{};let y=v(C).getBlockAttributes(e)||{};return{style:y.style,className:y.className}},[e,s]),{value:u}=_l(t,l,n),[d,f]=hJe(),p=i?To(a,n):a,h=i?v=>{o({style:Pn(a,n,v)})}:v=>{o({style:Ge(v)})};if(!s)return null;let m=(0,O5.getBlockSupport)(t,[Ju,"__experimentalDefaultControls"]),g=(0,O5.getBlockSupport)(t,[M1,"__experimentalDefaultControls"]),b={minHeight:!1,minWidth:!1,...m,...g};return(0,zf.jsxs)(zf.Fragment,{children:[(0,zf.jsx)(TD,{as:gJe,panelId:e,settings:r,value:p,onChange:h,defaultControls:b,styleState:n,onVisualize:i?void 0:f,inheritedValue:u}),!i&&!!r?.spacing?.padding&&d==="padding"&&(0,zf.jsx)(uPe,{forceShow:d==="padding",clientId:e,value:p}),!i&&!!r?.spacing?.margin&&d==="margin"&&(0,zf.jsx)(cPe,{forceShow:d==="margin",clientId:e,value:p})]})}function pPe(e,t="any"){let o=(0,O5.getBlockSupport)(e,Ju);return o===!0?!0:t==="any"?!!(o?.aspectRatio||o?.height||o?.minHeight||o?.width||o?.minWidth):!!o?.[t]}function FK(e){return e?`${e}`.trim().toLowerCase()!=="auto":!1}var mPe={useBlockProps:bJe,attributeKeys:["height","minHeight","width","style"],hasSupport(e){return pPe(e)}};function bJe({name:e,height:t,minHeight:o,style:r}){if(!pPe(e,"aspectRatio")||$t(e,Ju,"aspectRatio"))return{};let n=FK(r?.dimensions?.aspectRatio),i=K({"has-aspect-ratio":n}),s={};return n?(s.minHeight="unset",s.height="unset"):(o||r?.dimensions?.minHeight||t||r?.dimensions?.height)&&(s.aspectRatio="unset"),{className:i,style:s}}function zK(){(0,dPe.default)("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}var yJe=c(ue(),1);function hPe(e,t,o=""){if(typeof t!="string"||!t)return Gc(e).map(i=>`${i.trim()}${o}`).join(", ");let r=Gc(e).filter(i=>i.trim()),n=Gc(t).filter(i=>i.trim());return n.length?n.map(i=>{i=i.trim();let s=i.match(/^([.#]?[-_a-zA-Z0-9]+|\[[^\]]+\])/);return s?r.map(a=>`${a.trim()}${i.slice(s[0].length)}${o}`).join(", "):r.map(a=>`${a.trim()}${o}`).join(", ")}).join(", "):r.map(i=>`${i.trim()}${o}`).join(", ")}var Vh=c(E(),1),{getResponsiveMediaQueries:vJe}=H(Sr),SJe=["Top","Right","Bottom","Left"],kJe=[...NEe,yy,Mn,Ju,Sy,M1,d1],UK=e=>kJe.some(t=>(0,Lc.hasBlockSupport)(e,t));function ga(e={}){let t={};return(0,ed.getCSSRules)(e).forEach(o=>{t[o.key]=o.value}),t}function _Je(e){let t=e?.border;if(!t)return;let o=!!t.style,r=!!t.color,n=!!t.width,i={};return!o&&(r||n)&&(i.style="solid"),SJe.forEach(s=>{let a=s.toLowerCase(),l=t[a],u=!!l?.style,d=!!l?.color,f=!!l?.width;!o&&!u&&(d||f)&&(i[a]={style:"solid"})}),Ge({border:Ge(i)})}function xJe(e,t){if(!!!e?.color?.background)return;let r=!!e?.color?.gradient,n=!!e?.background?.gradient||!!e?.background?.backgroundImage;if(r||n)return;let i="background-image: unset !important";return t?`${t} { ${i}; }`:`${i};`}function wJe(e){let t=e?.dimensions;if(t){if(FK(t.aspectRatio))return{dimensions:{minHeight:"unset",height:"unset"}};if(t.minHeight||t.height)return{dimensions:{aspectRatio:"unset"}}}}function CJe(e,t){let o=e?.typography?.textAlign;if(typeof o!="string"||!o)return;let r=`text-align: ${(0,ed.getCSSValueFromRawStyle)(o)} !important`;return t?`${t} { ${r}; }`:`${r};`}function EJe(e,t){let o=wJe(e),r=o?GK(e,o):e,n=(0,ed.compileCSS)(r,{selector:t}),i=n?n.replace(/;/g," !important;"):void 0,s=_Je(e),a=s?(0,ed.compileCSS)(s,{selector:t}):void 0,l=CJe(e,t),u=xJe(e,t);return[i,l,a,u].filter(Boolean).join(` `)}function M5(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function GK(e={},t={}){let o={...e};return Object.entries(t).forEach(([r,n])=>{o[r]=M5(n)&&M5(o[r])?GK(o[r],n):n}),o}function L5(e,t,o){let r=t||"",n=e.get(r)||{selector:t,style:{}};e.set(r,{selector:t,style:GK(n.style,o)})}function TJe(e,t){let o=(0,Lc.getBlockType)(t)?.selectors||{},r=new Map;return Object.entries(e||{}).forEach(([n,i])=>{let s=o[n];if(typeof s=="string"){L5(r,s,{[n]:i});return}if(M5(s)&&M5(i)){let a={...i};Object.entries(s).forEach(([l,u])=>{l==="root"||typeof u!="string"||!Object.hasOwn(i,l)||(L5(r,u,{[n]:{[l]:i[l]}}),delete a[l])}),Object.keys(a).length&&L5(r,s.root||o.root,{[n]:a});return}L5(r,o.root,{[n]:i})}),Array.from(r.values())}function WK(e,t){let{name:o,baseSelector:r,state:n=""}=t,i=TJe(e,o).map(({selector:s,style:a})=>EJe(a,hPe(r,s,n))).filter(Boolean);return i.length?i.join(` `):void 0}function RJe(e,t){if(!e)return e;let o={...e};return t.forEach(r=>{delete o[r]}),o}function SPe(e,t,o){let r=gV[t];if(!r)return[];let n=[];return r.forEach(i=>{let s=e?.[i];if(s){let a=WK(s,{name:t,baseSelector:o,state:i});a&&n.push(a)}}),n}function BJe(e,t,o,r){let n=[],s=["elements",...gV[t]??[]],a=vJe(r);return Object.entries(a).forEach(([l,u])=>{let d=To(e,{viewport:l,pseudo:Js.pseudo});if(!d)return;let f=[],p=WK(RJe(d,s),{name:t,baseSelector:o});p&&f.push(p);let h=xPe(d.elements,t,o);h&&f.push(h),f.push(...SPe(d,t,o)),f.length&&n.push(`${u}{${f.join("")}}`)}),n}function gPe(e,t){let o=To(e,t);if(!Hi(t))return o;let r={...t,viewport:Js.viewport},n=To(e,r);return n&&o?yB(n,o):o||n}function PJe(e){return!UK(e)&&!(0,Lc.hasBlockSupport)(e,"customCSS",!0)||e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e}var kPe={[`${yy}.__experimentalSkipSerialization`]:["border"],[`${Mn}.__experimentalSkipSerialization`]:[Mn],[`${wl}.__experimentalSkipSerialization`]:[wl],[`${Ju}.__experimentalSkipSerialization`]:[Ju],[`${M1}.__experimentalSkipSerialization`]:[M1],[`${d1}.__experimentalSkipSerialization`]:[d1]},IJe={...kPe,[`${Ju}.aspectRatio`]:[`${Ju}.aspectRatio`],[`${Sy}`]:[Sy]},OJe={[`${Ju}.aspectRatio`]:!0,[`${Sy}`]:!0},AJe={gradients:"gradient"};function jK(e,t,o=!1){if(!e)return e;let r=e;return o||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach(n=>{if(Array.isArray(n)||(n=n.split(".")),n.length>1){let[i,...s]=n;jK(r[i],[s],!0)}else n.length===1&&delete r[n[0]]}),r}function _Pe(e,t,o,r=IJe){if(!UK(t))return e;let{style:n}=o;return Object.entries(r).forEach(([i,s])=>{let a=OJe[i]||(0,Lc.getBlockSupport)(t,i);a===!0&&(n=jK(n,s)),Array.isArray(a)&&a.forEach(l=>{let u=AJe[l]||l;n=jK(n,[[...s,u]])})}),e.style={...ga(n),...e.style},e}function LJe({clientId:e,name:t,setAttributes:o,style:r,__unstableParentLayout:n}){let i=xl(t,n),s=Er(),{globalBlockStyles:a,selectedState:l,showStateOnCanvas:u}=(0,yPe.useSelect)(m=>{let g=m(C),{getSelectedBlockStyleState:b,isSelectedBlockStyleStateShownOnCanvas:v}=H(g);return{globalBlockStyles:g.getSettings()?.[rs]?.blocks?.[t],selectedState:b(e),showStateOnCanvas:v(e)}},[e,t]),d=ea(l),f=(0,HK.useMemo)(()=>{if(!u||!d)return;let m=gPe(a,l),g=gPe(r,l),b;if(m&&g)b=yB(m,g);else if(g)b=g;else if(m)b=m;else return;return WK(b,{name:t,baseSelector:`[data-block="${e}"]`})},[u,d,a,r,l,e,t]);if(el({css:f}),s!=="default")return null;let p={...i,typography:{...i.typography,textAlign:!1}},h={clientId:e,name:t,setAttributes:o,settings:p};return(0,Vh.jsxs)(q2,{value:l,children:[(0,Vh.jsx)(eV,{...h}),(0,Vh.jsx)(ZD,{...h}),(0,Vh.jsx)(lV,{...h}),(0,Vh.jsx)(oEe,{...h}),(0,Vh.jsx)(fPe,{...h})]})}var N5={edit:LJe,hasSupport:UK,addSaveProps:_Pe,attributeKeys:["style"],useBlockProps:DJe},MJe=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],NJe={};function xPe(e,t,o){if(!e)return;let r=[];return MJe.forEach(({elementType:n,pseudo:i,elements:s})=>{if($t(t,Mn,n))return;let l=e?.[n];if(l){let u=yk(o,Lc.__EXPERIMENTAL_ELEMENTS[n]);r.push((0,ed.compileCSS)(l,{selector:u})),i&&i.forEach(d=>{l[d]&&r.push((0,ed.compileCSS)(l[d],{selector:yk(o,`${Lc.__EXPERIMENTAL_ELEMENTS[n]}${d}`)}))})}s&&s.forEach(u=>{e[u]&&r.push((0,ed.compileCSS)(e[u],{selector:yk(o,Lc.__EXPERIMENTAL_ELEMENTS[u])}))})}),r.length>0?r.join(""):void 0}function DJe({name:e,style:t}){let o=(0,vPe.useInstanceId)(NJe,"wp-elements"),r=`.${o}`,n=t?.elements,[i]=Le("viewport"),s=(0,HK.useMemo)(()=>{let a=[],l=xPe(n,e,r);return l&&a.push(l),a.push(...SPe(t,e,r)),a.push(...BJe(t,e,r,i)),a.length>0?a.join(""):void 0},[r,n,e,t,i]);return el({css:s}),_Pe({className:o},e,{style:t},kPe)}(0,bPe.addFilter)("blocks.registerBlockType","core/style/addAttribute",PJe);var wPe=c(go(),1),CPe=c(ue(),1),VJe=e=>(0,CPe.hasBlockSupport)(e,"__experimentalSettings",!1);function FJe(e){return VJe(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}(0,wPe.addFilter)("blocks.registerBlockType","core/settings/addAttribute",FJe);var Fh=c(ue(),1),RPe=c(fe(),1),BPe=c(go(),1),N1=c(F(),1),PPe=c(Q(),1);function zJe(e=[]){let t={r:[],g:[],b:[],a:[]};return e.forEach(o=>{let r=Lo(o).toRgb();t.r.push(r.r/255),t.g.push(r.g/255),t.b.push(r.b/255),t.a.push(r.a)}),t}function EPe(e){return`${e}{filter:none}`}function TPe(e,t){return`${e}{filter:url(#${t})}`}function D5(e,t){let o=zJe(t);return` `}var jf=c(E(),1),$K=[],jJe=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Yf([qf]);function KK({presetSetting:e,defaultSetting:t}){let[o,r,n,i]=Le(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,N1.useMemo)(()=>[...r||$K,...n||$K,...o&&i||$K],[o,r,n,i])}function IPe(e,t){if(!e)return;let o=t?.find(({slug:r})=>e===`var:preset|duotone|${r}`);return o?o.colors:void 0}function HJe(e,t){if(!e||!Array.isArray(e))return;let o=t?.find(r=>r?.colors?.every((n,i)=>n===e[i]));return o?`var:preset|duotone|${o.slug}`:void 0}function UJe({style:e,setAttributes:t,name:o,clientId:r}){let n=e?.color?.duotone,i=xl(o),s=Er(),a=(0,PPe.useSelect)(b=>r?b(C).getBlockAttributes(r)?.className:void 0,[r]),{value:l}=_l(o,a),u=KK({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),d=KK({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[f,p]=Le("color.custom","color.customDuotone"),h=!f,m=!p||d?.length===0&&h;if(u?.length===0&&m||s!=="default")return null;let g=n==="unset"||Array.isArray(n)?n:IPe(n,u);return(0,jf.jsxs)(jf.Fragment,{children:[(0,jf.jsx)(Oe,{group:"filter",children:(0,jf.jsx)(AD,{value:{filter:{duotone:g}},onChange:b=>{let v={...e,color:{...b?.filter}};t({style:Ge(v)})},settings:i,inheritedValue:l})}),(0,jf.jsx)(No,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,jf.jsx)(HM,{duotonePalette:u,colorPalette:d,disableCustomDuotone:m,disableCustomColors:h,value:g,onChange:b=>{let v=HJe(b,u),y={...e,color:{...e?.color,duotone:v??b}};t({style:Ge(y)})},settings:i})})]})}var YK={shareWithChildBlocks:!0,edit:UJe,useBlockProps:KJe,attributeKeys:["style"],hasSupport(e){return(0,Fh.hasBlockSupport)(e,"filter.duotone")}};function GJe(e){return(0,Fh.hasBlockSupport)(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function WJe({clientId:e,id:t,selector:o,attribute:r}){let n=KK({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:IPe(r,n),a=typeof r=="string"&&s,l=typeof r=="string"&&!a,u=null;a?u=s:(l||i)&&(u=r);let p=o.split(",").map(g=>`.${t}${g.trim()}`).join(", "),h=Array.isArray(u)||u==="unset";Rc(h?{css:u!=="unset"?TPe(p,t):EPe(p),__unstableType:"presets"}:void 0),Rc(h?{assets:u!=="unset"?D5(t,u):"",__unstableType:"svgs"}:void 0);let m=Nt(e);(0,N1.useEffect)(()=>{if(h&&m&&jJe){let g=m.style.display;m.style.setProperty("display","inline-block"),m.offsetHeight,m.style.setProperty("display",g)}},[h,m,u])}var $Je={};function KJe({clientId:e,name:t,style:o}){let r=(0,RPe.useInstanceId)($Je),n=(0,N1.useMemo)(()=>{let l=(0,Fh.getBlockType)(t);if(l){if(!(0,Fh.getBlockSupport)(l,"filter.duotone",!1))return null;let d=(0,Fh.getBlockSupport)(l,"color.__experimentalDuotone",!1);if(d){let f=js(l);return typeof d=="string"?yk(f,d):f}return js(l,"filter.duotone",{fallback:!0})}},[t]),i=o?.color?.duotone,s=`wp-duotone-${r}`,a=n&&i;return WJe({clientId:e,id:s,selector:n,attribute:i}),{className:a?s:""}}(0,BPe.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",GJe);var F5=c(F(),1),D1=c(Q(),1),OPe=c(fe(),1),V1=c(ue(),1),F1=c(G(),1);var APe=c(as(),1);var V5=c(E(),1),YJe={},qJe={};function ZJe({blockName:e,setAttributes:t,style:o}){if(Er()!=="default")return null;let n=(0,V1.getBlockType)(e);function i(a){let l=a?.css?.trim()?a.css:void 0;t({style:Ge({...a,css:l})})}let s=(0,F1.sprintf)((0,F1.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),n?.title);return(0,V5.jsx)(Oe,{group:"advanced",children:(0,V5.jsx)(ND,{value:o,onChange:i,inheritedValue:o,help:s})})}var XJe="custom-css-edit-warning";function QJe({clientId:e,name:t,setAttributes:o}){let{style:r,canEditCSS:n}=(0,D1.useSelect)(i=>{let{getBlockAttributes:s,getSettings:a}=i(C);return{style:s(e)?.style||qJe,canEditCSS:a().canEditCSS}},[e]);return n?(0,V5.jsx)(ZJe,{blockName:t,setAttributes:o,style:r}):null}function JJe({style:e,clientId:t}){let o=e?.css,r=typeof o=="string"&&o.trim().length>0&&r$(o),n=(0,D1.useSelect)(d=>d(C).getSettings().canEditCSS,[]),{createWarningNotice:i}=(0,D1.useDispatch)(APe.store),s=!!o?.trim();(0,F5.useEffect)(()=>{!n&&s&&i((0,F1.__)("This post contains blocks with custom CSS. You do not have permission to edit CSS. If you save this post, the custom CSS will be removed."),{id:XJe,isDismissible:!0})},[n,s,i]);let a=(0,OPe.useInstanceId)(YJe,"wp-custom-css"),l=`.${a}`,u=(0,F5.useMemo)(()=>{if(r)return xB(o,l)},[o,l,r]);return Rc({css:u,clientId:t,__unstableType:"custom-css"}),r?{className:`has-custom-css ${a}`}:{}}function eet(e,t,o){if(!(0,V1.hasBlockSupport)(t,"customCSS",!0)||!o?.style?.css?.trim())return e;let r=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:r}}var z5={edit:QJe,useBlockProps:JJe,addSaveProps:eet,attributeKeys:["style"],hasSupport(e){return(0,V1.hasBlockSupport)(e,"customCSS",!0)}};var H5=c(fe(),1),XK=c(go(),1),MPe=c(F(),1),Mc=c(ue(),1);var U5=c(Q(),1),Nc=c(U(),1),Ly=c(G(),1);var Dn=c(E(),1),tet="is-style-",j5="layout",qK=["selfStretch","flexSize","columnStart","columnSpan","rowStart","rowSpan"],{kebabCase:ZK}=H(Nc.privateApis),{getResponsiveMediaQueries:oet}=H(Sr);function ret(e={},t){let o=e?.default;return t?.attributes?.layout??o}function LPe(e={},t){return Ge({...ret(e,t)})}function net(e={},t={},o={}){let r={},n=Object.fromEntries(qK.filter(i=>Object.hasOwn(o||{},i)).map(i=>[i,o[i]]));return Object.entries(e||{}).forEach(([i,s])=>{let a=Object.hasOwn(t||{},i);!qK.includes(i)&&s!==t?.[i]&&(r[i]=s===void 0&&a?null:s)}),Ge({...n,...r})}function iet(e={}){return Object.fromEntries(Object.entries(e||{}).filter(([t])=>!qK.includes(t)))}function QK(e){return(0,Mc.hasBlockSupport)(e,"layout")||(0,Mc.hasBlockSupport)(e,"__experimentalLayout")}function G5(e={},t=""){let{layout:o}=e,{default:r}=(0,Mc.getBlockSupport)(t,j5)||{},n=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(Gs[n?.type||"default"]?.className){let a=Gs[n?.type||"default"]?.className,l=t.split("/"),d=`wp-block-${l[0]==="core"?l.pop():l.join("-")}-${a}`;i.push(a,d)}return(0,U5.useSelect)(a=>!n?.inherit&&!n?.contentSize&&n?.type!=="constrained"?!1:a(C).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[n?.contentSize,n?.inherit,n?.type])&&i.push("has-global-padding"),n?.orientation&&i.push(`is-${ZK(n.orientation)}`),n?.justifyContent&&i.push(`is-content-justification-${ZK(n.justifyContent)}`),n?.flexWrap&&n.flexWrap==="nowrap"&&i.push("is-nowrap"),i}function JK(e={},t,o){let{layout:r={},style:n={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=Ba(i?.type||"default"),[a]=Le("spacing.blockGap"),l=a!==null;return s?.getLayoutStyle?.({blockName:t,selector:o,layout:r,style:n,hasBlockGapSupport:l})}function set({attributes:e={},blockName:t,selector:o,layout:r={},hasBlockGapSupport:n,globalBlockGapValue:i,viewportSettings:s}){return Object.entries(oet(s)).map(([a,l])=>{let u=To(e?.style,{viewport:a,pseudo:Js.pseudo}),d=iet(u?.layout),f=Object.keys(d).length>0,p=u?.spacing&&Object.hasOwn(u.spacing,"blockGap"),h=u?.spacing&&Object.hasOwn(u.spacing,"padding");if(!f&&!p&&!h)return"";let g=Ba(r?.type||"default")?.getLayoutStyle?.({blockName:t,selector:o,layout:r,viewportOverrides:d,style:u,hasBlockGapSupport:n,globalBlockGapValue:i});return g?`${l}{${g}}`:""}).filter(Boolean).join("")}function aet({layout:e,style:t,setAttributes:o,name:r,clientId:n}){let i=xl(r),{layout:s}=i,{themeSupportsLayout:a,activeBlockVariation:l,selectedState:u,isResponsiveEditing:d}=(0,U5.useSelect)(Y=>{let{getBlockAttributes:Z,getSettings:oe,getSelectedBlockStyleState:ne,isResponsiveEditing:X}=H(Y(C));return{activeBlockVariation:Y(Mc.store).getActiveBlockVariation(r,Z(n)||{},"block"),themeSupportsLayout:oe().supportsLayout,selectedState:ne(n),isResponsiveEditing:X()}},[r,n]),f=Er(),p=Hi(u)&&!ea(u),h=(0,MPe.useCallback)((...Y)=>{let Z=Y[0]||{},oe=Y[1]||{};if(p){let re=To(Z.style??t,u)||{},ae=Ge({...re,layout:void 0});return{style:Pn(Z.style??t,u,ae)}}let ne=oe.name||r,X=(0,Mc.getBlockSupport)(ne,j5,{});return{layout:LPe(X,l)}},[r,l,p,u,t]);if(f!=="default")return null;let m=(0,Mc.getBlockSupport)(r,j5,{}),g={...s,...m},{allowSwitching:b,allowEditing:v=!0,allowInheriting:y=!0,default:k}=g;if(!v)return null;let S=e||k||{},_=p?To(t,u):void 0,x=_?.layout,w=p?Ge({...S,...x})||{}:S,T=p?S:LPe(m,l),B={...m,...w},{type:R,default:{type:I="default"}={}}=B,A=R||I,P=!!(y&&(!A||A==="default"||A==="constrained"||B.inherit)),{inherit:O=!1,contentSize:N=null}=w;if((A==="default"||A==="constrained")&&!a)return null;let z=Ba(A),V=Ba("constrained"),M=!w.type&&(N||O),D=!!O||!!N,L=Bn(u)&&!O&&b,j=Y=>{if(p){let Z=Ge({..._,layout:net(Y,S,_?.layout)});o({style:Pn(t,u,Z)});return}o({layout:Ge(Y)})},q=Y=>j({type:Y}),J=()=>j(T),te=()=>j({type:"default"}),ee=()=>z?.name==="constrained"||D,$=()=>p?(w?.type??"default")!==(T?.type??"default"):e?.type==="constrained",W=()=>(w?.type??"default")!==(T?.type??"default");return(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsxs)(Oe,{group:"layout",resetAllFilter:h,children:[P&&(0,Dn.jsx)(Nc.__experimentalToolsPanelItem,{label:(0,Ly.__)("Use content width"),hasValue:$,onDeselect:te,isShownByDefault:!0,panelId:n,children:(0,Dn.jsx)(Nc.ToggleControl,{label:(0,Ly.__)("Inner blocks use content width"),checked:ee(),onChange:()=>j({type:ee()?"default":"constrained"}),help:ee()?(0,Ly.__)("Nested blocks use content width with options for full and wide widths."):(0,Ly.__)("Nested blocks will fill the width of this container.")})}),L&&(0,Dn.jsx)(Nc.__experimentalToolsPanelItem,{label:(0,Ly.__)("Layout type"),hasValue:W,onDeselect:J,isShownByDefault:!0,panelId:n,children:(0,Dn.jsx)(cet,{type:A,onChange:q})}),z&&z.name!=="default"&&(0,Dn.jsx)(z.inspectorControls,{layout:w,value:e,onChange:j,layoutBlockSupport:g,resetLayout:T,name:r,clientId:n}),V&&M&&(0,Dn.jsx)(V.inspectorControls,{layout:w,value:e,onChange:j,layoutBlockSupport:g,resetLayout:T,name:r,clientId:n})]}),!O&&z&&(0,Dn.jsx)(z.toolBarControls,{layout:w,onChange:j,layoutBlockSupport:m,controlsGroup:d&&Hi(u)&&!ea(u)?"style-state":"block",name:r,clientId:n})]})}var NPe={shareWithChildBlocks:!0,edit:aet,attributeKeys:["layout","style"],hasSupport(e){return QK(e)}};function cet({type:e,onChange:t}){return(0,Dn.jsx)(Nc.__experimentalToggleGroupControl,{isBlock:!0,label:(0,Ly.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:lQ().map(({name:o,label:r})=>(0,Dn.jsx)(Nc.__experimentalToggleGroupControlOption,{value:o,label:r},o))})}function uet(e){return"type"in(e.attributes?.layout??{})||QK(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function det({block:e,props:t,blockGapSupport:o,globalBlockGapValue:r,viewportSettings:n,layoutClasses:i}){let{name:s,attributes:a}=t,l=(0,H5.useInstanceId)(e),{layout:u}=a,{default:d}=(0,Mc.getBlockSupport)(s,j5)||{},f=u?.inherit||u?.contentSize||u?.wideSize?{...u,type:"constrained"}:u||d||{},p=`wp-container-${ZK(s)}-is-layout-`,h=`.${p}${l}`,m=o!==null,b=Ba(f?.type||"default")?.getLayoutStyle?.({blockName:s,selector:h,layout:f,style:a?.style,hasBlockGapSupport:m,globalBlockGapValue:r}),v=set({attributes:a,blockName:s,selector:h,layout:f,hasBlockGapSupport:m,globalBlockGapValue:r,viewportSettings:n}),y=[b,v].filter(Boolean).join(""),k=K({[`${p}${l}`]:!!y},i);return el({css:y}),(0,Dn.jsx)(e,{...t,__unstableLayoutClassNames:k})}var fet=(0,H5.createHigherOrderComponent)(e=>function(o){let{clientId:r,name:n,attributes:i}=o,s=QK(n),a=G5(i,n),l=(0,U5.useSelect)(u=>{if(!s)return;let{getSettings:d,getBlockSettings:f}=H(u(C)),p=d(),{disableLayoutStyles:h}=p;if(h)return;let[m]=f(r,"spacing.blockGap"),g=p[rs],b,v=i?.className;if(v?.includes(tet)){let{getBlockStyles:k}=u(Mc.store),S=k(n),_=l1(v,S);b=_?g?.blocks?.[n]?.variations?.[_]?.spacing?.blockGap:void 0}let y=b??g?.blocks?.[n]?.spacing?.blockGap??g?.spacing?.blockGap;return{blockGapSupport:m,globalBlockGapValue:y,viewportSettings:p?.__experimentalFeatures?.viewport}},[s,r,i?.className,n]);return l?(0,Dn.jsx)(det,{block:e,props:o,layoutClasses:a,...l}):(0,Dn.jsx)(e,{...o,__unstableLayoutClassNames:s?a:void 0})},"withLayoutStyles");(0,XK.addFilter)("blocks.registerBlockType","core/layout/addAttribute",uet);(0,XK.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",fet);var WPe=c(fe(),1),q5=c(Q(),1),$Pe=c(F(),1);var Pl=c(F(),1),zh=c(Q(),1),VPe=c(fe(),1);function j1(e,t){return Array.from({length:t},(o,r)=>e+r)}var Dc=class{constructor({columnStart:e,rowStart:t,columnEnd:o,rowEnd:r,columnSpan:n,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,n!==void 0?this.columnEnd=this.columnStart+n-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Xr(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function z1(e,t){let o=[];for(let r of e.split(" ")){let n=o[o.length-1],i=n?n.end+t:0,s=i+parseFloat(r);o.push({start:i,end:s})}return o}function Hf(e,t,o="start"){return e.reduce((r,n,i)=>Math.abs(n[o]-t)a(C).getSettings().isDistractionFree,[]),i=Nt(e);if(n||!i)return null;let s=o?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,ba.jsx)(met,{gridClientId:e,gridElement:i,isManualGrid:s,ref:t,childGridClientId:r})}var met=(0,Pl.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:o,childGridClientId:r},n)=>{let[i,s]=(0,Pl.useState)(()=>eY(t)),[a,l]=(0,Pl.useState)(!1),u=Nt(r),d=(0,Pl.useMemo)(()=>u?DPe(u):null,[u]);return(0,Pl.useEffect)(()=>{let f=()=>s(eY(t)),p=new window.ResizeObserver(f);p.observe(t,{box:"border-box"});let h=new window.ResizeObserver(f);h.observe(t);for(let m of t.children)h.observe(m);return()=>{p.disconnect(),h.disconnect()}},[t]),(0,Pl.useEffect)(()=>{function f(){l(!0)}function p(){l(!1)}return document.addEventListener("drag",f),document.addEventListener("dragend",p),()=>{document.removeEventListener("drag",f),document.removeEventListener("dragend",p)}},[]),(0,ba.jsx)(Xa,{className:K("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,ba.jsx)("div",{ref:n,className:"block-editor-grid-visualizer__grid",style:i.style,children:o?(0,ba.jsx)(get,{gridClientId:e,gridInfo:i,childGridRect:d}):(0,ba.jsx)(het,{gridInfo:i,childGridRect:d})})})});function het({gridInfo:e,childGridRect:t}){return j1(1,e.numRows).map(o=>j1(1,e.numColumns).map(r=>{let n=e.currentColor;return t?.contains(r,o)&&(n="transparent"),(0,ba.jsx)(FPe,{color:n},`${o}-${r}`)}))}function get({gridClientId:e,gridInfo:t,childGridRect:o}){let[r,n]=(0,Pl.useState)(null),i=(0,zh.useSelect)(a=>{let{getBlockOrder:l,getBlockStyles:u}=H(a(C)),d=l(e);return u(d)},[e]),s=(0,Pl.useMemo)(()=>{let a=[];for(let l of Object.values(i)){let{columnStart:u,rowStart:d,columnSpan:f=1,rowSpan:p=1}=l?.layout??{};!u||!d||a.push(new Dc({columnStart:u,rowStart:d,columnSpan:f,rowSpan:p}))}return a},[i]);return j1(1,t.numRows).map(a=>j1(1,t.numColumns).map(l=>{let u=o?.contains(l,a),d=t.currentColor;u&&(d="transparent");let f=s.some(h=>h.contains(l,a)),p=r?.contains(l,a)??!1;return(0,ba.jsx)(FPe,{color:d,className:p&&"is-highlighted",children:f&&!u?(0,ba.jsx)(bet,{column:l,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n}):(0,ba.jsx)(yet,{column:l,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n})},`${a}-${l}`)}))}function FPe({color:e,children:t,className:o}){return(0,ba.jsx)("div",{className:K("block-editor-grid-visualizer__cell",o),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function zPe(e,t,o,r,n){let{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:l}=(0,zh.useSelect)(C),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:f}=(0,zh.useDispatch)(C),p=py(o,r.numColumns);return vet({validateDrag(h){let m=l(h);if(!a(m,o))return!1;let g=i(h),b=new Dc({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new Dc({columnSpan:r.numColumns,rowSpan:r.numRows}).containsRect(b)},onDragEnter(h){let m=i(h);n(new Dc({columnStart:e,rowStart:t,columnSpan:m.style?.layout?.columnSpan,rowSpan:m.style?.layout?.rowSpan}))},onDragLeave(){n(h=>h?.columnStart===e&&h?.rowStart===t?null:h)},onDrop(h){n(null);let m=i(h);u(h,{style:{...m.style,layout:{...m.style?.layout,columnStart:e,rowStart:t}}}),f(),d([h],s(h),o,p(e,t))}})}function bet({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){return(0,ba.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:zPe(e,t,o,r,n)})}function yet({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){let{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,zh.useDispatch)(C),l=py(o,r.numColumns);return(0,ba.jsx)(Sm,{rootClientId:o,className:"block-editor-grid-visualizer__appender",ref:zPe(e,t,o,r,n),style:{color:r.currentColor},onSelect:u=>{u&&(i(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([u.clientId],o,o,l(e,t)))}})}function vet({validateDrag:e,onDragEnter:t,onDragLeave:o,onDrop:r}){let{getDraggedBlockClientIds:n}=(0,zh.useSelect)(C);return(0,VPe.__experimentalUseDropZone)({onDragEnter(){let[i]=n();i&&e(i)&&t(i)},onDragLeave(){o()},onDrop(){let[i]=n();i&&e(i)&&r(i)}})}var jPe=c(U(),1),U1=c(F(),1);var W5=c(E(),1);function tY({clientId:e,bounds:t,onChange:o,parentLayout:r}){let n=Nt(e),i=n?.parentElement,{isManualPlacement:s}=r;return!n||!i?null:(0,W5.jsx)(ket,{clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:o,isManualGrid:s&&window.__experimentalEnableGridInteractivity})}function ket({clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n,isManualGrid:i}){let[s,a]=(0,U1.useState)(null),[l,u]=(0,U1.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,U1.useEffect)(()=>{let h=new window.ResizeObserver(()=>{let m=o.getBoundingClientRect(),g=r.getBoundingClientRect(),b=m.top>g.top,v=m.bottomg.left,k=m.righth.disconnect()},[o,r,i]);let d={right:"left",left:"right"},f={top:"flex-end",bottom:"flex-start"},p={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...f[s]&&{alignItems:f[s]}};return(0,W5.jsx)(Xa,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:p,children:(0,W5.jsx)(jPe.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:l.bottom,bottomLeft:!1,bottomRight:!1,left:l.left,right:l.right,top:l.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:h,pointerId:m})=>{h.setPointerCapture(m)},onResizeStart:(h,m)=>{a(m)},onResizeStop:(h,m,g)=>{let b=parseFloat(Xr(r,"column-gap")),v=parseFloat(Xr(r,"row-gap")),y=z1(Xr(r,"grid-template-columns"),b),k=z1(Xr(r,"grid-template-rows"),v),S=new window.DOMRect(o.offsetLeft+g.offsetLeft,o.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),_=Hf(y,S.left)+1,x=Hf(k,S.top)+1,w=Hf(y,S.right,"end")+1,T=Hf(k,S.bottom,"end")+1;n({columnSpan:w-_+1,rowSpan:T-x+1,columnStart:i?_:void 0,rowStart:i?x:void 0})}})})}var Il=c(G(),1),$5=c(U(),1);var HPe=c(Q(),1),UPe=c(fe(),1);var Ei=c(E(),1);function oY({layout:e,parentLayout:t,onChange:o,gridClientId:r,blockClientId:n}){let{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,HPe.useDispatch)(C),a=e?.columnStart??1,l=e?.rowStart??1,u=e?.columnSpan??1,d=e?.rowSpan??1,f=a+u-1,p=l+d-1,h=t?.columnCount,m=t?.rowCount,g=py(r,h);return(0,Ei.jsx)(No,{group:"parent",children:(0,Ei.jsxs)($5.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Ei.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Ei.jsx)(G1,{icon:(0,Il.isRTL)()?un:Ti,label:(0,Il.__)("Move left"),description:(0,Il.__)("Move left"),isDisabled:a<=1,onClick:()=>{o({columnStart:a-1}),s(),i([n],r,r,g(a-1,l))}})}),(0,Ei.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Ei.jsx)(G1,{className:"is-up-button",icon:eg,label:(0,Il.__)("Move up"),description:(0,Il.__)("Move up"),isDisabled:l<=1,onClick:()=>{o({rowStart:l-1}),s(),i([n],r,r,g(a,l-1))}}),(0,Ei.jsx)(G1,{className:"is-down-button",icon:cn,label:(0,Il.__)("Move down"),description:(0,Il.__)("Move down"),isDisabled:m&&p>=m,onClick:()=>{o({rowStart:l+1}),s(),i([n],r,r,g(a,l+1))}})]}),(0,Ei.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Ei.jsx)(G1,{icon:(0,Il.isRTL)()?Ti:un,label:(0,Il.__)("Move right"),description:(0,Il.__)("Move right"),isDisabled:h&&f>=h,onClick:()=>{o({columnStart:a+1}),s(),i([n],r,r,g(a+1,l))}})})]})})}function G1({className:e,icon:t,label:o,isDisabled:r,onClick:n,description:i}){let a=`block-editor-grid-item-mover-button__description-${(0,UPe.useInstanceId)(G1)}`;return(0,Ei.jsxs)(Ei.Fragment,{children:[(0,Ei.jsx)($5.ToolbarButton,{className:K("block-editor-grid-item-mover-button",e),icon:t,label:o,"aria-describedby":a,onClick:r?null:n,disabled:r,accessibleWhenDisabled:!0}),(0,Ei.jsx)(bt,{id:a,children:i})]})}var W1=c(Q(),1),Y5=c(F(),1),K5=c(fe(),1);function rY({clientId:e}){let{gridLayout:t,blockOrder:o,selectedBlockLayout:r}=(0,W1.useSelect)(p=>{let{getBlockAttributes:h,getBlockOrder:m}=p(C),g=p(C).getSelectedBlock();return{gridLayout:h(e).layout??{},blockOrder:m(e),selectedBlockLayout:g?.attributes.style?.layout}},[e]),{getBlockAttributes:n,getBlockRootClientId:i}=(0,W1.useSelect)(C),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,W1.useDispatch)(C),l=(0,Y5.useMemo)(()=>r?new Dc(r):null,[r]),u=(0,K5.usePrevious)(l),d=(0,K5.usePrevious)(t.isManualPlacement),f=(0,K5.usePrevious)(o);(0,Y5.useEffect)(()=>{let p={};if(t.isManualPlacement){let h=[];for(let g of o){let{columnStart:b,rowStart:v,columnSpan:y=1,rowSpan:k=1}=n(g).style?.layout??{};!b||!v||h.push(new Dc({columnStart:b,rowStart:v,columnSpan:y,rowSpan:k}))}for(let g of o){let b=n(g),{columnStart:v,rowStart:y,columnSpan:k=1,rowSpan:S=1}=b.style?.layout??{};if(v&&y)continue;let[_,x]=_et(h,t.columnCount,k,S,u?.columnEnd,u?.rowEnd);h.push(new Dc({columnStart:_,rowStart:x,columnSpan:k,rowSpan:S})),p[g]={style:{...b.style,layout:{...b.style?.layout,columnStart:_,rowStart:x}}}}let m=Math.max(...h.map(g=>g.rowEnd));(!t.rowCount||t.rowCountu.intersectsRect(l)))return[a,s]}}var Uf=c(E(),1),{getResponsiveMediaQueries:xet}=H(Sr),wet={},jh={fit:"fit",grow:"fill",max:"fixed",fixed:"fixedNoShrink"},Cet=[jh.max,jh.fixed];function GPe(e){return Cet.includes(e)}function KPe({selector:e,declarations:t}){return`${e} { ${Object.entries(t).map(([o,r])=>`${o}: ${r}`).join("; ")}; }`}function YPe({selector:e,layout:t={},viewportOverrides:o,parentLayout:r={},includeContainerQuery:n=!0}){let i=o!==void 0,s=i?{...t,...o}:t,a=k=>Object.hasOwn(o||{},k),{selfStretch:l,flexSize:u,columnStart:d,rowStart:f,columnSpan:p,rowSpan:h}=s,m=t.selfStretch,{columnCount:g,minimumColumnWidth:b}=r,v=[],y={};if((!i||a("selfStretch")||a("flexSize"))&&(i&&(l===jh.fit||l===jh.grow)&&GPe(m)&&t.flexSize&&(y["flex-basis"]="unset",m===jh.fixed&&(y["flex-shrink"]="unset")),GPe(l)&&u?(y["flex-basis"]=u,l===jh.fixed?y["flex-shrink"]="0":i&&m===jh.fixed&&(y["flex-shrink"]="unset"),y["box-sizing"]="border-box"):l===jh.grow&&(y["flex-grow"]="1")),(!i||a("columnStart")||a("columnSpan"))&&(d&&p?y["grid-column"]=`${d} / span ${p}`:d?y["grid-column"]=`${d}`:p&&(y["grid-column"]=`span ${p}`)),(!i||a("rowStart")||a("rowSpan"))&&(f&&h?y["grid-row"]=`${f} / span ${h}`:f?y["grid-row"]=`${f}`:h&&(y["grid-row"]=`span ${h}`)),Object.keys(y).length&&v.push({selector:e,declarations:y}),n&&!i&&(p||d)&&(b||!g)){let k=parseFloat(b);isNaN(k)&&(k=12);let S=b?.replace(k,"");["px","rem","em"].includes(S)||(S="rem");let _=2;p&&d?_=p+d-1:p?_=p:_=d;let x=S==="px"?24:1.5,w=_*k+(_-1)*x,T=k*2+x-1,B=p&&p>1?"1/-1":"auto";v.push({rulesGroup:`@container (max-width: ${Math.max(w,T)}${S})`,selector:e,declarations:{"grid-column":B,"grid-row":"auto"}})}return v}function Eet({selector:e,layout:t={},parentLayout:o={},includeContainerQuery:r=!0}){return YPe({selector:e,layout:t,parentLayout:o,includeContainerQuery:r}).map(n=>{let i=KPe(n);return n.rulesGroup?`${n.rulesGroup} { ${i} }`:i}).join("")}function Tet({style:e={},selector:t,parentLayout:o={},viewportSettings:r}){let n=e?.layout??{};return Object.entries(xet(r)).map(([i,s])=>{let a=To(e,{viewport:i,pseudo:Js.pseudo})?.layout;if(!a||!Object.keys(a).length)return"";let u=YPe({selector:t,layout:n,viewportOverrides:a,parentLayout:o,includeContainerQuery:!1}).map(KPe).join("");return u?`${s}{${u}}`:""}).filter(Boolean).join("")}function Ret({style:e}){let{shouldRenderChildLayoutStyles:t,viewportSettings:o}=(0,q5.useSelect)(p=>{let h=p(C).getSettings();return{shouldRenderChildLayoutStyles:!h.disableLayoutStyles,viewportSettings:h?.__experimentalFeatures?.viewport}}),r=e?.layout??{},{columnStart:n,rowStart:i,columnSpan:s,rowSpan:a}=r,l=vg()||{},u=(0,WPe.useInstanceId)(wet),d=`.wp-container-content-${u}`,f="";if(t&&(f=[Eet({selector:d,layout:r,parentLayout:l}),Tet({style:e,selector:d,parentLayout:l,viewportSettings:o})].join("")),el({css:f}),!!f)return{className:`wp-container-content-${u}`}}function Bet({clientId:e,style:t,setAttributes:o}){let r=vg()||{},{type:n="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=r;return n!=="grid"?null:(0,Uf.jsx)(Pet,{clientId:e,style:t,setAttributes:o,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:r})}function Pet({clientId:e,style:t,setAttributes:o,allowSizingOnChildren:r,isManualPlacement:n,parentLayout:i}){let{rootClientId:s,isVisible:a,parentBlockVisibility:l,blockBlockVisibility:u,deviceType:d,viewportSettings:f,isChildBlockAGrid:p}=(0,q5.useSelect)(B=>{let{getBlockRootClientId:R,getBlockEditingMode:I,getTemplateLock:A,getBlockAttributes:P,getSettings:O}=B(C),N=R(e);if(A(N)||I(N)!=="default")return{rootClientId:N,isVisible:!1};let z=P(N),V=P(e),M=O(),D=M?.[wa]?.toLowerCase()||no.desktop.key;return{rootClientId:N,isVisible:!0,parentBlockVisibility:z?.metadata?.blockVisibility,blockBlockVisibility:V?.metadata?.blockVisibility,deviceType:D,viewportSettings:M?.__experimentalFeatures?.viewport,isChildBlockAGrid:V?.layout?.type==="grid"}},[e]),m=Nt(e)?.ownerDocument?.defaultView,g=m===null?void 0:m,{isBlockCurrentlyHidden:b,currentViewport:v}=Ma({blockVisibility:l,deviceType:d,view:g,viewportSettings:f}),y=(0,q5.useSelect)(B=>{if(!s)return!1;let{isBlockParentHiddenAtViewport:R}=H(B(C));return R(s,v)},[s,v]),{isBlockCurrentlyHidden:k}=Ma({blockVisibility:u,deviceType:d,view:g,viewportSettings:f}),[S,_]=(0,$Pe.useState)(),x=p?e:void 0;if(!a||b||y)return null;let w=r&&!k;function T(B){o({style:{...t,layout:{...t?.layout,...B}}})}return(0,Uf.jsxs)(Uf.Fragment,{children:[(0,Uf.jsx)(H1,{clientId:s,contentRef:_,parentLayout:i,childGridClientId:x}),w&&(0,Uf.jsx)(tY,{clientId:e,bounds:S,onChange:T,parentLayout:i}),n&&window.__experimentalEnableGridInteractivity&&(0,Uf.jsx)(oY,{layout:t?.layout,parentLayout:i,onChange:T,gridClientId:s,blockClientId:e})]})}var nY={useBlockProps:Ret,edit:Bet,attributeKeys:["style"],hasSupport(){return!0}};var sY=c(go(),1),iY=c(ue(),1),qPe="metadata";function Iet(e){return e?.attributes?.[qPe]?.type||(e.attributes={...e.attributes,[qPe]:{type:"object"}}),e}function Oet(e,t,o,r){if(r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length)return e;let n=t[o]?.attributes?.metadata;if(!n)return e;let i={};return n.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=n.noteId),n.name&&!e.attributes?.metadata?.name&&(0,iY.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=n.name),n.blockVisibility!==void 0&&!e.attributes?.metadata?.blockVisibility&&(0,iY.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=n.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}(0,sY.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",Iet);(0,sY.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",Oet);var aY=c(G(),1),Z5=c(F(),1),X5=c(U(),1),Q5=c(ue(),1),vx=c(Q(),1);var Hh=c(E(),1),Aet={};function Let({name:e,clientId:t,metadata:{ignoredHookedBlocks:o=[]}={}}){let r=(0,vx.useSelect)(h=>h(Q5.store).getBlockTypes(),[]),n=(0,Z5.useMemo)(()=>r?.filter(({name:h,blockHooks:m})=>m&&e in m||o.includes(h)),[r,e,o]),i=(0,vx.useSelect)(h=>{let{getBlocks:m,getBlockRootClientId:g,getGlobalBlockCount:b}=h(C),v=g(t),y=n.reduce((k,S)=>{if(b(S.name)===0)return k;let _=S?.blockHooks?.[e],x;switch(_){case"before":case"after":x=m(v);break;case"first_child":case"last_child":x=m(t);break;case void 0:x=[...m(v),...m(t)];break}let w=x?.find(T=>T.name===S.name);return w?{...k,[S.name]:w.clientId}:k},{});return Object.values(y).length>0?y:Aet},[n,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:l}=(0,vx.useSelect)(C),{insertBlock:u,removeBlock:d}=(0,vx.useDispatch)(C);if(!n.length)return null;let f=n.reduce((h,m)=>{let[g]=m.name.split("/");return h[g]||(h[g]=[]),h[g].push(m),h},{}),p=(h,m)=>{let g=s(t),b=a(t),v=l(t);switch(m){case"before":case"after":u(h,m==="after"?g+1:g,v,!1);break;case"first_child":case"last_child":u(h,m==="first_child"?0:b,t,!1);break;case void 0:u(h,g+1,v,!1);break}};return(0,Hh.jsx)(Oe,{children:(0,Hh.jsxs)(X5.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,aY.__)("Plugins"),initialOpen:!0,children:[(0,Hh.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,aY.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(f).map(h=>(0,Hh.jsxs)(Z5.Fragment,{children:[(0,Hh.jsx)("h3",{children:h}),f[h].map(m=>{let g=m.name in i;return(0,Hh.jsx)(X5.ToggleControl,{checked:g,label:m.title,onChange:()=>{if(!g){let b=m.blockHooks[e];p((0,Q5.createBlock)(m.name),b);return}d(i[m.name],!1)}},m.title)})]},h))]})})}var ZPe={edit:Let,attributeKeys:["metadata"],hasSupport(){return!0}};var lY=c(G(),1),XPe=c(ue(),1),Sx=c(U(),1),QPe=c(Q(),1),JPe=c(F(),1),eIe=c(fe(),1);var Uh=c(E(),1),Met=()=>(0,eIe.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},Net=({name:e,metadata:t})=>{let o=(0,JPe.useContext)(_n),{removeAllBlockBindings:r}=yd(),n=Met(),{bindableAttributes:i,hasCompatibleFields:s}=(0,QPe.useSelect)(l=>{let{__experimentalBlockBindingsSupportedAttributes:u}=l(C).getSettings(),{getAllBlockBindingsSources:d,getBlockBindingsSourceFieldsList:f}=H(l(XPe.store));return{bindableAttributes:u?.[e],hasCompatibleFields:Object.values(d()).some(p=>f(p,o)?.length>0)}},[e,o]);if(!i||i.length===0)return null;let{bindings:a}=t||{};return a===void 0&&!s?null:(0,Uh.jsx)(Oe,{group:"bindings",children:(0,Uh.jsxs)(Sx.__experimentalToolsPanel,{label:(0,lY.__)("Attributes"),resetAll:()=>{r()},dropdownMenuProps:n,className:"block-editor-bindings__panel",children:[(0,Uh.jsx)(Sx.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:i.map(l=>(0,Uh.jsx)(Hw,{attribute:l,blockName:e,binding:a?.[l]},l))}),(0,Uh.jsx)(Sx.__experimentalText,{as:"div",variant:"muted",children:(0,Uh.jsx)("p",{children:(0,lY.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},tIe={edit:Net,attributeKeys:["metadata"],hasSupport(e){return!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)}};var oIe=c(G(),1),rIe=c(U(),1),tF=c(Q(),1),oF=c(ue(),1),nIe=c(F(),1);var J5=c(Q(),1);function eF(e){let{isOpened:t,expandRevision:o}=(0,J5.useSelect)(i=>{let{isListViewPanelOpened:s,getListViewExpandRevision:a}=H(i(C));return{isOpened:s(e),expandRevision:a()}},[e]),{__unstableToggleListViewPanel:r}=(0,J5.useDispatch)(C);return{isOpened:t,expandRevision:o,handleToggle:i=>{r(e,i)}}}var kx=c(E(),1),Det="listView";function Vet(e){return(0,oF.hasBlockSupport)(e,Det)}function Fet({clientId:e,name:t}){let{isSelectionWithinCurrentSection:o}=(0,nIe.useContext)(Fn),{isOpened:r,expandRevision:n,handleToggle:i}=eF(e),{openListViewContentPanel:s}=H((0,tF.useDispatch)(C)),{isEnabled:a,hasChildren:l,isNestedListView:u}=(0,tF.useSelect)(h=>{let{getBlockCount:m,getBlockParents:g,shouldRenderBlockListView:b}=H(h(C)),y=g(e,!1).find(k=>b(k));return{isEnabled:b(e),hasChildren:!!m(e),isNestedListView:y}},[e]),f=(0,oF.getBlockType)(t)?.title||t;return!a||u?null:(0,kx.jsx)(Rb,{group:"list",children:(0,kx.jsxs)(rIe.PanelBody,{title:o?f:void 0,opened:r,onToggle:i,children:[!l&&(0,kx.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,oIe.__)("No items yet.")}),(0,kx.jsx)(kE,{rootClientId:e,isExpanded:!0,description:f,showAppender:!0,onSelect:s},`${e}-${n}`)]})})}var iIe={edit:Fet,hasSupport:Vet,attributeKeys:[],supportsPatternEditing:!0};var sIe=c(go(),1),aIe=c(ue(),1);function zet(e){return e.__experimentalLabel||(0,aIe.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(o,{context:r})=>{let{metadata:n}=o;if((r==="list-view"||r==="breadcrumb")&&n?.name)return n.name}),e}(0,sIe.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",zet);var lIe=c(fe(),1),cIe=c(go(),1),cY=c(Q(),1);var Ol=c(E(),1);function jet(e){rY(e)}function Het({clientId:e,layout:t}){let{isVisible:o,blockVisibility:r,deviceType:n,viewportSettings:i}=(0,cY.useSelect)(p=>{let{isBlockSelected:h,hasSelectedInnerBlock:m,isDraggingBlocks:g,getTemplateLock:b,getBlockEditingMode:v,getBlockAttributes:y,getSettings:k}=p(C);if(!g()&&!h(e)||b(e)||v(e)!=="default"||m(e))return{isVisible:!1};let S=y(e),_=k(),x=_?.[wa]?.toLowerCase()||no.desktop.key;return{isVisible:!0,blockVisibility:S?.metadata?.blockVisibility,deviceType:x,viewportSettings:_?.__experimentalFeatures?.viewport}},[e]),a=Nt(e)?.ownerDocument?.defaultView,l=a===null?void 0:a,{isBlockCurrentlyHidden:u,currentViewport:d}=Ma({blockVisibility:r,deviceType:n,view:l,viewportSettings:i}),f=(0,cY.useSelect)(p=>{if(!o)return!1;let{isBlockParentHiddenAtViewport:h}=H(p(C));return h(e,d)},[e,d,o]);return(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)(jet,{clientId:e}),o&&!u&&!f&&(0,Ol.jsx)(H1,{clientId:e,parentLayout:t})]})}var Uet=(0,lIe.createHigherOrderComponent)(e=>function(o){return o.attributes.layout?.type!=="grid"?(0,Ol.jsx)(e,{...o},"edit"):(0,Ol.jsxs)(Ol.Fragment,{children:[(0,Ol.jsx)(Het,{clientId:o.clientId,layout:o.attributes.layout}),(0,Ol.jsx)(e,{...o},"edit")]})},"addGridVisualizerToBlockEdit");(0,cIe.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",Uet);var $1=c(ue(),1),dIe=c(U(),1),fIe=c(Q(),1);var nF=c(F(),1),pIe=c(G(),1);function uIe(e){let t=[],o=[];return Object.entries(e).forEach(([r,n])=>{if(!n.autoGenerateControl)return;let i=Get(r,n);i&&(t.push(i),o.push(r))}),{fields:t,form:{fields:o}}}function Get(e,t){let o=t.type,r={id:e,label:t.label||e,type:o==="string"?"text":o};return t.enum&&Array.isArray(t.enum)&&(r.elements=t.enum.map(n=>({value:n,label:String(n)}))),r}var rF=c(E(),1);function Wet(e){return e?Object.values(e).some(t=>t?.autoGenerateControl):!1}function $et({name:e,clientId:t,setAttributes:o}){let r=Er(),n=(0,nF.useContext)(_n),i=(0,fIe.useSelect)(u=>{let d=u(C).getBlockAttributes(t);if(!d?.metadata?.bindings)return d;let{getBlockBindingsSource:f}=H(u($1.store));return Object.entries(d.metadata.bindings).reduce((p,[h,m])=>{let g=f(m.source);if(!g)return p;let b=g.getValues({select:u,context:n,bindings:{[h]:m}});return{...p,...b}},d)},[n,t]),s=(0,$1.getBlockType)(e),{fields:a,form:l}=(0,nF.useMemo)(()=>s?.attributes?uIe(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return r!=="default"||!a||a.length===0?null:(0,rF.jsx)(Oe,{children:(0,rF.jsx)(dIe.PanelBody,{title:(0,pIe.__)("Settings"),children:(0,rF.jsx)(I1,{data:i,fields:a,form:l,onChange:o})})})}var mIe={edit:$et,attributeKeys:[],hasSupport(e){let t=(0,$1.getBlockType)(e);return Wet(t?.attributes)}};function iF(e){let{style:t}=e,o=t?.dimensions||{},r=ga({dimensions:o});return{className:o.aspectRatio?"has-aspect-ratio":void 0,style:r}}function sF(e){let t=e.style?.border||{};return{className:p$(e)||void 0,style:ga({border:t})}}function uY(e){let{colors:t}=Ym(),o=sF(e),{borderColor:r}=e;if(r){let n=by({colors:t,namedColor:r});o.style.borderColor=n.color}return o}function dY(e){let t=e.style?.shadow||"";return{style:ga({shadow:t})}}var fY=c(F(),1);function aF(e){let{backgroundColor:t,textColor:o,gradient:r,style:n}=e,i=xa("background-color",t),s=xa("color",o),a=gv(r),l=a||n?.color?.gradient,u=K(s,a,{[i]:!l&&!!i,"has-text-color":o||n?.color?.text,"has-background":t||n?.color?.background||r||n?.color?.gradient,"has-link-color":n?.elements?.link?.color}),d=n?.color||{},f=ga({color:d});return{className:u||void 0,style:f}}function pY(e){let{backgroundColor:t,textColor:o,gradient:r}=e,[n,i,s,a,l,u]=Le("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,fY.useMemo)(()=>[...n||[],...i||[],...s||[]],[n,i,s]),f=(0,fY.useMemo)(()=>[...a||[],...l||[],...u||[]],[a,l,u]),p=aF(e);if(t){let h=jc(d,t);p.style.backgroundColor=h.color}if(r&&(p.style.background=KB(f,r)),o){let h=jc(d,o);p.style.color=h.color}return p}function mY(e){let{style:t}=e,o=t?.spacing||{};return{style:ga({spacing:o})}}var hIe=c(U(),1);var{kebabCase:Ket}=H(hIe.privateApis);function hY(e,t){let o=e?.style?.typography||{};o={...o,fontSize:ld({size:e?.style?.typography?.fontSize},t)};let r=ga({typography:o}),n=e?.fontFamily?`has-${Ket(e.fontFamily)}-font-family`:"",i=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:K(n,i,yp(e?.fontSize)),style:r}}var lF=c(F(),1);function gY(e){let[t,o]=(0,lF.useState)(e);return(0,lF.useEffect)(()=>{e&&o(e)},[e]),t}_1e([kV,nV,nK,VK,N5,z5,YK,sV,C9,NPe,ZPe,tIe,nY,G1e,nPe,iIe,mIe].filter(Boolean));x1e([kV,nV,dEe,N5,v$,mPe,YK,_$,w$,sV,m$,z5,C9,YCe,nY]);w1e([kV,nV,nK,K1e,VK,m$,z5,sV,v$,N5,_$,w$]);var gIe={button:"wp-element-button",caption:"wp-element-caption"},Yet=e=>gIe[e]?gIe[e]:"";var bIe=()=>"";var _x=c(F(),1),K1=c(ue(),1),yY=c(Ko(),1);var yIe=c(E(),1);function vY(e,t,o){if(e==null||e===!1)return;if(Array.isArray(e))return bY(e,t,o);switch(typeof e){case"string":case"number":return}let{type:r,props:n}=e;switch(r){case _x.StrictMode:case _x.Fragment:return bY(n.children,t,o);case _x.RawHTML:return;case $C.Content:return vIe(t,o);case jE:t.push(n.value);return}switch(typeof r){case"string":return typeof n.children<"u"?bY(n.children,t,o):void 0;case"function":let i=r.prototype&&typeof r.prototype.render=="function"?new r(n).render():r(n);return vY(i,t,o)}}function bY(e,...t){e=Array.isArray(e)?e:[e];for(let o=0;oo instanceof yY.RichTextData?o:yY.RichTextData.fromHTMLString(o))}var kIe=c(U(),1);var SY=c(E(),1);function _Ie({clientId:e,resizableBoxProps:t,...o}){return(0,SY.jsx)(Xa,{clientId:e,__unstablePopoverSlot:"block-toolbar",...o,children:(0,SY.jsx)(kIe.ResizableBox,{...t})})}var q1=c(F(),1),cF=c(Q(),1),Vc=c(U(),1),Y1=c(G(),1);var Al=c(E(),1);function xIe({rules:e}){let[t,o]=(0,q1.useState)(!1),{clientIds:r,selectPrevious:n,message:i}=(0,cF.useSelect)(m=>H(m(C)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:l}=H((0,cF.useDispatch)(C));if((0,q1.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,q1.useEffect)(()=>{o(!1)},[r]),!i)return;let u=typeof i=="object"&&i!==null,d=u?i.description:i,f=u&&i.requireConfirmation,p=f&&!t,h=()=>{l(r,n,!0),s()};return(0,Al.jsx)(Vc.Modal,{title:(0,Y1.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,Al.jsxs)(Vc.__experimentalVStack,{spacing:4,children:[(0,Al.jsxs)("div",{children:[(0,Al.jsx)("p",{children:d}),u&&(i.warning||i.subtext)&&(0,Al.jsxs)("p",{children:[i.warning&&(0,Al.jsx)("strong",{children:i.warning}),i.warning&&i.subtext&&" ",i.subtext]})]}),f&&(0,Al.jsx)(Vc.CheckboxControl,{label:(0,Y1.__)("I understand the consequences"),checked:t,onChange:o}),(0,Al.jsxs)(Vc.__experimentalHStack,{justify:"right",children:[(0,Al.jsx)(Vc.Button,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,Y1.__)("Cancel")}),(0,Al.jsx)(Vc.Button,{variant:"primary",onClick:h,disabled:p,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,Y1.__)("Delete")})]})]})})}var kY=c(F(),1);var xx=c(U(),1),CIe=c(F(),1),Ds=c(G(),1),uF=c(E(),1),wIe=[{value:"fill",label:(0,Ds._x)("Fill","Scale option for dimensions control"),help:(0,Ds.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Ds._x)("Contain","Scale option for dimensions control"),help:(0,Ds.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Ds._x)("Cover","Scale option for dimensions control"),help:(0,Ds.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Ds._x)("None","Scale option for dimensions control"),help:(0,Ds.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,Ds._x)("Scale down","Scale option for dimensions control"),help:(0,Ds.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function EIe({panelId:e,value:t,onChange:o,options:r=wIe,defaultValue:n=wIe[0].value,isShownByDefault:i=!0}){let s=t??n,a=(0,CIe.useMemo)(()=>r.reduce((l,u)=>(l[u.value]=u.help,l),{}),[r]);return(0,uF.jsx)(xx.__experimentalToolsPanelItem,{label:(0,Ds._x)("Scale","Image scaling options"),isShownByDefault:i,hasValue:()=>s!==n,onDeselect:()=>o(n),panelId:e,children:(0,uF.jsx)(xx.__experimentalToggleGroupControl,{label:(0,Ds._x)("Scale","Image scaling options"),isBlock:!0,help:a[s],value:s,onChange:o,children:r.map(l=>(0,uF.jsx)(xx.__experimentalToggleGroupControlOption,{...l},l.value))})})}var wx=c(U(),1),My=c(G(),1),Gf=c(E(),1);function TIe({panelId:e,value:t={},onChange:o=()=>{},units:r,isShownByDefault:n=!0}){let i=t.width==="auto"?"":t.width??"",s=t.height==="auto"?"":t.height??"",a=l=>u=>{let d={...t};u?d[l]=u:delete d[l],o(d)};return(0,Gf.jsxs)(Gf.Fragment,{children:[(0,Gf.jsx)(wx.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,My.__)("Width"),isShownByDefault:n,hasValue:()=>i!=="",onDeselect:a("width"),panelId:e,children:(0,Gf.jsx)(wx.__experimentalUnitControl,{label:(0,My.__)("Width"),placeholder:(0,My.__)("Auto"),labelPosition:"top",units:r,min:0,value:i,onChange:a("width")})}),(0,Gf.jsx)(wx.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,My.__)("Height"),isShownByDefault:n,hasValue:()=>s!=="",onDeselect:a("height"),panelId:e,children:(0,Gf.jsx)(wx.__experimentalUnitControl,{label:(0,My.__)("Height"),placeholder:(0,My.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:a("height")})})]})}var Gh=c(E(),1);function qet({panelId:e,value:t={},onChange:o=()=>{},aspectRatioOptions:r,defaultAspectRatio:n="auto",scaleOptions:i,defaultScale:s="cover",unitsOptions:a,tools:l=["aspectRatio","widthHeight","scale"]}){let u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,f=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,p=t.scale===void 0?null:t.scale,[h,m]=(0,kY.useState)(p),[g,b]=(0,kY.useState)(f),y=!!(u&&d)?"custom":f,k=f||u&&d;return(0,Gh.jsxs)(Gh.Fragment,{children:[l.includes("aspectRatio")&&(0,Gh.jsx)(_D,{panelId:e,options:r,defaultValue:n,value:y,onChange:S=>{let _={...t};S=S==="auto"?null:S,b(S),S?_.aspectRatio=S:delete _.aspectRatio,S?h?_.scale=h:(_.scale=s,m(s)):delete _.scale,S!=="custom"&&u&&d&&delete _.height,o(_)}}),l.includes("widthHeight")&&(0,Gh.jsx)(TIe,{panelId:e,units:a,value:{width:u,height:d},onChange:({width:S,height:_})=>{let x={...t};S=S==="auto"?null:S,_=_==="auto"?null:_,S?x.width=S:delete x.width,_?x.height=_:delete x.height,S&&_?delete x.aspectRatio:g&&(x.aspectRatio=g),!g&&!!S!=!!_?delete x.scale:h?x.scale=h:(x.scale=s,m(s)),o(x)}}),l.includes("scale")&&k&&(0,Gh.jsx)(EIe,{panelId:e,options:i,defaultValue:s,value:h,onChange:S=>{let _={...t};m(S),S?_.scale=S:delete _.scale,o(_)}})]})}var RIe=qet;var dF=c(U(),1),Wf=c(G(),1),_Y=c(E(),1),BIe=[{label:(0,Wf._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Wf._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Wf._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Wf._x)("Full Size","Image size option for resolution control"),value:"full"}];function PIe({panelId:e,value:t,onChange:o,options:r=BIe,defaultValue:n=BIe[0].value,isShownByDefault:i=!0,resetAllFilter:s}){let a=t??n;return(0,_Y.jsx)(dF.__experimentalToolsPanelItem,{hasValue:()=>a!==n,label:(0,Wf.__)("Resolution"),onDeselect:()=>o(n),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,_Y.jsx)(dF.SelectControl,{label:(0,Wf.__)("Resolution"),value:a,options:r,onChange:o,help:(0,Wf.__)("Select the size of the source image.")})})}var Ny=c(G(),1),Cx=c(U(),1),OIe=c(Q(),1);var Fc=c(G(),1),IIe={a:(0,Fc.__)("The element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,Fc.__)("The
element should represent a self-contained, syndicatable portion of the document."),aside:(0,Fc.__)("The