From 50ac90926019de8ac8cd8b43cd2dc227a42c5dd2 Mon Sep 17 00:00:00 2001 From: Nataliia Bobrova Date: Thu, 27 Feb 2025 10:23:21 +0000 Subject: [PATCH] init commit --- .gitignore | 9 + LICENSE | 21 + README.md | 13 + assets/img/logo/AIRA_logo.svg | 25 + assets/img/logo/logo-theme-dark.svg | 67 + assets/img/logo/logo.svg | 67 + assets/js/custom.js | 38 + assets/js/editor.js | 4 + assets/scss/_bootscore-custom.scss | 155 + assets/scss/_bootscore-maps.scss | 0 assets/scss/_bootscore-utilities.scss | 4 + assets/scss/_bootscore-variables.scss | 23 + assets/scss/editor.scss | 14 + assets/scss/main.scss | 58 + composer.json | 27 + functions.php | 175 + readme.txt | 39 + screenshot.png | Bin 0 -> 16542 bytes src/blocks/featured-image-block/.editorconfig | 18 + src/blocks/featured-image-block/.gitignore | 30 + .../build/featured-image-block/block.json | 33 + .../build/featured-image-block/index-rtl.css | 8 + .../featured-image-block/index.asset.php | 1 + .../build/featured-image-block/index.css | 10 + .../build/featured-image-block/index.css.map | 1 + .../build/featured-image-block/index.js | 42714 ++++++++++++++++ .../build/featured-image-block/index.js.map | 1 + .../build/featured-image-block/render.php | 28 + .../featured-image-block/style-index-rtl.css | 32 + .../featured-image-block/style-index.css | 34 + .../featured-image-block/style-index.css.map | 1 + .../featured-image-block.php | 30 + src/blocks/featured-image-block/package.json | 23 + src/blocks/featured-image-block/readme.txt | 55 + .../src/featured-image-block/block.json | 33 + .../src/featured-image-block/edit.js | 148 + .../src/featured-image-block/editor.scss | 7 + .../src/featured-image-block/index.js | 40 + .../src/featured-image-block/render.php | 28 + .../src/featured-image-block/style.scss | 32 + .../src/featured-image-block/view.js | 25 + style.css | 18 + theme.json | 103 + 43 files changed, 44192 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 assets/img/logo/AIRA_logo.svg create mode 100644 assets/img/logo/logo-theme-dark.svg create mode 100644 assets/img/logo/logo.svg create mode 100644 assets/js/custom.js create mode 100644 assets/js/editor.js create mode 100644 assets/scss/_bootscore-custom.scss create mode 100644 assets/scss/_bootscore-maps.scss create mode 100644 assets/scss/_bootscore-utilities.scss create mode 100644 assets/scss/_bootscore-variables.scss create mode 100644 assets/scss/editor.scss create mode 100644 assets/scss/main.scss create mode 100644 composer.json create mode 100644 functions.php create mode 100644 readme.txt create mode 100644 screenshot.png create mode 100644 src/blocks/featured-image-block/.editorconfig create mode 100644 src/blocks/featured-image-block/.gitignore create mode 100644 src/blocks/featured-image-block/build/featured-image-block/block.json create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index-rtl.css create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index.asset.php create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index.css create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index.css.map create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index.js create mode 100644 src/blocks/featured-image-block/build/featured-image-block/index.js.map create mode 100644 src/blocks/featured-image-block/build/featured-image-block/render.php create mode 100644 src/blocks/featured-image-block/build/featured-image-block/style-index-rtl.css create mode 100644 src/blocks/featured-image-block/build/featured-image-block/style-index.css create mode 100644 src/blocks/featured-image-block/build/featured-image-block/style-index.css.map create mode 100644 src/blocks/featured-image-block/featured-image-block.php create mode 100644 src/blocks/featured-image-block/package.json create mode 100644 src/blocks/featured-image-block/readme.txt create mode 100644 src/blocks/featured-image-block/src/featured-image-block/block.json create mode 100644 src/blocks/featured-image-block/src/featured-image-block/edit.js create mode 100644 src/blocks/featured-image-block/src/featured-image-block/editor.scss create mode 100644 src/blocks/featured-image-block/src/featured-image-block/index.js create mode 100644 src/blocks/featured-image-block/src/featured-image-block/render.php create mode 100644 src/blocks/featured-image-block/src/featured-image-block/style.scss create mode 100644 src/blocks/featured-image-block/src/featured-image-block/view.js create mode 100644 style.css create mode 100644 theme.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..769fecb --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +node_modules/ +package-lock.json +.prettierrc +assets/css/main.css +assets/css/main.css.map +assets/css/editor.css +assets/css/editor.css.map +.github/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dd61094 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 - 2024 The Bootscore Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aff0690 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Bootscore Child Theme + +[![Github All Releases](https://img.shields.io/github/downloads/bootscore/bootscore-child/total.svg)](https://github.com/bootscore/bootscore-child/releases) +[![Packagist Prerelease](https://img.shields.io/packagist/vpre/bootscore/bootscore-child?logo=packagist&logoColor=fff)](https://packagist.org/packages/bootscore/bootscore-child) + +Start developing your new WordPress project right away in a upgrade-safe way using overrides by copying files from [Bootscore](https://github.com/bootscore/bootscore) parent theme. + +## Installation + +1. Download latest [bootscore-child.zip](https://github.com/bootscore/bootscore-child/releases/latest/download/bootscore-child.zip) release. +2. In your admin panel, go to Appearance > Themes and click the Add New button. +3. Click Upload Theme and Choose File, then select the theme's .zip file. Click Install Now. +4. Click Activate to use your new theme right away. diff --git a/assets/img/logo/AIRA_logo.svg b/assets/img/logo/AIRA_logo.svg new file mode 100644 index 0000000..3d5952f --- /dev/null +++ b/assets/img/logo/AIRA_logo.svg @@ -0,0 +1,25 @@ + + + diff --git a/assets/img/logo/logo-theme-dark.svg b/assets/img/logo/logo-theme-dark.svg new file mode 100644 index 0000000..2d4966e --- /dev/null +++ b/assets/img/logo/logo-theme-dark.svg @@ -0,0 +1,67 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/img/logo/logo.svg b/assets/img/logo/logo.svg new file mode 100644 index 0000000..b492688 --- /dev/null +++ b/assets/img/logo/logo.svg @@ -0,0 +1,67 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/js/custom.js b/assets/js/custom.js new file mode 100644 index 0000000..07d7f86 --- /dev/null +++ b/assets/js/custom.js @@ -0,0 +1,38 @@ +jQuery(function ($) { + + // Getting links from a page and turning them into a scroll-spy bespoke menu + + // FIXME when page loads with #... in url, the scroll spy gets messed up. + + let links; + + links = document.querySelectorAll("#one, #two, #three") + + let url = window.location.href; + + let innerContent = ""; + + links.forEach(link => { + let fullUrl = url + "#" + link.id; + innerContent += "
  • " + link.attributes.name.value + "
  • " + }); + + console.log(innerContent) + + let menu; + menu = document.getElementById("menu-test-scroll-spy"); + + menu.innerHTML = innerContent + + + // Activate Scrollspy + $('.entry-content').scrollspy({ + target: '#nav_menu-4' + }); + + // Refresh Scrollspy + $('[data-spy="scroll"]').each(function () { + $(this).scrollspy("refresh"); + }); + + }); \ No newline at end of file diff --git a/assets/js/editor.js b/assets/js/editor.js new file mode 100644 index 0000000..9f1dc65 --- /dev/null +++ b/assets/js/editor.js @@ -0,0 +1,4 @@ +wp.domReady ( function() { + wp.blocks.unregisterBlockStyle( 'core/button', 'outline'); + wp.blocks.unregisterBlockStyle( 'core/button', 'fill'); +}); \ No newline at end of file diff --git a/assets/scss/_bootscore-custom.scss b/assets/scss/_bootscore-custom.scss new file mode 100644 index 0000000..6fb87fe --- /dev/null +++ b/assets/scss/_bootscore-custom.scss @@ -0,0 +1,155 @@ +/*! + * Bootscore custom styles + */ + +// Add your own code here! +// Because this file is compiled after Bootstrap, you're also able to use Bootstrap mixins for better code. +// Some examples can be found here: https://bootscore.me/documentation/bootstrap-css-sass + +/* NAVIGATION */ +#nav-main { + height: 70px; + .container { + width: 1320px; + } + .nav-link { + text-transform: uppercase; + font-size: 13px; + } +} + +/* Is required to show the svg logo */ +.navbar-brand { + width: 150px; +} + + +/* CUSTOM BLOCK MOBILE SUPPORT */ +@include media-breakpoint-up(md) { + body:not(.wp-admin) .wp-block-create-block-featured-image-block { + .call-to-action { + width: 350px; + margin-right: 100px; + } + } + +} + + + +/* DEFAULT BLOCK OVERRIDES */ +:root :where(p.has-background) { + padding:.5em; +} + +.wp-block-cover, .wp-block-cover-image { + min-height: auto; +} +/* COVER control the spacing on the left and right */ +.wp-block-cover.is-light { + .has-text-align-left { + margin-left: 0 !important; + } + .has-text-align-right { + margin-right: 0 !important; + } +} + +@include media-breakpoint-up(md) { + :root :where(p.has-background) { + padding:1.25em 2.375em; + } +} + + +/* HOMEPAGE SPECIFIC STYLING PER BLOCK */ +/* Crane block */ +.homepage-crane { + .wp-block-cover__image-background { + background-position: right 35% top 20% !important; + } +} + +.home { + #content { + padding-top: 0 !important; + } + .entry-header { + display: none; + } +} + +.footer-crane { + .wp-block-cover__image-background { + background-position: 760% 20% !important; + background-attachment: initial; + background-repeat: no-repeat; + background-size: auto; + } +} + +/* Footer */ + +#footer { + .bootscore-footer-columns { + // background-color: black; + color: white; + a { + color: white; + } + } +} + +/* Custom Style for core/cover block */ +.is-style-fixed-height-272 { + height: 272px; +} +.is-style-fixed-height-300 { + height: 300px; +} +.is-style-fixed-height-400 { + height: 400px; +} + +// /* FIXME: merge buttons to be bootstrap by amending the classes here in core/button. Then update theme.json */ +// .wp-block-button__link { +// transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +// &:hover { +// color: #fff; +// background-color: #c20512; +// border-color: #b70511; +// } +// } + +.is-style-bootstrap-primary > a, +.is-style-bootstrap-primary > div { + @extend .btn; + @extend .btn-primary; + @extend .btn-lg; +} + +.is-style-bootstrap-dark > a, +.is-style-bootstrap-dark > div { + @extend .btn; + @extend .btn-dark; + @extend .btn-lg; +} + +/* Page */ +.featured-full-width-img { + height: 400px; +} + +#secondary { + height: 100%; +} + +#sidebar { + position: sticky; + a:not(.active) { + color: black; + } + li { + padding: 0.25rem 0; + } +} \ No newline at end of file diff --git a/assets/scss/_bootscore-maps.scss b/assets/scss/_bootscore-maps.scss new file mode 100644 index 0000000..e69de29 diff --git a/assets/scss/_bootscore-utilities.scss b/assets/scss/_bootscore-utilities.scss new file mode 100644 index 0000000..bf1488b --- /dev/null +++ b/assets/scss/_bootscore-utilities.scss @@ -0,0 +1,4 @@ +/* + Use this file to add your own custom utility classes. + https://getbootstrap.com/docs/5.3/utilities/api/ +*/ \ No newline at end of file diff --git a/assets/scss/_bootscore-variables.scss b/assets/scss/_bootscore-variables.scss new file mode 100644 index 0000000..eb79ae4 --- /dev/null +++ b/assets/scss/_bootscore-variables.scss @@ -0,0 +1,23 @@ +// In this file you can override the default variables of Bootstrap +// Do you want primary to be green? Just add "$primary: #00FF00;" to this file and the theme will automatically compile the scss for you. +$primary: #e30613; +$secondary: #cccccc; +$tertiary: #f5f5f5; + + +$navbar-light-color: white; +$navbar-light-hover-color: darken(white, 10%); +$navbar-light-active-color: white; + +$btn-border-radius: 0; +$btn-border-radius-sm: 0; +$btn-border-radius-lg: 0; + +$container-max-widths: ( + sm: 540px, + md: 720px, + lg: 960px, + xl: 1140px, + xxl: 1400px +); + diff --git a/assets/scss/editor.scss b/assets/scss/editor.scss new file mode 100644 index 0000000..c91884b --- /dev/null +++ b/assets/scss/editor.scss @@ -0,0 +1,14 @@ +/*! + * editor.scss + * This file compiles Bootstrap colors, which are used in theme.json as variables, + * and adds the compiled colors to the color picker in the sidebar. + */ +@import "bootstrap/functions"; + +@import "bootscore-variables"; + +@import "bootstrap/variables"; +@import "bootstrap/variables-dark"; +@import "bootstrap/maps"; +@import "bootstrap/mixins"; +@import "bootstrap/root"; diff --git a/assets/scss/main.scss b/assets/scss/main.scss new file mode 100644 index 0000000..4408d40 --- /dev/null +++ b/assets/scss/main.scss @@ -0,0 +1,58 @@ +@import "bootstrap/mixins/banner"; +@include bsBanner(""); + +@import "bootstrap/functions"; + +@import "bootscore-variables"; + +@import "bootstrap/variables"; +@import "bootstrap/variables-dark"; + +@import "bootscore-maps"; + +@import "bootstrap/maps"; +@import "bootstrap/mixins"; + +@import "bootstrap/utilities"; + +@import "bootscore-utilities"; + +@import "bootstrap/root"; +@import "bootstrap/reboot"; +@import "bootstrap/type"; +@import "bootstrap/images"; +@import "bootstrap/containers"; +@import "bootstrap/grid"; +@import "bootstrap/tables"; +@import "bootstrap/forms"; +@import "bootstrap/buttons"; +@import "bootstrap/transitions"; +@import "bootstrap/dropdown"; +@import "bootstrap/button-group"; +@import "bootstrap/nav"; +@import "bootstrap/navbar"; +@import "bootstrap/card"; +@import "bootstrap/accordion"; +@import "bootstrap/breadcrumb"; +@import "bootstrap/pagination"; +@import "bootstrap/badge"; +@import "bootstrap/alert"; +@import "bootstrap/progress"; +@import "bootstrap/list-group"; +@import "bootstrap/close"; +@import "bootstrap/toasts"; +@import "bootstrap/modal"; +@import "bootstrap/tooltip"; +@import "bootstrap/popover"; +@import "bootstrap/carousel"; +@import "bootstrap/spinners"; +@import "bootstrap/offcanvas"; +@import "bootstrap/placeholders"; + +@import "bootstrap/helpers"; + +@import "bootstrap/utilities/api"; + +@import "bootscore-style"; +@import "bootscore-woocommerce"; // Comment or delete this line if WooCommerce styles are not needed +@import "bootscore-custom"; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f2ae3c5 --- /dev/null +++ b/composer.json @@ -0,0 +1,27 @@ +{ + "name": "bootscore/aira-theme", + "description": "child theme for bootscore", + "type": "wordpress-theme", + "license": "MIT", + "authors": [ + { + "name": "Telos Digital - Nataliia Bobrova" + } + ], + "readme": "README.md", + "homepage": "https://bootscore.me/", + "support": { + "issues": "https://github.com/bootscore/bootscore/issues", + "forum": "https://github.com/orgs/bootscore/discussions", + "source": "https://github.com/bootscore/bootscore-child", + "docs": "https://bootscore.me/documentation/" + }, + "minimum-stability": "stable", + "keywords": [ + "wordpress", + "theme", + "bootscore", + "bootstrap", + "woocommerce" + ] +} diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..d928ddb --- /dev/null +++ b/functions.php @@ -0,0 +1,175 @@ + 'fixed-height-272', // part of the class that gets added to the block. + 'label' => __( ' Fixed Height 272px', 'style-1' ), + ) + ); +} +add_action( 'init', 'register_cover_block_styles_1' ); + + +function register_cover_block_styles_2() { + register_block_style( + 'core/cover', // name of your block + array( + 'name' => 'fixed-height-300', // part of the class that gets added to the block. + 'label' => __( ' Fixed Height 300px', 'style-2' ), + ) + ); +} +add_action( 'init', 'register_cover_block_styles_2' ); + + +function register_cover_block_styles_3() { + register_block_style( + 'core/cover', // name of your block + array( + 'name' => 'fixed-height-400', // part of the class that gets added to the block. + 'label' => __( ' Fixed Height 400px', 'style-3' ), + ) + ); +} +add_action( 'init', 'register_cover_block_styles_3' ); + + +// It doesn't look like fill and outline were added in php, hence have to unregister with JS +/** + * Gutenberg scripts and styles + * @link https://www.billerickson.net/block-styles-in-gutenberg/ + */ +function be_gutenberg_scripts() { + + wp_enqueue_script( + 'be-editor', + get_stylesheet_directory_uri() . '/assets/js/editor.js', + array( 'wp-blocks', 'wp-dom' ), + filemtime( get_stylesheet_directory() . '/assets/js/editor.js' ), + true + ); +} +add_action( 'enqueue_block_editor_assets', 'be_gutenberg_scripts' ); + + +if ( ! function_exists( 'bootscore_block_styles' ) ) : + /** + * Register custom block styles + */ + function register_button_block_button() { + register_block_style( + 'core/button', // name of your block + array( + 'name' => 'bootstrap-primary', // part of the class that gets added to the block. + 'label' => __( 'Primary', 'bootstrap-primary' ), + ) + ); + register_block_style( + 'core/button', // name of your block + array( + 'name' => 'bootstrap-dark', // part of the class that gets added to the block. + 'label' => __( 'Dark', 'bootstrap-dark' ), + ) + ); + } +endif; + +add_action( 'init', 'register_button_block_button' ); + + +/* TEMPLATE PAGE */ + +/** + * Change one or more classes into my-custom-class + */ +function my_fancy_filter_function() { + return "featured-full-width-img bg-dark text-light mb-4"; +} +add_filter('bootscore/class/featured-full-width-img', 'my_fancy_filter_function', 10, 2); \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..f66786f --- /dev/null +++ b/readme.txt @@ -0,0 +1,39 @@ +=== Bootscore Child Theme === + +Contributors: Bastian Kreiter, Justin Kruit, DrDBanner + +Requires at least: 5.0 +Tested up to: 6.6 +Requires PHP: 7.4 +Stable tag: 6.0.0 +License: MIT License +License URI: https://github.com/bootscore/bootscore-child/blob/main/LICENSE + + +== Description == + +Child Theme for Bootscore, Copyright 2019 - 2024 Bootscore. + +Start developing your new project right away in a upgrade-safe way using overrides by copying files from Bootscore parent theme. + + +== Live preview == + +https://bootscore.me + + +== Installation == + +1. In your admin panel, go to Appearance > Themes and click the Add New button. +2. Click Upload Theme and Choose File, then select the theme's .zip file. Click Install Now. +3. Click Activate to use your new theme right away. + + +== Documentation == + +https://bootscore.me/documentation/using-the-child-themes/ + + +== Changelog == + +Please visit https://github.com/bootscore/bootscore-child/releases for a detailed changelog. \ No newline at end of file diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..23d7e6ba725efc7316cf3461a0c0deb37416ef14 GIT binary patch literal 16542 zcma*NWmH>T*d`p@-3pXq#e+K(FYXqC2lwJ$+=>==ZE*qwcSG{>!#r65sH4_`>j!)R>+2u)l@9g}-)%ESg<&Bz_?#1Qx zACUDyOvm&5q<)AHKIUshh_>Er)&dG)ZlH841IQe5fc=E==3 zys`Ob_1Bt!$UAl}-sk)K>Dl=+Xw%K!epk=8y@SK^maeqS?ESF#?Va5{zlcltkGO=- zcenRXH@8}P2A5aY|918cvWrK@CWN;;iU9yA0_FEIdVZ@%Yd;--N|T~ZixMzmy&dBt zZ>3L8j?o!@34vfWGbwYc7=5xWZIP7C@7YaYMsgB=*R1Zm!ii*@T=7h5yu@7W=cLDPRV(D`6jyPY zT5H)#_1=?RX)Wf+>h0if+S8)+^V`8OG2wjldi(pt?+!_{+MT-}PSQgg3t9}M@UU1{ zdQLO+ft3Tl1FvPj`ox6Oe5^O~SCg)~ILVUV*dx}eF4!2p zDUM^UD|pmFCV0;>Rtxi|?tJ{zgx~mnP;{9+D{24D$3$6y-k$a@;V->F za$OWeZZDvzY+~lh1SgEtC7tCNG*`XSCn-;^HAP3;EQTGFu6W_q7^>G9fj9YU_Cvnf zfUXUacm6gb=Oy0JwB})eiRPT8pd>FgM-Q+#yoS_Wz}Hwqau{QCdP&pnBUz^dY)81u zO&#@1uM3HjNTNosM~!~!^2T%e z@)-T2Ch`G8iz!|xXSJOQ&G?6)-P^<`JwF!f3JEt=9CawH&0)LXXe;`NR@@lR10a=| z#&FbIt{(>>8-J6yDNavV@hrM&-MZY1BYJ8YG2coBFxHz=mdvZPxo-Mp^CcGT(Yc3o zQ*D4}Y|XaD!uq?^g!M)k2CRv+A)Pf^L+p)olM9*Bv@D4e=XprU0L+ej73Ek&iO4F2 z(uAVL(AR7i;C}G+>q+eZMUS>i6q7(h=&Pq0?R`~&29s;FDD5;P!mpBI0l-;0^LY^1 z4yCx;fbCDqFwIrDN)_vDWlisc#wrIV0tmEDtu7AuVN;8rSzxIQdAZcy~Kfi(NERVrd(h~9>^sHigzk-0@Y4~cqk zp2f(RP8HZp_qjaK?tT&`GTqtu=&7S#+>QL^z;M(JZS@g@Gal>ZEZ?B-&4Hq2EbzX| zHmz=X&mQn=vEQzrn98EP!6ps?StKV!4Tfg8eE zQhkf6bn4fD2S_)}n-_31`|>FI?=U~D9Di{Jpi~mLU{Jd46+%eg%}Ny|55Q6S5~SjB zL&UH8HccB1$+tKuKAms-=(0YSE7Dm5EmeSUAhl^kII>4KgR<-|{yan3`2Fm)o&FdL zD=bv+AnogU2Yhk6vR)%K9H0D*6P0aSRQJXy5p{>d9lg)&_%&EkHNF3O)F&_njvU?b8I+Q%IXhV_VA5JATPY`Hg@^ zGJg0lqvwoYcQQ)4>%4XKT7{U@KW@kRp>t$94Xh^7Y74uRtJ-m%k~tJKB)9Au=D$9J zho&5!s~Q9gIH5{txFjdJlMN+VqG?M6o7D7f*ye%-+_YT-jdg;2Q$|wJZce!lRN{Lbvb7a;7&prfMsZ9IGJbc zLPtr~=W2zCNOiDuWFt1H$z5zHW^|bAy7EN^8%HEYfuz$JQ+HX_YK!Db<0WDUGmPI} zfWE6yc)IQ?%$>QWss}R^r6pH~^Rm}apMrgbch7T4OF>UwMYwA)$cfWw-q!d-3PT$`NRxs z!l_ie`skU%KuNv4e>@QdADen`=ZKLj+!y8(25MX<6}l^$@?DA{ zNOpe&S`_|d?^ycY=C(X5z>zfu938(p+g1Pe=CE7*3?>EsexJZ>XY)1Kt>8y{-U1^z z8jeT`XztL)RH8%UYlmx2;93{p6KJ^dY*dc_pLs8qv1EwkcNR^+lvH-ps$$N;!Q4Ab zE9mneklqbhfge`i2yp}5o^M>-L?YAaP@c}e=#PYJ_;zg{VHt9xyysw#y8bR`ansjp zD>yDbpbK{&mjATzBC3(z!%m=mJ+NV z+@n)F8^ytO$O81hlWzEPurQ~&n;=?Ibgd7tp7+Wv()7(EZzTr`St6D3%2<)YEN$i5 zM(kvZmGmoy>{IckUl~q2AR8d{Hu<{NB%<&FqRZk%L#ISU!lY%nM`br&klJw8;!Xbu zrTM+fJqtO7@TPkANp=LX+I^qCBJw5 zQ^3k$Ms=KZFsyhdby*i!Kh=R5`p6uVuusN+KA9%1w-(lUWt2YEXldK)+nrbTRazgN zvnGQqxa*x~k7@Yk>tc3|F~?RZKu>A`R%zV9-*)8wgvgHR% zx@Q#tq`x)He7(BAeImpMAXV1l0-L_vrk4TTpW>Hja2q>>4oCGJfQ%pHs|07ml!>sbkM2rP8u zCXxF>BX+jm>igoECDKEXgit3Op~3{EL^wP{{u5QoqbLik$mEcLVo~+$ov@=b6kIVU zje^I4#KdjLU^r!8YPa&{bqu5>8))QS{|0tYOc})<4|<_Q4JA6&zC70_uYEOvG)^V> z^?q?cT^@cwFsTKIMxEHzlCK~eDsuH0n)Zx9Ssc&Rgo(S$8GJXro$v1gl;;boKNx;H zsV)CPCV0DXw5IMv%}W}!*+DviDKNS02a_uo$tK1QlSMJLHnlJDT5;*z7kdd=dmFjz zQ2YLw!JzZB3E%M54w#YFbj?#xDpj^D<+Y}9$A@7L8=D}U!+fWR;`!Lu6GM+ewIbP< z#SMkaT260&C!Tf0=aP{(Q=#T9fR-p~@0pmdEMo`TXF^c@o1p*~4^if{1P;%et%(q1 zEoXMf>K>J%D|v1K=Cg1^XM{c{WgW_d5mK5Bh$<;quI1N1#NGs<>7I8pM8Yn>eg%}P zLdtP7EGqI(S{Y8K((26VTP(?U$Zo55A#8Un!?Vyv5)*-onLnU|lEo8MIR)EyHcwSw z^pf#Lzm`vK;c`P6r-VtLFo=k8;u6p_nae1;G5qJtGpH08-jeH$`21LxSjX@k&?Jz1(-&)>uj&S={B!s=@}s9YGsdc|5ghpSJX&^U{_wg7GZHL9g=suNeHvIR5i@p>Lg^ z=qRh;N;Q}{WKjaL+S#*%)~*!RQU3a0tNcgdA>({j(o>lbyQSa#AB8y1ZP0yAfqKob z?~HTNAxnU&E`Ev0<~Nc6<2+DG{g;*CCC#hxo)~hp7Y%#YIrdb(rl9(wJv zib3{?T(zkv98V9ibJs6u&WXOVxgcW!kZk``Iu~30z`!|xRY*xYL9muM=M3L-VGGr^szUv$!n$R-_&9}N4lO~JgNRNV49iDH zq_S}zrGuY*%A$Gw(W3ae-o>cbNDy-f{bwzdzx6%lrm_DdmW=H`^O!8)D;g5d<$(jC zEUICSEyjpgJfER~*CGv$Ss+I@L4UNe^rA_Nxr5}`g|ZAP@-4FF+3r}IV72iQk{Zpt z`RNn`E!BNya`hU#_(6Z0Q%S*8Hq5+F-l(_P@3f zK4%AY_70?MkL*?2@1wzBv*rB3GISpEH70(&QO?U4@XuF9F1g*+KeDKIoStAKuO@hn zW3uh+;TPfOt!HMjd&3nYtS9zQmtpLz{~_#4cHVGiYTgdw8??W|0j22UY65 zhj(kV3vTT*t#BL3&$}Q?Sf_fP{)qNje#;Lq7H%zIT&pZm5)V{}Zlb08;xujFCDflzzVxv3}>O|{gD5I1roQ1=7&X3bC z>90x=$ycjoeYm_jNFxj=xs90LdeeMQyZRJ0Z)no4x&Fgs?-L3G#hc_dVhX-ym5AEE zH#xcwf4X)FIYJX1ww0nx3ooq7gN((&{#;k#1dEc!Q}-g#AVA3?3mGVaTffaKLNNUp z>m69n&RKV;e_)%Y8;l0|-Ycvu(=sOERg(*6U$~>crA2k>Uu;S1o5rSVu1iDq?UTTJ z-2<7~@@;S=*rP?QnYDE4$~hCou(U^W(=oZQ^S;MEZZ?Be3Y=VH>tpkPXS30McQ38~ zLqjx2V|JL?JR?F1Mc?(x@uP+rKUn7sUfn3|y!I>UZxVGVj575bFiWiJ*J*S|REMp4 zKM4?VGGo%|VJl4Zd5C*}M zL?_-zrJB5f#-#x}nf`G{*u-ldqHzoY=)O>GahU$?pZ_8SM&U}xLUWp}q6r56oy}J^ zV6Ddm@k)s#Z1L2RK?P7kKaC!!!EWqjif~N-fnl?FT;8(+O)M`dzOa0;BFdwE)OZD4 zz!x_8-T)JOX!{*IC;FJEQ4aR|wUda1jLplU|Ax8QHi*Haul^*JN`wx<7DWT`- zw7U9upt_0ARW%r6HUL6p#*2(iSr8j|ov#``>QVJ`B)&Fa8zPDeV5q9&_2fQ4t1;!$ z_s}pmbHsCQfoyLn;-?A`mBkpr*?9qd)3AW4?zO3tZB6?kgMRG_G+Vj8@k zfn2(n%jDzD!S&AyO^uiZ3g)emrBIwC4Ojpfu}SdTGIHoU3Um)mZzvJ;H3~q`Son?P z(<_{=IkmlH?%;u0tVPKQfp#qrcBTZ!RUvB#k+I|#-U8-g zpIIaRh5>fw_bk)dAP_<3AfRt4hTGLL+HW%Q&HaH#Ni`Alp;5jLssp>}m@XG3`KXFX zSWNJlb}->Q6^rx2yDzF#0e110>^fZEESFhP0<4b?;8^o>)T*;=xK+DzOrsSIUsZ!W zcti@aRJ?&QpoEgu^>kA4kC`%qx9rBF&TYdpG8pScTLWOhJb<&C{_K^7artYEr1f3d zsbokZCBU!aM##3%PK`B5SmrPVHB@i|x9urW$Qo$}nHmn3V~h1j=D z)d#4@lqN98+OwCi)c``^2PJean}LC2A9KTxEMg0CELs;{vxA3SC%?nV@Pli+I%}qH zH|>1Y0B?D2@7Wt;y*r_EejEAHfinMW?HFk0P;f!7D(K2RyDVUSob+y#ilY!?^Ff38 zssoLIHXZlwV3UCTNRU$mE~t)-eC+87>rjJkN(;peYbs-gYBLINUqyqvw)2fO>?)RI zxt27pOqimbLDZKWVEG|Wbc)cNWHetR%Qt{^4~~8qJQlkz3}!+i^c)=apZS!BvDq5f zY4q7L<0>?w3`aw)$P>(^`&Bx;ZPaTUN5axSMxzm=Pw);L@I$m>c6TOU9f@#G>xWZP zZ2gyi=k^QAXSOmg5fFd=-QF^C^mq*5@9+;fzEX0(Jol>)gWKU8UC4)Mngo1cB-f_x zNU=Knh(Y6nF#6m+?Cy5<-qwnLf5^pClA6T^SBvYju-592d}5g2Tm>3`2TBnkySL#< z$oOf{ZDpvv$0@q*jcSb&n3@k%+cL=I)Q;p7`BU}SVu=rc93Ben45 z^CxO5z|YUy@6{FKTXe3QWil!400A%;9FA7@^j6VtN~M-cXTct3yF~pYPqFy! z4t6IQh&`9$bHt3YsOt+1JY}&D3z2g%FIh+4%2 zAK|MTUTEdcDh(1OzGBp)ezXlWltv-r+Ki@$1R(S(9P;GV_K^;dAp9Dxe?kZ^h>&fX7nGOv;8mEnv91gKTgCpw@L7{YDY4-38 zGE^KTd01mO1gQ!W1R?~|k-h1dWTuLy&kIAb2-Era!lT#7o0Mv%xTskN4jZVQv5%nYc9kdZqL1 z8QjN?FvL=UufB#-(`KSjD8fQf%OEth{NmTKpm4Oem}rOY&TISX%`vYr$q99_7stf} z1KcbS-5|tX9PPaB^fLY5*!6I=>7+FoK_(0DY?*w@C>UV?ONVR09u|An43^#_cnctS zN1XXPT(JnFTC_3z+(CqetS6k<)QSj5SJDGn0iACZAe4CMV+!F?awG`hAY{et)JzJI zi2x-~ypsw6nkk{{#DX%vw`y1jxl(lyTBkf`vxf zM%Zu|AbK6?6R{xPMHr4Y5QnvR#>FRwha>6B0+xnmL)HTO|9+I{XcH*Q@$i8BrEX98w z+whB6v^ORwaAeCCjKig2u77{2{tF@j4(?_9OJI+%uO`Tp`YCUf0!I)H91tvan-9>F zBkZp+#wg@}9cv(1P~ZXVmc)p$HlT+KN@TblAcT<*5oF_*$0o@C^$K%woXdaVPVK+u zpoh0K#0#vmyhT(N1-Wkx?LZK}Z6<_9nO8s+>k`@}`g!3MPUW<-)Fe|)B;ry5R;JSxEYIWBtnDB0I1py{4X5sqeE zNe{NW_HQOebW{!x-bn}qpdxZCB%_4pJbY~U|HPJi_d+Z#9*SS!mpu{svJmg zWIjDYsH@2Y(r+ek!GjtU6S3xM=)rjd{ql&{(+CaTDPA?zLly=>qWptVqg&tfA9Nr? zJ!Hk$Rlp)orVoadqg)#q5+MpAmjWwZQyEkK2PMJZ!`_Ym`p+T&<`a1BREvvXj(-D9 z+_H>BObr(vv7mBs#z7B9_87niEwOIGu@Qr6o`yfXo5_f%Kujl@$piLAihVmR1F<(a zxJL+n!%c5))j?Fr=?nuIm#O=J{@W+e@D?p3w4)QrA`n*e5#IKF;B^cn=5i2t{6N0p^PXcsMfB|;du`|g%!_nG7y0GSK5@26bb$A&f&v!K( z;9MeLU&Cm4nIIzVYEH1aA`H;xh?DsP5zFs7BB;wQksY_6=Uq49Kr$&hF#NsRS7+~P zy|9nT42@C!jr1HiP7QRmA%iruciTOP14r$dqDG0{5!pZEUP;pXo&0v;uIHv8nTchs5FG3CxtxJ5F%&OcUDS-V;s$$;-YDjIP8E zXL0u?Rl`7d%;KE%pI8?maJWJV_UwPxD;oC%M8mmYBZGcBiN0JOGJ??+Il>)}Pkg?8 zN5h$|qJS>eweo&o1Se|@LRuCW6lkW zSC`5#x|~M1nCZZ$KzO+ID0)q8>x?f0I9Y8C(o(Z0o{dAkr6U6V%D;$6ENc{Q6!fW1 z=6{f*oL2!RLMaBmyxbGb#Ud|7Kr4>LM2HM~ON2L>sVY2N&k@7vhAH3#4M(Sn2I@mC zv4M)C!}bPRKhs16R4Vg>;eWM5l&^9Qsr_Qd@jsyD^US#hj4tB<{y<5i8ID$^N3dvh zWr9g=ts?5JYJD|C{Iua!qq{v|0lbKRQ>%tm<~b zB!ByVIy_pO;=Aj{BeTW{E%lVfZQ%^K9t`WUvP*lRYYHH#z5-mfEeHxOd9gU*S&n(~ zp{l~@W^h&9F!Up;_}VUw4RqaNxIEXu?F(;b%3K)cOgJ%cm=FjL$NhfA~;f>Yg~5(h=z z`zglefm`f4rJS-0cxY9PJ3`(w&Led|+55@N)`(T?I#)U@5ZW808utrhx+_QrLMtsC z4vsL!nEocO10j-rIY~vn1Uv}e7mD;F?qN)_O{4Ne%6YWP0pzls)A(IjkZ}KSHYj0c z_!%VSv<6|n~*X)NlfwNCd$A@1RY@ym(nb2312lRYX zX#p*~88L6YDXg+0Noe~+<#T5$!sGw?0nw-G z{Nwzw+^QToHH~z~YR<&<*JR-0baY=Y6X)R+6+u9=fFB&2ze= zeW+RufCT9T=-vWb>Uf-xz}i$diN;A&f?vr)$&?BfI5lqt)5t@a27j*weB1y5V4?Nj z&DPegVqVG*-W2Dk;Pj=HJ{E!wIB(@lEs1lEQd-N_y+s4Pzd0m~BlDPd7l0fs+5_qJ zR*4(;xjjKpz;E}eC1Yc(3V)7bk5`SpOAd-fXuo+q8V|=XD=PTQYF(S}3IpW;x2iI0 z^1G6w9@pUA`Xs|6JEV41Uf)=Pv8+EH?c_!vc0jv2`Y9Les~(4PM2D)^Z)?oo=vW8L z^NU;=rPkiM>YCO_?XqG)8w$IdI<^jqh$rdrJeYymva-tu_PK8;uaxg)$G8^aM@G70 z`_j>VOU-tq?3k+V9$(p4dKm(q@A>yc7}iA>hG#VYcp}{Iv=4`lrRDS9gG`Z@yG7pE z-O!%%Y&7dOeZDgXtSep&nT@Jv0r_@iA!7>L`uts;sib4PUKXxW-M5*XG1I3>Wf_jl z`+3?eKRO7Pp?gK^vyUn^S+&}}x>k$FD!C+vU(H)TQv#5>Q;&+o-O4(fen<=$vtDfV z%U1%NHD;83uX9~V98bQ!)BYA14TM-J*mQj+a8{mp6xw|BU1-js$61C|Hg!737Wl@W zZ=PfW@#M&1+Qd8WYOAscBpu={LVQDQ|Om zg^mLAqhpf3pl}vJ!W9`Vd6oR~f|6yao>tciba4P0pL)6w$fry*$j>GhafwlHrIpi` zO}#Fl7_9_AcEO6a5n0ux6s$F>((x#crvOn0>Q1M8qyB>F_)nacO@^gWfWXC>h%l5) z=I->mjdWULgv1}B?)wLMz339TA->&2jz9w&;1jDpz)5XfqOUZ?D^cHr97;pQ^yrZs zSVD&SVXGQ73K$wxvo}fVP*^9Mbxnrua*CkE5ax%u*ayiGnFLZ)03eEBsq%>Zm>ORu z4DP%>GpSG-3zA%!g2>bvFupntuMsAU+8KF@b5cuZYfnP(Pa`2D1RLw0B}H!PU(?BdH+vRLDSSgt|%4+>Vc;wtIRzsN&IbC@D7dgBxSQp^%=PP*t9g~oj z255Hbrv`?UH$9OmQt7b6g9iRER_}FNk#G?{*9ULO-)p4F&7e7f224ZqzY7i+`@a*} z2pb@Q?YHKvHlHUfyV;3ddvlrpnhf-}QYz^??I~Q9P!-fn_53g~RO_y8)9>vR=TZc| zYoKG&zsz}VIY@E}`WH4LZrQUxSbv)$RAX+kPFIVpG??_uN0rh%U(PUXQtTXx6b`^9`p@m+YeBcb7$?;QqSR zch=ESa66%2{HJ1crDU zoQOM$3d&n4V9aVovjlLBX+nehQ^|bRKq}{R5mC-sKf+1f)Ck%6O_HpOK)n`Ac+?_J zv6rsZJQQfK%%nOhGTTyL!v#~thw0`6%619Ev>OYjPTHD&jw5=c2O%1Yf$0V9ZN#t6 zhSS)%YRx++)6wxUT?Jqfj%P~7K26`2&(j`CRyyd3NwN<`_k(o za(U?3BE9#Acej&uSwK&7Y+C(MzSTVjgb~Q#uyPKHl?*SCA>{J-U5a*Jt}~&x61Ii@ zHwGMmn1n?JhYf+zu!R@Zwu9gWo>W<-#3Wp>P*LdiM=T5V#{>z=G_R~5Uoa$A&?9cN zKQ#xaWDoX7$8*yIBlEGBTA|GLQ%>rNUBTmx>!pOQGhs_}De_(g>N9Hr#Ii!}^7%=_ zdmpT?JIGhwYEUq|%F2Nb-<_ zqRZ?G%W*Mf8*elc6)-h&03a@D+K}P#_mHH6{+ze<4`FC;Z-gQwiO+5qHP@LhI z;;yFJkMQ_U+RfpeDx)hLrwOmSm*~+X$7Xo$DTL$`ScinSm z)FT(@6(ySY#B(Z%KQqf6p#NZP@GmV$T(gD2_ViXvd3srANMoKmp@WA84<_Qqlfx4v zJw&Gj)tGgyWv*@=$44DiHCs8o37fnpNg;WBi8ee<(^!07jCM24EHC7a)Mo?)GUFYp z7UrrJm46FxKm-dZKO5tYqb8Ga#f`*8DduM+uqkph)j4llpfk?j?%u=CRt^wzRVX2><2xoA!@c5NxuY9^c0z^jr9s#)TY_*kQ_ zEE(vE!1e^;$FaNKatV>T-H-AdrzRrl^7+7kq($xgDswOYS{a&E_kr*+HO6m^ZJF!c zcR$W*YNP#_nD6cnt-Aq=i{RlnT@gJSPl~!n$Na&)%_q5wH$CEZ1H1%-Cx_;(pR9EmJsbWL3 zeMoJ-|9joOI=`F}!f$LoL;Dp~N}AWfC6iIniOqCqC^{0wL88WcQ@iDRmcPq~Ctbv~ zk_th;LBso=j&Yp;&3z$Bf%5!cjw`CjXZC8W;!M#S#(L&H&4sguk^;J=Zwl}L29)78 z4>?k>Dh7pSY9^92HuanEN%YW~<>{QA!O~VP@7FF&XtDm3TeDm<3&15bzqgy||FX7D zKmN6+VS_bIOtb%kf#R57#iO|;ie`KGj&K&>C>~xJidf~@abJz*B{)3c6JR58ZOR6r z7D|8E_{35!J5b$1-MRFtXav5?{d^N2Wi2{=`A-0|dgTqyXN9Nbw@ zSzZ1V=)ZH?A4P>4|0gVSuOvYxU5xw?`8{aV>9y-b_pxP}0LMWjAj)t(_RGo6DDJ>2 zpKBMGbs}hd_kFF)U#|%JmWT9`Ddg>d4Q{^2nJZuVJ`lR1M8<#|C7o zVmgw_totqr>fjwel!DvixL$NBURKKD>{#C#4=sBG+um`{oqN6{9YJs*iq?3dubDr* z(Pn21+R!;UG? zniPUmESlqqb`8wmZ^=9?DpzJj8_ZyJ3e2ev7y-n*ER=nUTbezO@-c9mUR>YBh2d99 zTPdnhi&20+9o81{r)vKyrUo-7v&7fR)-HP^Xtza3CJ9ketDj>xMkK=oa}5{+iIrd5 zyY^LyhsKZRY4mm-3`T`q^1Fj#-_D*D+}K`qqNI!FcbM0pFGgMS`FdiB!53p zWdUJY%!#@UK|Zc!B|#Rk_vd#!aDm&me{M(p)pYa(~Uuq(*`^q zdh6y_$bzl;7x~x*mj;c80^8NWy9K4jqUY%R-4rmd{~ZPLp#lJ6!*$eo(vpWnd}#Wv zaMyoWa=73Iy;~gfaH|w77aZ@|dS)P`0h9uz(g(nL;uTHP4%=0%l=9@6VPjLl!Cp!SlWpvQ@7?VVC zv2FTfwXUAd3!xVHTqIyo$0CBn>2r$XJY@=oG;$0frFx#{KsjXI+naYnrtxVy za=N4Rzx<+hP6yDMA#kc(rzZoSY7E(o?Zk$Sg=M(?qb%`i##@>cHW2xkdp=HO-00(~dws|nAsDd8e2wiy zGEQ9@K-}>Y4U}ybbnynI0r0&2-dOeoio$_T>~M_CahcL*gavpOnafNzK18odu@-CU z!#=msvqL5CGuI#oe|3kfDY0gwfp!Y;`BRbbMHVv8VqCt-;0A{+belpfR59ti8vBe~ zP@L!*Mp$8)!rRf*AVl!;ey@rL^#YtRCVf;6rWxdTtROG|IWtWDnsK{im2gy0D9n4a z2aA9Nx!nod?q@>)BrzASMAkAsx}K*82hp@C0GeISVqcm?gdRg;VFvk#0q4|rDolXh z)g`R_z}M4uFk0)c?K$1^?mP3}xxq8hHabG;3bJIm|oGW4cK{{jGVUZJD{ zsi}VwDvdCpUOW>lM^S8>z4}7=IfHAm?OSutv0{G3I)G4>f4UP~X-hRg-bpk#3Q!6|(l4~wR3Jg8;-*?9ELNhA6-3Ys# znT|W^24__u-_#%h=IXM*26pw;TKUhcmUkdCQ+FnA-gPztD|?G z`WL0`JyU~=u6QKOo`AYGVvMpYo&QLz3vysF6~o)O(Z}9^~=c0{MQo_ao0D&)-+VdVq*&NyI1fx)N4oq z%au;n*Wue8DKn;5;Tj8uQDmZIb#x1WY5A5IV7K?@IHW3-BKJ%j3d^;Q#IlgwB6dk) zWG`M_ekQX(A(l_QgpGDrCsY{FoLdqsS}deaxB1)JVj6E+zl{U(KR&8K-_)3W1g3=! zd^2zXChWwuYhTP@et4U2yV*T6cL!Y&7GJF znrlT{6aa2q+ezAm^W+Z)%(T1ead2iBk$Xkl?k8p0P>nc=x0_6$1uUgwTCOka8I#q->9g3acOSqjM|UxqrzEedTqjm1%RreGqL)0?r#%u2WRcTnMX^$T5+MMjh> zf#nDi`P`FTY><~a8>_34&3WQK){fiUlz!wr$F>;u1FXZ2ZkZ3S_Ha$%ds| zcmdOcwgg|duyU!}ATu_s4$ubwpXlckaS5{_@o`!x(soS}xT$k0B1Fk5$8DM+dbeZN zEAcbW>QBqofMOEO$TfAX{E2%xpsIb>l}0YwAv3Pr+r}^T=m0Ups)(V=yAP9hC2%UJ z20SjjmTz*5&yK)Z5q*zKS7LMS=jQ?ch_FjZ1D@J&x>%yfh;<}hUjXmZX=L8I^W?ZA z<~Ews?~Tsm))5pM`o0%BZ99Sr;XK_)yiNLQGNAc5_aM$~8rMrO24GsfHHOYUvk`H* z!7s~Zz1e6*d5LaKlj{5twNLmxyGHu8ttS|-D>FfW9!`Eb54SP9pp*j;v3y zUU=I|%jrQSd+$6s+#}*jvj6tz1E9D@C9_E0Nr*)YDU5EIbegZ`C}X6x${Oir8HnP> z+xU&`7pdPC1(fbp{K~7elu|l-%&LYm=LRRz-^QRoa7WSFJ8`;goDj`$b!?o5@_zgu zvo0H zCyv2#D4s5h(OE{E8c2*=lq8y{j%swDg)G_RSkU!RF5y6+Xhe?rB8$2|zGcc-~`dQE6`PfX}s{`fnZ7+~%rG1UT zG5H}CUDn+OGozw3LuoBSkf=8k#jP$Q1oJNv9>(`TasA?e5fF^Q*REm}nPz4V;KnD_ z)Iv|ollOPSY~JN@R#P@=qM5M9pqqXR$D@zS zH+0Tlat{|{d}q9wPagJT@B(RIFNZ(%;NnPO8Nu3{BBcktiH_h3kfGC?+HodZ+6iub z{Bj@;*fE_rZgUpNt)DqZR7UBv!;s`OB(EsO{_9m(;+s|J0R) z?}`y8NuU8@!Ys87t znA5O}p+w;c=gAB;t}jn~6vsdMOuGAWi7=6j1jum)*-w*Itob{|KKJw!SIz$Mxx$PD zxLkUkxBg>4PQF+pAOkM-2=Cu!#=g$N;ui%Zjt$;gex^H0rW#?z#s+C|eR_4P%85)b zeK~qK7DVc;WYc(HQg&x#8KS7$6JQxlSRBOt-Sbgu<87GMlsscEd>Sh| literal 0 HcmV?d00001 diff --git a/src/blocks/featured-image-block/.editorconfig b/src/blocks/featured-image-block/.editorconfig new file mode 100644 index 0000000..b5df0fc --- /dev/null +++ b/src/blocks/featured-image-block/.editorconfig @@ -0,0 +1,18 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/src/blocks/featured-image-block/.gitignore b/src/blocks/featured-image-block/.gitignore new file mode 100644 index 0000000..f66335e --- /dev/null +++ b/src/blocks/featured-image-block/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Coverage directory used by tools like istanbul +coverage + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Output of `npm pack` +*.tgz + +# Output of `wp-scripts plugin-zip` +*.zip + +# dotenv environment variables file +.env diff --git a/src/blocks/featured-image-block/build/featured-image-block/block.json b/src/blocks/featured-image-block/build/featured-image-block/block.json new file mode 100644 index 0000000..2d592b3 --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/block.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "create-block/featured-image-block", + "version": "0.1.0", + "title": "Featured Image Block", + "category": "widgets", + "icon": "format-image", + "description": "Example block scaffolded with Create Block tool.", + "supports": { + "html": false + }, + "attributes": { + "heading": { + "type": "string" + }, + "buttonText": { + "type": "string", + "default": "Learn More" + }, + "buttonLink": { + "type": "string" + }, + "backgroundImage": { + "type": "integer" + } + }, + "textdomain": "double-image", + "editorScript": "file:./index.js", + "editorStyle": "file:./index.css", + "style": "file:./style-index.css", + "render": "file:./render.php" +} \ No newline at end of file diff --git a/src/blocks/featured-image-block/build/featured-image-block/index-rtl.css b/src/blocks/featured-image-block/build/featured-image-block/index-rtl.css new file mode 100644 index 0000000..972bcf4 --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/index-rtl.css @@ -0,0 +1,8 @@ +/*!*************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/featured-image-block/editor.scss ***! + \*************************************************************************************************************************************************************************************************************************************************************/ +/** + * The following styles get applied inside the editor only. + * + * Replace them with your own styles or remove the file completely. + */ diff --git a/src/blocks/featured-image-block/build/featured-image-block/index.asset.php b/src/blocks/featured-image-block/build/featured-image-block/index.asset.php new file mode 100644 index 0000000..40f2af9 --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/index.asset.php @@ -0,0 +1 @@ + array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '239178da82c0d8063b17'); diff --git a/src/blocks/featured-image-block/build/featured-image-block/index.css b/src/blocks/featured-image-block/build/featured-image-block/index.css new file mode 100644 index 0000000..3b52862 --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/index.css @@ -0,0 +1,10 @@ +/*!*************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/featured-image-block/editor.scss ***! + \*************************************************************************************************************************************************************************************************************************************************************/ +/** + * The following styles get applied inside the editor only. + * + * Replace them with your own styles or remove the file completely. + */ + +/*# sourceMappingURL=index.css.map*/ \ No newline at end of file diff --git a/src/blocks/featured-image-block/build/featured-image-block/index.css.map b/src/blocks/featured-image-block/build/featured-image-block/index.css.map new file mode 100644 index 0000000..924e09f --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"featured-image-block/index.css","mappings":";;;AAAA;;;;EAAA,C","sources":["webpack://featured-image-block/./src/featured-image-block/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/src/blocks/featured-image-block/build/featured-image-block/index.js b/src/blocks/featured-image-block/build/featured-image-block/index.js new file mode 100644 index 0000000..27a476e --- /dev/null +++ b/src/blocks/featured-image-block/build/featured-image-block/index.js @@ -0,0 +1,42714 @@ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@10up/block-components/dist/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@10up/block-components/dist/index.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./api/index.ts": +/*!**********************!*\ + !*** ./api/index.ts ***! + \**********************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_252__) { + +"use strict"; +__nested_webpack_require_252__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_252__.d(__nested_webpack_exports__, { +/* harmony export */ registerBlockExtension: function() { return /* reexport safe */ _register_block_extension__WEBPACK_IMPORTED_MODULE_0__.registerBlockExtension; }, +/* harmony export */ registerBlockExtention: function() { return /* reexport safe */ _register_block_extension__WEBPACK_IMPORTED_MODULE_0__.registerBlockExtension; }, +/* harmony export */ registerIcons: function() { return /* reexport safe */ _register_icons__WEBPACK_IMPORTED_MODULE_1__.registerIcons; } +/* harmony export */ }); +/* harmony import */ var _register_block_extension__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_252__(/*! ./register-block-extension */ "./api/register-block-extension/index.tsx"); +/* harmony import */ var _register_icons__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_252__(/*! ./register-icons */ "./api/register-icons/index.ts"); + + + +/***/ }), + +/***/ "./api/register-block-extension/index.tsx": +/*!************************************************!*\ + !*** ./api/register-block-extension/index.tsx ***! + \************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_1521__) { + +"use strict"; +__nested_webpack_require_1521__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_1521__.d(__nested_webpack_exports__, { +/* harmony export */ registerBlockExtension: function() { return /* binding */ registerBlockExtension; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1521__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1521__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1521__(/*! @wordpress/hooks */ "@wordpress/hooks"); +/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1521__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_1521__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_1521__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_1521__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_1521__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/api/register-block-extension/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + +function registerBlockExtension(blockName, { + attributes, + classNameGenerator, + inlineStyleGenerator, + Edit, + extensionName, + order = 'after' +}) { + const isMultiBlock = Array.isArray(blockName); + const shouldApplyBlockExtension = blockType => { + if (blockName === '*' || blockName === 'all') { + return true; + } + if (isMultiBlock) { + return blockName.includes(blockType); + } + return blockType === blockName; + }; + if (blockName === '*') { + blockName = 'all'; + } + const blockNamespace = isMultiBlock ? blockName.join('-') : blockName; + const addAttributesToBlock = (settings, name) => { + if (!shouldApplyBlockExtension(name)) { + return settings; + } + return { + ...settings, + attributes: { + ...settings.attributes, + ...attributes + } + }; + }; + (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)('blocks.registerBlockType', `namespace/${blockNamespace}/${extensionName}/addAttributesToBlock`, addAttributesToBlock); + const addSettingsToBlock = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.createHigherOrderComponent)(BlockEdit => { + return props => { + const { + name, + isSelected + } = props; + if (!shouldApplyBlockExtension(name)) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockEdit, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 83, + columnNumber: 12 + } + })); + } + const shouldRenderBefore = order === 'before' && isSelected; + const shouldRenderAfter = order === 'after' && isSelected; + const shouldRenderFallback = !shouldRenderBefore && !shouldRenderAfter && isSelected; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, shouldRenderBefore && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Edit, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 92, + columnNumber: 29 + } + })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockEdit, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 93, + columnNumber: 6 + } + })), shouldRenderAfter && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Edit, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 94, + columnNumber: 28 + } + })), shouldRenderFallback && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Edit, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 95, + columnNumber: 31 + } + }))); + }; + }, 'addSettingsToBlock'); + (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)('editor.BlockEdit', `namespace/${blockNamespace}/${extensionName}/addSettingsToBlock`, addSettingsToBlock); + const addAdditionalPropertiesInEditor = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.createHigherOrderComponent)(BlockList => { + return props => { + const { + name, + attributes, + className = '', + style = {}, + wrapperProps + } = props; + if (!shouldApplyBlockExtension(name)) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockList, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 112, + columnNumber: 12 + } + })); + } + const additionalClassName = classNameGenerator(attributes); + const newClassName = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, additionalClassName); + let additionalStyles = null; + let newStyles = { + ...style + }; + if (typeof inlineStyleGenerator === 'function') { + additionalStyles = inlineStyleGenerator(attributes); + newStyles = { + ...style, + ...wrapperProps?.style, + ...additionalStyles + }; + } + if (!additionalClassName && !additionalStyles) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockList, _extends({}, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 126, + columnNumber: 12 + } + })); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(BlockList, _extends({}, props, { + className: newClassName, + wrapperProps: { + ...wrapperProps, + style: newStyles + }, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 130, + columnNumber: 5 + } + })); + }; + }, 'addAdditionalPropertiesInEditor'); + (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)('editor.BlockListBlock', `namespace/${blockNamespace}/${extensionName}/addAdditionalPropertiesInEditor`, addAdditionalPropertiesInEditor); + const addAdditionalPropertiesToSavedMarkup = (props, block, attributes) => { + const { + className, + style + } = props; + if (!shouldApplyBlockExtension(block.name)) { + return props; + } + const additionalClassName = classNameGenerator(attributes); + const newClassName = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, additionalClassName); + let additionalStyles = null; + let newStyles = { + ...style + }; + if (typeof inlineStyleGenerator === 'function') { + additionalStyles = inlineStyleGenerator(attributes); + newStyles = { + ...style, + ...additionalStyles + }; + } + if (!additionalClassName && !additionalStyles) { + return props; + } + return { + ...props, + className: newClassName, + style: newStyles + }; + }; + (0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)('blocks.getSaveContent.extraProps', `namespace/${blockNamespace}/${extensionName}/addAdditionalPropertiesToSavedMarkup`, addAdditionalPropertiesToSavedMarkup); +} + + +/***/ }), + +/***/ "./api/register-icons/index.ts": +/*!*************************************!*\ + !*** ./api/register-icons/index.ts ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_9976__) { + +"use strict"; +__nested_webpack_require_9976__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_9976__.d(__nested_webpack_exports__, { +/* harmony export */ registerIcons: function() { return /* binding */ registerIcons; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_9976__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_9976__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_9976__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); +/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_9976__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _stores__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_9976__(/*! ../../stores */ "./stores/index.ts"); + + + +function registerIcons(options) { + _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_1___default()(() => { + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_stores__WEBPACK_IMPORTED_MODULE_2__.iconStore).registerIconSet(options); + }); +} + +/***/ }), + +/***/ "./components/author/context.ts": +/*!**************************************!*\ + !*** ./components/author/context.ts ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_11479__) { + +"use strict"; +__nested_webpack_require_11479__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_11479__.d(__nested_webpack_exports__, { +/* harmony export */ AuthorContext: function() { return /* binding */ AuthorContext; }, +/* harmony export */ useAuthor: function() { return /* binding */ useAuthor; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_11479__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_11479__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + +const AuthorContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({ + avatar_urls: {}, + description: '', + email: '', + first_name: '', + id: 0, + last_name: '', + link: '', + name: '', + nickname: '', + registered_date: '', + slug: '', + url: '' +}); +const useAuthor = () => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(AuthorContext); +}; + +/***/ }), + +/***/ "./components/author/index.tsx": +/*!*************************************!*\ + !*** ./components/author/index.tsx ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_12768__) { + +"use strict"; +__nested_webpack_require_12768__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_12768__.d(__nested_webpack_exports__, { +/* harmony export */ Avatar: function() { return /* binding */ Avatar; }, +/* harmony export */ Bio: function() { return /* binding */ Bio; }, +/* harmony export */ Email: function() { return /* binding */ Email; }, +/* harmony export */ FirstName: function() { return /* binding */ FirstName; }, +/* harmony export */ LastName: function() { return /* binding */ LastName; }, +/* harmony export */ Name: function() { return /* binding */ Name; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_12768__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_12768__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_12768__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_12768__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_12768__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_12768__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_12768__(/*! ./context */ "./components/author/context.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/author/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + +const Name = props => { + const { + tagName: TagName = 'span', + ...rest + } = props; + const { + name, + link + } = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + const wrapperProps = { + ...rest + }; + if (TagName === 'a' && link) { + wrapperProps.href = link; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, wrapperProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 20, + columnNumber: 9 + } + }), name); +}; +const FirstName = props => { + const { + tagName: TagName = 'span', + ...rest + } = props; + const { + first_name: firstName + } = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 32, + columnNumber: 9 + } + }), firstName); +}; +const LastName = props => { + const { + tagName: TagName = 'span', + ...rest + } = props; + const { + last_name: lastName + } = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 44, + columnNumber: 9 + } + }), lastName); +}; +function useDefaultAvatar() { + const { + avatarURL: defaultAvatarUrl + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { + // @ts-ignore-next-line The type definitions for the block editor store are incomplete. + const { + getSettings + } = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store); + const { + __experimentalDiscussionSettings + } = getSettings(); + return __experimentalDiscussionSettings; + }, []); + return defaultAvatarUrl; +} +const Avatar = props => { + const { + ...rest + } = props; + const authorDetails = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; + const defaultAvatar = useDefaultAvatar(); + const avatarSourceUrl = avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar; + + // eslint-disable-next-line jsx-a11y/alt-text + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", _extends({ + src: avatarSourceUrl + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 71, + columnNumber: 9 + } + })); +}; +const Bio = props => { + const { + tagName: TagName = 'p', + ...rest + } = props; + const { + description + } = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 83, + columnNumber: 9 + } + }), description); +}; +const Email = props => { + const { + ...rest + } = props; + const { + email + } = (0,_context__WEBPACK_IMPORTED_MODULE_3__.useAuthor)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", _extends({ + href: `mailto:${email}` + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 95, + columnNumber: 3 + } + }), email); +}; + +/***/ }), + +/***/ "./components/clipboard-button/index.tsx": +/*!***********************************************!*\ + !*** ./components/clipboard-button/index.tsx ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_18563__) { + +"use strict"; +__nested_webpack_require_18563__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_18563__.d(__nested_webpack_exports__, { +/* harmony export */ ClipboardButton: function() { return /* binding */ ClipboardButton; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_18563__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_18563__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_18563__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_18563__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_18563__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_18563__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_18563__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_18563__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/clipboard-button/index.tsx"; + + + + + +const ClipboardButton = ({ + text = '', + disabled = false, + onSuccess = () => {}, + labels = {} +}) => { + const [hasCopied, setHasCopied] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const copy = labels.copy ? labels.copy : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Copy'); + const copied = labels.copied ? labels.copied : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Copied'); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + let timerId; + if (hasCopied) { + timerId = setTimeout(() => { + setHasCopied(false); + }, 3000); + } + return () => { + if (timerId) { + clearTimeout(timerId); + } + }; + }, [hasCopied]); + function successfullyCopied() { + /** + * The 'copied' label stays for 3 seconds. + * We don't want to save again within the same time frame. + */ + if (hasCopied) { + return; + } + onSuccess(); + setHasCopied(true); + } + const ref = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.useCopyToClipboard)(text, successfullyCopied); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { + disabled: disabled, + ref: ref, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 82, + columnNumber: 3 + } + }, hasCopied ? copied : copy); +}; + +/***/ }), + +/***/ "./components/color-settings/index.tsx": +/*!*********************************************!*\ + !*** ./components/color-settings/index.tsx ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_21881__) { + +"use strict"; +__nested_webpack_require_21881__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_21881__.d(__nested_webpack_exports__, { +/* harmony export */ ColorSetting: function() { return /* binding */ ColorSetting; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_21881__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_21881__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_21881__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_21881__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_21881__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_21881__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_21881__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_21881__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/color-settings/index.tsx"; + +/** + * WordPress dependencies + */ + + + +// eslint-disable-next-line import/prefer-default-export +const ColorSetting = ({ + label = '', + help = '', + className = '', + hideLabelFromVision = false, + colors, + value = '', + onChange, + disableCustomColors = false, + clearable = true +}) => { + const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(ColorSetting); + const id = `color-settings-${instanceId}`; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl, { + id: id, + label: label, + help: help, + className: className, + hideLabelFromVision: hideLabelFromVision, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 83, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, { + colors: colors, + value: value, + onChange: onChange, + disableCustomColors: disableCustomColors, + clearable: clearable, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 90, + columnNumber: 4 + } + })); +}; + +/***/ }), + +/***/ "./components/content-picker/DraggableChip.tsx": +/*!*****************************************************!*\ + !*** ./components/content-picker/DraggableChip.tsx ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_25060__) { + +"use strict"; +__nested_webpack_require_25060__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_25060__.d(__nested_webpack_exports__, { +/* harmony export */ DraggableChip: function() { return /* binding */ DraggableChip; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_25060__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_25060__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_25060__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_25060__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_25060__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_25060__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_25060__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_25060__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_25060__(/*! ../drag-handle */ "./components/drag-handle/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-picker/DraggableChip.tsx"; + + + + + +const ChipWrapper = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().div)` + pointer-events: none; +`; +const Chip = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().div)` + background: #1e1e1e; + opacity: 0.9; + border-radius: 2px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + color: #fff; + display: inline-flex; + margin: 0; + padding: 8px; + font-size: 0.875rem; + line-height: 1.4; + white-space: nowrap; + max-width: min(300px, 100%); + + svg { + fill: currentColor; + } +`; +const DraggableChip = props => { + let { + title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Moving 1 item', '10up-block-components') + } = props; + if (!title) { + title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Moving 1 item', '10up-block-components'); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ChipWrapper, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 41, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Chip, { + "data-testid": "draggable-chip", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 42, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex, { + justify: "center", + align: "center", + gap: 4, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 43, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 44, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalTruncate, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 45, + columnNumber: 7 + } + }, title)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_drag_handle__WEBPACK_IMPORTED_MODULE_4__.DragHandle, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 47, + columnNumber: 6 + } + })))); +}; + +/***/ }), + +/***/ "./components/content-picker/PickedItem.tsx": +/*!**************************************************!*\ + !*** ./components/content-picker/PickedItem.tsx ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_29420__) { + +"use strict"; +__nested_webpack_require_29420__.r(__nested_webpack_exports__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_29420__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_29420__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_29420__(/*! @dnd-kit/sortable */ "@dnd-kit/sortable"); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_29420__(/*! @dnd-kit/utilities */ "@dnd-kit/utilities"); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_29420__(/*! @wordpress/url */ "@wordpress/url"); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_29420__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_29420__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_29420__(/*! @wordpress/icons */ "@wordpress/icons"); +/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_icons__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_29420__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__nested_webpack_require_29420__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_29420__(/*! ../drag-handle */ "./components/drag-handle/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-picker/PickedItem.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + + + +const PickedItemContainer = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + box-sizing: border-box; + position: relative; + display: flex; + align-items: center; + gap: 8px; + padding: 6px 8px; + min-height: 36px; + max-width: 100%; + width: 100%; + color: #1e1e1e; + opacity: ${({ + isDragging +}) => isDragging ? 0.5 : 1}; + background: ${({ + isDragging +}) => isDragging ? '#f0f0f0' : 'transparent'}; + border-radius: 2px; + transition: background-color 0.1s linear; + cursor: ${({ + isDragging, + isOrderable +}) => { + if (!isOrderable) return 'default'; + return isDragging ? 'grabbing' : 'grab'; +}}; + touch-action: none; + + &:hover { + background: #f0f0f0; + + .move-up-button, + .move-down-button, + .remove-button { + opacity: 1; + pointer-events: auto; + } + } + + .components-button.has-icon { + min-width: 24px; + padding: 0; + height: 24px; + } + + &:not(:hover) .remove-button { + opacity: 0; + pointer-events: none; + } +`; +const DragHandleWrapper = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + display: ${({ + isDragging +}) => isDragging ? 'flex' : 'none'}; + align-items: center; + justify-content: center; + opacity: ${({ + isDragging +}) => isDragging ? 1 : 0}; + pointer-events: ${({ + isDragging +}) => isDragging ? 'auto' : 'none'}; + transition: opacity 0.1s linear; + position: absolute; + left: 8px; +`; +const RemoveButton = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button))` + opacity: ${({ + isDragging +}) => isDragging ? 0 : 1}; + pointer-events: ${({ + isDragging +}) => isDragging ? 'none' : 'auto'}; + transition: opacity 0.1s linear; + + &:focus { + opacity: 1; + pointer-events: auto; + } +`; +const ItemContent = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + flex: 1; + min-width: 0; + max-width: calc(100% - 80px); /* Account for the width of buttons */ + display: flex; + flex-direction: column; + gap: 2px; + padding-left: ${({ + isDragging +}) => isDragging ? '24px' : '0'}; + transition: padding-left 0.1s linear; +`; +const ItemTitle = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + font-size: 0.875rem; + line-height: 1.4; + font-weight: 500; + color: #1e1e1e; +`; +const ItemURL = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + font-size: 0.75rem; + line-height: 1.4; + color: #757575; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`; +const MoveButton = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button))` + &.components-button.has-icon { + min-width: 20px; + padding: 0; + height: 14px; + } + + &.components-button.has-icon svg { + width: 18px; + height: 18px; + } + + opacity: 0; + pointer-events: none; + transition: opacity 0.1s linear; + + &:focus { + opacity: 1; + pointer-events: auto; + } +`; +const ButtonContainer = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + display: flex; + align-items: center; + gap: 4px; + margin-left: auto; +`; +/** + * Component to render a preview of a picked item. + * + * @component + * @param {object} props - The component props. + * @param {PickedItemType} props.item - The picked item to display. + * @returns {*} React JSX + */ +const PickedItemPreview = ({ + item +}) => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemTitle, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 173, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalTruncate, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 174, + columnNumber: 5 + } + }, (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__.decodeEntities)(item.title))), item.url && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemURL, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 176, + columnNumber: 17 + } + }, (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.filterURLForDisplay)((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.safeDecodeURI)(item.url)) || '')); +}; + +/** + * PickedItem + * + * @param {PickedItemProps} props react props + * @returns {*} React JSX + */ +const PickedItem = ({ + item, + isOrderable = false, + handleItemDelete, + id, + isDragging = false, + positionInSet = 1, + setSize = 1, + onMoveUp, + onMoveDown, + PickedItemPreviewComponent +}) => { + const { + attributes, + listeners, + setNodeRef, + transform, + transition + } = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.useSortable)({ + id + }); + const style = { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_3__.CSS.Transform.toString(transform), + transition + }; + const isFirst = positionInSet === 1; + const isLast = positionInSet === setSize; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalTreeGridRow, { + level: 1, + positionInSet: positionInSet, + setSize: setSize, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 212, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PickedItemContainer, _extends({ + ref: setNodeRef, + style: style + }, attributes, listeners, { + isDragging: isDragging, + isOrderable: isOrderable, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 213, + columnNumber: 4 + } + }), isOrderable && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(DragHandleWrapper, { + isDragging: isDragging, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 222, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_drag_handle__WEBPACK_IMPORTED_MODULE_9__.DragHandle, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 223, + columnNumber: 7 + } + })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemContent, { + isDragging: isDragging, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 226, + columnNumber: 5 + } + }, PickedItemPreviewComponent ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PickedItemPreviewComponent, { + item: item, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 228, + columnNumber: 7 + } + }) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PickedItemPreview, { + item: item, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 230, + columnNumber: 7 + } + })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ButtonContainer, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 233, + columnNumber: 5 + } + }, isOrderable && !isDragging && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalVStack, { + spacing: 0, + className: "move-buttons", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 235, + columnNumber: 7 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(MoveButton, { + disabled: isFirst, + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__.chevronUp, + onClick: e => { + e.stopPropagation(); + onMoveUp?.(); + }, + className: "move-up-button", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 236, + columnNumber: 8 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.VisuallyHidden, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 245, + columnNumber: 9 + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Move item up', '10up-block-components'))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(MoveButton, { + disabled: isLast, + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__.chevronDown, + onClick: e => { + e.stopPropagation(); + onMoveDown?.(); + }, + className: "move-down-button", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 249, + columnNumber: 8 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.VisuallyHidden, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 258, + columnNumber: 9 + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Move item down', '10up-block-components')))), !isDragging && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(RemoveButton, { + className: "remove-button", + icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__.close, + size: "small", + variant: "tertiary", + isDestructive: true, + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Remove item', '10up-block-components'), + onClick: e => { + e.stopPropagation(); + handleItemDelete(item); + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 265, + columnNumber: 7 + } + })))); +}; +/* harmony default export */ __nested_webpack_exports__["default"] = (PickedItem); + +/***/ }), + +/***/ "./components/content-picker/SortableList.tsx": +/*!****************************************************!*\ + !*** ./components/content-picker/SortableList.tsx ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_42797__) { + +"use strict"; +__nested_webpack_require_42797__.r(__nested_webpack_exports__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_42797__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_42797__(/*! @dnd-kit/core */ "@dnd-kit/core"); +/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_42797__(/*! @dnd-kit/sortable */ "@dnd-kit/sortable"); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_42797__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_42797__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_42797__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_42797__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_42797__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__nested_webpack_require_42797__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _PickedItem__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_42797__(/*! ./PickedItem */ "./components/content-picker/PickedItem.tsx"); +/* harmony import */ var _DraggableChip__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_42797__(/*! ./DraggableChip */ "./components/content-picker/DraggableChip.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-picker/SortableList.tsx"; + + + + + + + + + + + +const dropAnimation = { + ..._dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.defaultDropAnimation, + dragSourceOpacity: 0.5 +}; +function getEntityKind(mode) { + let type; + switch (mode) { + case 'post': + type = 'postType'; + break; + case 'user': + type = 'root'; + break; + default: + type = 'taxonomy'; + break; + } + return type; +} +const StyledTreeGrid = _emotion_styled__WEBPACK_IMPORTED_MODULE_7___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalTreeGrid))` + max-width: 100%; + display: block; + + & tbody, + & tr, + & td { + display: block; + max-width: 100%; + width: 100%; + } +`; +const SortableList = ({ + posts, + isOrderable = false, + handleItemDelete, + mode = 'post', + setPosts, + PickedItemPreviewComponent +}) => { + const hasMultiplePosts = posts.length > 1; + const [activeId, setActiveId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const entityKind = getEntityKind(mode); + + // Fetch all posts data at once + const preparedItems = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => { + // @ts-ignore-next-line - The WordPress types are missing the hasFinishedResolution method. + const { + getEntityRecord, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_6__.store); + return posts.reduce((acc, item) => { + const getEntityRecordParameters = [entityKind, item.type, item.id]; + const result = getEntityRecord(...getEntityRecordParameters); + if (result) { + let newItem; + if (mode === 'post') { + const post = result; + newItem = { + title: post.title.rendered, + url: post.link, + id: post.id, + type: post.type + }; + } else if (mode === 'user') { + const user = result; + newItem = { + title: user.name, + url: user.link, + id: user.id, + type: 'user' + }; + } else { + const taxonomy = result; + newItem = { + title: taxonomy.name, + url: taxonomy.link, + id: taxonomy.id, + type: taxonomy.taxonomy + }; + } + if (item.uuid) { + newItem.uuid = item.uuid; + } + acc[item.uuid] = newItem; + } else if (hasFinishedResolution('getEntityRecord', getEntityRecordParameters)) { + acc[item.uuid] = null; + } + return acc; + }, {}); + }, [posts, entityKind]); + const items = posts.map(item => item.uuid); + const sensors = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useSensors)((0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.MouseSensor, { + activationConstraint: { + distance: 5 + } + }), (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.TouchSensor, { + activationConstraint: { + delay: 250, + tolerance: 5 + } + })); + const handleDragStart = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + setActiveId(event.active.id); + }, []); + const handleDragEnd = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + const { + active, + over + } = event; + setActiveId(null); + if (active.id !== over?.id) { + const oldIndex = posts.findIndex(post => post.uuid === active.id); + const newIndex = posts.findIndex(post => post.uuid === over?.id); + setPosts((0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.arrayMove)(posts, oldIndex, newIndex)); + } + }, [posts, setPosts]); + const handleDragCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + setActiveId(null); + }, []); + const activePost = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activeId ? preparedItems?.[activeId] : null, [activeId, preparedItems]); + const renderItems = items => { + return items.map((post, index) => { + const preparedItem = preparedItems[post.uuid]; + if (!preparedItem) return null; + const handleMoveUp = () => { + if (index === 0) return; + setPosts((0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.arrayMove)(posts, index, index - 1)); + }; + const handleMoveDown = () => { + if (index === items.length - 1) return; + setPosts((0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.arrayMove)(posts, index, index + 1)); + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_PickedItem__WEBPACK_IMPORTED_MODULE_8__["default"], { + isOrderable: hasMultiplePosts && isOrderable, + key: post.uuid, + handleItemDelete: handleItemDelete, + item: preparedItem, + mode: mode, + id: post.uuid, + positionInSet: index + 1, + setSize: items.length, + onMoveUp: handleMoveUp, + onMoveDown: handleMoveDown, + PickedItemPreviewComponent: PickedItemPreviewComponent, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 206, + columnNumber: 5 + } + }); + }); + }; + + // If not orderable or only one item, render simple list + if (!isOrderable || !hasMultiplePosts) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledTreeGrid, { + className: "block-editor-list-view-tree", + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Selected items list'), + onCollapseRow: () => {}, + onExpandRow: () => {}, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 226, + columnNumber: 4 + } + }, renderItems(posts)); + } + + // If orderable, wrap with drag and drop context + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.DndContext, { + sensors: sensors, + collisionDetection: _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.closestCenter, + onDragStart: handleDragStart, + onDragEnd: handleDragEnd, + onDragCancel: handleDragCancel, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 239, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledTreeGrid, { + className: "block-editor-list-view-tree", + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Selected items list'), + onCollapseRow: () => {}, + onExpandRow: () => {}, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 246, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.SortableContext, { + items: items, + strategy: _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_2__.verticalListSortingStrategy, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 252, + columnNumber: 5 + } + }, renderItems(posts))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.DragOverlay, { + dropAnimation: dropAnimation, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 256, + columnNumber: 4 + } + }, activeId && activePost ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_DraggableChip__WEBPACK_IMPORTED_MODULE_9__.DraggableChip, { + title: activePost.title, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 257, + columnNumber: 31 + } + }) : null)); +}; +/* harmony default export */ __nested_webpack_exports__["default"] = (SortableList); + +/***/ }), + +/***/ "./components/content-picker/index.tsx": +/*!*********************************************!*\ + !*** ./components/content-picker/index.tsx ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_53748__) { + +"use strict"; +__nested_webpack_require_53748__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_53748__.d(__nested_webpack_exports__, { +/* harmony export */ ContentPicker: function() { return /* binding */ ContentPicker; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_53748__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_53748__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_53748__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_53748__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_53748__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_53748__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_53748__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_53748__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_53748__(/*! uuid */ "uuid"); +/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_53748__.n(uuid__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _content_search__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_53748__(/*! ../content-search */ "./components/content-search/index.tsx"); +/* harmony import */ var _SortableList__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_53748__(/*! ./SortableList */ "./components/content-picker/SortableList.tsx"); +/* harmony import */ var _styled_components_context__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_53748__(/*! ../styled-components-context */ "./components/styled-components-context/index.tsx"); +/* harmony import */ var _content_search_SearchItem__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_53748__(/*! ../content-search/SearchItem */ "./components/content-search/SearchItem.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-picker/index.tsx"; + + + + + + + + + + +const NAMESPACE = 'tenup-content-picker'; + +/** + * Unfortunately, we had to use !important because on PickedItem we couldn't @emotion/styled css + * as it was breaking sortability from react-sortable-hoc + */ +const StyleWrapper = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + & .block-editor-link-control__search-item { + cursor: default; + + &:hover { + background: transparent; + } + } +`; + +/** + * Without this, the flex parents will limit the width of the picker. Fixes view when the results + * all have short titles. + */ +const ContentPickerWrapper = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().div)` + width: 100%; +`; +const ContentPicker = ({ + label = '', + hideLabelFromVision = true, + mode = 'post', + contentTypes = ['post', 'page'], + placeholder = '', + onPickChange = ids => { + console.log('Content picker list change', ids); // eslint-disable-line no-console + }, + queryFilter = undefined, + maxContentItems = 1, + isOrderable = false, + singlePickedLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You have selected the following item:', '10up-block-components'), + multiPickedLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You have selected the following items:', '10up-block-components'), + content = [], + uniqueContentItems = true, + excludeCurrentPost = true, + perPage = 20, + fetchInitialResults = false, + renderItemType = _content_search_SearchItem__WEBPACK_IMPORTED_MODULE_8__.defaultRenderItemType, + renderItem = undefined, + PickedItemPreviewComponent = undefined +}) => { + const currentPostId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.select)('core/editor')?.getCurrentPostId(); + + /** + * This legacy code allows you to pass in only IDs to content like [ 1, 4, 5 ]. + * This really shouldn't be done as of version 1.5.0. + */ + if (content.length && typeof content[0] !== 'object') { + for (let i = 0; i < content.length; i++) { + content[i] = { + id: content[i], + type: contentTypes[0] + }; + } + } + const handleSelect = item => { + const newItems = [{ + id: item.id, + uuid: (0,uuid__WEBPACK_IMPORTED_MODULE_4__.v4)(), + type: 'subtype' in item && item.subtype ? item.subtype : item.type + }, ...content]; + onPickChange(newItems); + }; + const onDeleteItem = deletedItem => { + const newItems = content.filter(({ + id, + uuid + }) => { + if (deletedItem.uuid) { + return uuid !== deletedItem.uuid; + } + return id !== deletedItem.id; + }); + onPickChange(newItems); + }; + const excludeItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const items = uniqueContentItems ? [...content] : []; + if (excludeCurrentPost && currentPostId) { + items.push({ + id: currentPostId + }); + } + return items; + }, [content, currentPostId, excludeCurrentPost, uniqueContentItems]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_styled_components_context__WEBPACK_IMPORTED_MODULE_7__.StyledComponentContext, { + cacheKey: "tenup-component-content-picker", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 134, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ContentPickerWrapper, { + className: NAMESPACE, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 135, + columnNumber: 4 + } + }, !content.length || content.length && content.length < maxContentItems ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_content_search__WEBPACK_IMPORTED_MODULE_5__.ContentSearch, { + placeholder: placeholder, + label: label, + hideLabelFromVision: hideLabelFromVision, + excludeItems: excludeItems, + onSelectItem: handleSelect, + contentTypes: contentTypes, + mode: mode, + queryFilter: queryFilter, + perPage: perPage, + fetchInitialResults: fetchInitialResults, + renderItemType: renderItemType, + renderItem: renderItem, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 137, + columnNumber: 6 + } + }) : label && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + style: { + marginBottom: '8px' + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 153, + columnNumber: 7 + } + }, label), Boolean(content?.length) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyleWrapper, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 164, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { + style: { + marginTop: '15px', + marginBottom: '2px', + display: 'block' + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 165, + columnNumber: 7 + } + }, content.length > 1 ? multiPickedLabel : singlePickedLabel), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { + className: "block-editor-link-control__search-items", + style: { + padding: 0 + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 175, + columnNumber: 7 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_SortableList__WEBPACK_IMPORTED_MODULE_6__["default"], { + posts: content, + handleItemDelete: onDeleteItem, + isOrderable: isOrderable, + mode: mode, + setPosts: onPickChange, + PickedItemPreviewComponent: PickedItemPreviewComponent, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 179, + columnNumber: 8 + } + }))))); +}; + +/***/ }), + +/***/ "./components/content-search/SearchItem.tsx": +/*!**************************************************!*\ + !*** ./components/content-search/SearchItem.tsx ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_62317__) { + +"use strict"; +__nested_webpack_require_62317__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_62317__.d(__nested_webpack_exports__, { +/* harmony export */ defaultRenderItemType: function() { return /* binding */ defaultRenderItemType; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_62317__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_62317__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_62317__(/*! @wordpress/url */ "@wordpress/url"); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_62317__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_62317__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_62317__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_62317__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-search/SearchItem.tsx"; + + + + + + +const SearchItemWrapper = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button))` + &&& { + display: flex; + text-align: left; + width: 100%; + justify-content: space-between; + align-items: center; + border-radius: 2px; + box-sizing: border-box; + height: auto !important; + padding: 0.3em 0.7em; + overflow: hidden; + + &:hover { + /* Add opacity background to support future color changes */ + /* Reduce background from #ddd to 0.05 for text contrast */ + background-color: rgba(0, 0, 0, 0.05); + } + } +`; +const SearchItemHeader = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + display: flex; + flex-direction: column; + align-items: flex-start; +`; +const SearchItemTitle = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + padding-right: ${({ + showType +}) => showType ? 0 : undefined}; +`; +const SearchItemInfo = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + padding-right: ${({ + showType +}) => showType ? 0 : undefined}; +`; +const SearchItemType = (_emotion_styled__WEBPACK_IMPORTED_MODULE_1___default().span)` + background-color: rgba(0, 0, 0, 0.05); + color: black; + padding: 2px 4px; + text-transform: capitalize; + border-radius: 2px; + flex-shrink: 0; +`; +const StyledTextHighlight = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.TextHighlight))` + margin: 0 !important; + padding: 0 !important; +`; +function defaultRenderItemType(suggestion) { + // Rename 'post_tag' to 'tag'. Ideally, the API would return the localized CPT or taxonomy label. + if (suggestion.type === 'post_tag') { + return 'tag'; + } + if (suggestion.subtype) { + return suggestion.subtype; + } + return suggestion.type; +} +const SearchItem = ({ + item: suggestion, + onSelect: onClick, + searchTerm = '', + id = '', + contentTypes, + renderType = defaultRenderItemType +}) => { + const showType = !!(suggestion.type && contentTypes.length > 1); + const richTextContent = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.create)({ + html: suggestion.title + }); + const textContent = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.getTextContent)(richTextContent); + const titleContent = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(textContent); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Tooltip, { + text: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(suggestion.title), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 91, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchItemWrapper, { + id: id, + onClick: onClick, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 92, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchItemHeader, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 93, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchItemTitle, { + showType: showType, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 94, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledTextHighlight, { + text: titleContent, + highlight: searchTerm, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 95, + columnNumber: 7 + } + })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchItemInfo, { + "aria-hidden": true, + showType: showType, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 97, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalTruncate, { + numberOfLines: 1, + limit: 55, + ellipsizeMode: "middle", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 98, + columnNumber: 7 + } + }, (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.filterURLForDisplay)((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.safeDecodeURI)(suggestion.url)) || ''))), showType && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchItemType, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 103, + columnNumber: 18 + } + }, renderType(suggestion)))); +}; +/* harmony default export */ __nested_webpack_exports__["default"] = (SearchItem); + +/***/ }), + +/***/ "./components/content-search/index.tsx": +/*!*********************************************!*\ + !*** ./components/content-search/index.tsx ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_69606__) { + +"use strict"; +__nested_webpack_require_69606__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_69606__.d(__nested_webpack_exports__, { +/* harmony export */ ContentSearch: function() { return /* binding */ ContentSearchWrapper; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_69606__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_69606__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_69606__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_69606__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_69606__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_69606__(/*! @tanstack/react-query */ "@tanstack/react-query"); +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_69606__.n(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _SearchItem__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_69606__(/*! ./SearchItem */ "./components/content-search/SearchItem.tsx"); +/* harmony import */ var _styled_components_context__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_69606__(/*! ../styled-components-context */ "./components/styled-components-context/index.tsx"); +/* harmony import */ var _hooks_use_on_click_outside__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_69606__(/*! ../../hooks/use-on-click-outside */ "./hooks/use-on-click-outside.ts"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_69606__(/*! ./utils */ "./components/content-search/utils.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/content-search/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + + + + +const queryClient = new _tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClient(); + +// Equalize height of list icons to match loader in order to reduce jumping. +const listMinHeight = '46px'; +const List = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().ul)` + max-height: 350px; + overflow-y: auto; + list-style: none !important; + margin: 0; + padding: 0 !important; +`; +const ListItem = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().li)` + margin-bottom: 0; +`; +const StyledSpinner = _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner))` + /* Custom styles to reduce jumping while loading the results */ + min-height: ${listMinHeight}; + display: flex; + align-items: center; + justify-content: center; +`; +const LoadingContainer = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().div)` + display: flex; + justify-content: center; + margin-top: 1em; + + button { + /* Reduce the jumping of the width when text changes to "Loading" */ + min-width: 90px; + } +`; +const StyledNavigableMenu = _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.NavigableMenu))` + width: 100%; +`; +const StyledSearchControl = _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default()((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SearchControl))` + width: 100%; +`; +const StyledNoResults = (_emotion_styled__WEBPACK_IMPORTED_MODULE_3___default().li)` + color: inherit; + cursor: default; + padding-left: 3px; +`; +const ContentSearchNoResults = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledNoResults, { + className: "tenup-content-search-list-item components-button", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 69, + columnNumber: 2 + } +}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Nothing found.', '10up-block-components')); +const ContentSearch = ({ + onSelectItem = () => { + console.log('Select!'); // eslint-disable-line no-console + }, + placeholder = '', + label, + hideLabelFromVision = true, + contentTypes = ['post', 'page'], + mode = 'post', + perPage = 20, + queryFilter = query => query, + excludeItems = [], + renderItemType = undefined, + renderItem: SearchResultItem = _SearchItem__WEBPACK_IMPORTED_MODULE_6__["default"], + fetchInitialResults +}) => { + const [searchString, setSearchString] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const [isFocused, setIsFocused] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const searchContainer = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const handleItemSelection = item => { + setSearchString(''); + setIsFocused(false); + onSelectItem(item); + }; + const clickOutsideRef = (0,_hooks_use_on_click_outside__WEBPACK_IMPORTED_MODULE_8__.useOnClickOutside)(() => { + setIsFocused(false); + }); + const mergedRef = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)([searchContainer, clickOutsideRef]); + const { + status, + data, + error, + isFetching, + isFetchingNextPage, + fetchNextPage, + hasNextPage + } = (0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.useInfiniteQuery)({ + queryKey: ['search', searchString, contentTypes.join(','), mode, perPage, queryFilter], + queryFn: async ({ + pageParam = 1 + }) => (0,_utils__WEBPACK_IMPORTED_MODULE_9__.fetchSearchResults)({ + keyword: searchString, + page: pageParam, + mode, + perPage, + contentTypes, + queryFilter, + excludeItems + }), + getNextPageParam: lastPage => lastPage.nextPage, + getPreviousPageParam: firstPage => firstPage.previousPage, + initialPageParam: 1 + }); + const searchResults = data?.pages.map(page => page?.results).flat() || undefined; + const hasSearchString = !!searchString.length; + const hasSearchResults = status === 'success' && searchResults && !!searchResults.length; + const hasInitialResults = fetchInitialResults && isFocused; + const hasNoResults = !!error || !isFetching && !hasSearchResults; + const isPending = status === 'pending'; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledNavigableMenu, { + ref: mergedRef, + orientation: "vertical", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 148, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledSearchControl, { + value: searchString, + onChange: newSearchString => { + setSearchString(newSearchString); + }, + label: label, + hideLabelFromVision: hideLabelFromVision, + placeholder: placeholder, + autoComplete: "off", + onFocus: () => { + setIsFocused(true); + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 149, + columnNumber: 4 + } + }), hasSearchString || hasInitialResults ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(List, { + className: "tenup-content-search-list", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 165, + columnNumber: 6 + } + }, isPending && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledSpinner, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 166, + columnNumber: 21 + } + }), hasNoResults && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ContentSearchNoResults, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 167, + columnNumber: 24 + } + }), hasSearchResults && searchResults.map(item => { + const selectItem = () => { + handleItemSelection(item); + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItem, { + key: item.id, + className: "tenup-content-search-list-item", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 174, + columnNumber: 10 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SearchResultItem, { + item: item, + onSelect: selectItem, + searchTerm: searchString, + contentTypes: contentTypes, + renderType: renderItemType, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 178, + columnNumber: 11 + } + })); + })), hasSearchResults && hasNextPage && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(LoadingContainer, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 191, + columnNumber: 7 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { + onClick: () => fetchNextPage(), + variant: "secondary", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 192, + columnNumber: 8 + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Load more', '10up-block-components'))), isFetchingNextPage && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledSpinner, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 198, + columnNumber: 29 + } + })) : null); +}; +const ContentSearchWrapper = props => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_styled_components_context__WEBPACK_IMPORTED_MODULE_7__.StyledComponentContext, { + cacheKey: "tenup-component-content-search", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 207, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_5__.QueryClientProvider, { + client: queryClient, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 208, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ContentSearch, _extends({}, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 209, + columnNumber: 5 + } + })))); +}; + + +/***/ }), + +/***/ "./components/content-search/utils.ts": +/*!********************************************!*\ + !*** ./components/content-search/utils.ts ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_81451__) { + +"use strict"; +__nested_webpack_require_81451__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_81451__.d(__nested_webpack_exports__, { +/* harmony export */ fetchSearchResults: function() { return /* binding */ fetchSearchResults; }, +/* harmony export */ filterOutExcludedItems: function() { return /* binding */ filterOutExcludedItems; }, +/* harmony export */ normalizeResults: function() { return /* binding */ normalizeResults; }, +/* harmony export */ prepareSearchQuery: function() { return /* binding */ prepareSearchQuery; } +/* harmony export */ }); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_81451__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_81451__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_81451__(/*! @wordpress/url */ "@wordpress/url"); +/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_81451__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__); +/* eslint-disable no-case-declarations */ + + + +const filterOutExcludedItems = ({ + results, + excludeItems +}) => { + return results.filter(result => { + let keep = true; + if (excludeItems.length) { + keep = excludeItems.every(item => item.id !== result.id); + } + return keep; + }); +}; +/* + * Prepares a search query based on the given keyword and page number. + */ +const prepareSearchQuery = ({ + keyword, + page, + mode, + perPage, + contentTypes, + queryFilter +}) => { + let searchQuery; + switch (mode) { + case 'user': + searchQuery = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)('wp/v2/users', { + search: keyword + }); + break; + default: + searchQuery = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)('wp/v2/search', { + search: keyword, + subtype: contentTypes.join(','), + type: mode, + _embed: true, + per_page: perPage, + page + }); + break; + } + return queryFilter(searchQuery, { + perPage, + page, + contentTypes, + mode, + keyword + }); +}; +/* + * Depending on the mode value, this method normalizes the format + * of the result array. + */ +const normalizeResults = ({ + mode, + results, + excludeItems +}) => { + const filteredResults = filterOutExcludedItems({ + results, + excludeItems + }); + return filteredResults.map(item => { + switch (mode) { + case 'user': + const userItem = item; + return { + id: userItem.id, + subtype: mode, + title: userItem.name, + type: mode, + url: userItem.link + }; + default: + const searchItem = item; + return { + id: searchItem.id, + subtype: searchItem.subtype, + title: searchItem.title, + type: searchItem.type, + url: searchItem.url + }; + } + }); +}; +async function fetchSearchResults({ + keyword, + page, + mode, + perPage, + contentTypes, + queryFilter, + excludeItems +}) { + const searchQueryString = prepareSearchQuery({ + keyword, + page, + mode, + perPage, + contentTypes, + queryFilter + }); + const response = await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({ + path: searchQueryString, + parse: false + }); + const totalPages = parseInt(response.headers && response.headers.get('X-WP-TotalPages') || '0', 10); + let results; + switch (mode) { + case 'user': + results = await response.json(); + break; + default: + results = await response.json(); + break; + } + const normalizedResults = normalizeResults({ + results, + excludeItems, + mode + }); + const hasNextPage = totalPages > page; + const hasPreviousPage = page > 1; + return { + results: normalizedResults, + nextPage: hasNextPage ? page + 1 : undefined, + previousPage: hasPreviousPage ? page - 1 : undefined + }; +} + +/***/ }), + +/***/ "./components/counter/index.tsx": +/*!**************************************!*\ + !*** ./components/counter/index.tsx ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_85744__) { + +"use strict"; +__nested_webpack_require_85744__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_85744__.d(__nested_webpack_exports__, { +/* harmony export */ CircularProgressBar: function() { return /* binding */ CircularProgressBar; }, +/* harmony export */ Counter: function() { return /* binding */ Counter; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_85744__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_85744__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_85744__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_85744__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_85744__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_85744__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _styled_components_context__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_85744__(/*! ../styled-components-context */ "./components/styled-components-context/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/counter/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + +const StyledSvg = _emotion_styled__WEBPACK_IMPORTED_MODULE_2___default()('svg')` + transform: rotate(-90deg); + + & circle { + transition: stroke-dashoffset 0.3s linear; + stroke: currentColor; + stroke-width: 1em; + opacity: 0.3; + } + + & path { + fill: #46b450; + } + + & .bar { + stroke: #46b450; + opacity: 1; + } + + &.tenup--block-components__circular-progress { + &.is-over-limit { + & path { + fill: #dc3232; + } + + & .bar { + stroke: #dc3232; + opacity: 1; + } + } + + &.is-approaching-limit { + & path { + fill: #ffb900; + } + + & .bar { + stroke: #ffb900; + opacity: 1; + } + } + } +`; +const StyledCounter = _emotion_styled__WEBPACK_IMPORTED_MODULE_2___default()('div')` + display: flex; + align-items: center; + justify-content: center; + gap: 0.5em; + font-variant-numeric: tabular-nums; +`; +const CircularProgressBar = ({ + percentage +}) => { + const radius = 90; + const circumference = 2 * Math.PI * radius; + const normalizedPercentage = Math.max(0, Math.min(percentage, 100)); + const strokeDashoffset = (100 - normalizedPercentage) / 100 * circumference; + const isApproachingLimit = percentage > 80; + const isOverLimit = percentage >= 100; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_styled_components_context__WEBPACK_IMPORTED_MODULE_3__.StyledComponentContext, { + cacheKey: "tenup-component-circular-progress-bar", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 78, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledSvg, { + xmlns: "http://www.w3.org/2000/svg", + width: "20", + height: "20", + viewBox: "0 0 200 200", + version: "1.1", + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('tenup--block-components__circular-progress', { + 'is-over-limit': isOverLimit, + 'is-approaching-limit': isApproachingLimit && !isOverLimit + }), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 79, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", { + cx: "100", + cy: "100", + r: radius, + fill: "transparent", + strokeDasharray: circumference, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 90, + columnNumber: 5 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", { + className: "bar", + cx: "100", + cy: "100", + r: radius, + fill: "transparent", + strokeDasharray: circumference, + strokeDashoffset: strokeDashoffset, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 97, + columnNumber: 5 + } + }), isApproachingLimit && !isOverLimit && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + style: { + transform: 'rotate(90deg)', + transformOrigin: 'center', + fill: '#ffb900' + }, + d: "M100,31.2c38,0,68.8,30.8,68.8,68.8S138,168.8,100,168.8S31.2,138,31.2,100S62,31.2,100,31.2z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 108, + columnNumber: 7 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + style: { + transform: 'rotate(90deg)', + transformOrigin: 'center', + fill: '#000' + }, + d: "M108.9,140.8c2.1-2,3.2-4.7,3.2-8.3c0-3.6-1-6.4-3.1-8.3 c-2.1-2-5.1-3-9.1-3c-4,0-7.1,1-9.2,3c-2.1,2-3.2,4.7-3.2,8.3c0,3.5,1.1,6.3,3.3,8.3c2.2,2,5.2,2.9,9.1,2.9S106.8,142.7,108.9,140.8 z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 116, + columnNumber: 7 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + style: { + transform: 'rotate(90deg)', + transformOrigin: 'center', + fill: '#000' + }, + d: "M109.7,111.9 l3-55.6H87.3l3,55.6C90.3,111.9,109.7,111.9,109.7,111.9z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 124, + columnNumber: 7 + } + })), isOverLimit && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + style: { + transform: 'rotate(90deg)', + transformOrigin: 'center' + }, + d: "M100,168.8c38,0,68.8-30.8,68.8-68.8c0-38-30.8-68.8-68.8-68.8C62,31.2,31.2,62,31.2,100 C31.2,138,62,168.8,100,168.8z M127,73c2.2,2.2,2.2,5.9,0,8.1L108.1,100l18.9,18.9c2.2,2.2,2.2,5.9,0,8.1c-2.2,2.2-5.9,2.2-8.1,0 L100,108.1L81.1,127c-2.2,2.2-5.9,2.2-8.1,0c-2.2-2.2-2.2-5.9,0-8.1L91.9,100L73,81.1c-2.2-2.2-2.2-5.9,0-8.1s5.9-2.2,8.1,0 L100,91.9L118.9,73C121.1,70.8,124.7,70.8,127,73z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 135, + columnNumber: 6 + } + }))); +}; +const Counter = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ + count, + limit, + ...rest +}, ref) => { + const percentage = count / limit * 100; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_styled_components_context__WEBPACK_IMPORTED_MODULE_3__.StyledComponentContext, { + cacheKey: "tenup-component-counter", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 170, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledCounter, _extends({ + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('tenup--block-components__character-count', { + 'is-over-limit': count > limit + }), + ref: ref + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 171, + columnNumber: 4 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: "tenup--block-components__character-count__label", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 178, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { + className: "tenup--block-components__character-count__count", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 179, + columnNumber: 6 + } + }, count), ' ', "/", ' ', (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { + className: "tenup--block-components__character-count__limit", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 181, + columnNumber: 6 + } + }, limit)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(CircularProgressBar, { + percentage: percentage, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 183, + columnNumber: 5 + } + }))); +}); + + +/***/ }), + +/***/ "./components/custom-block-appender/index.tsx": +/*!****************************************************!*\ + !*** ./components/custom-block-appender/index.tsx ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_94742__) { + +"use strict"; +__nested_webpack_require_94742__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_94742__.d(__nested_webpack_exports__, { +/* harmony export */ CustomBlockAppender: function() { return /* binding */ CustomBlockAppender; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_94742__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_94742__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_94742__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_94742__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_94742__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_94742__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/custom-block-appender/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + +/* + * CustomBlockAppender. + * + * Provide a Button component to trigger the inserter. + * Any undocumented props are spread onto the Button component. + */ +const CustomBlockAppender = ({ + rootClientId, + buttonText = '', + icon = 'plus', + className = 'custom-block-appender', + ...buttonProps +}) => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.Inserter, { + isAppender: true, + rootClientId: rootClientId, + renderToggle: ({ + onToggle, + disabled + }) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, _extends({ + className: `tenup-${className}`, + onClick: onToggle, + disabled: disabled, + icon: icon + }, buttonProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 37, + columnNumber: 5 + } + }), buttonText), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 27, + columnNumber: 3 + } + }); +}; + +/***/ }), + +/***/ "./components/drag-handle/index.tsx": +/*!******************************************!*\ + !*** ./components/drag-handle/index.tsx ***! + \******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_97750__) { + +"use strict"; +__nested_webpack_require_97750__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_97750__.d(__nested_webpack_exports__, { +/* harmony export */ DragHandle: function() { return /* binding */ DragHandle; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_97750__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_97750__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/drag-handle/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +/** + * Renders an SVG drag handle. + * + * @param {object} props The prop object. + * @returns {*} React JSX + */ + +const DragHandle = props => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", _extends({ + style: { + marginRight: '10px', + cursor: 'grab', + flexShrink: 0 + }, + width: "18", + height: "18", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 18 18", + role: "img", + "aria-hidden": "true", + focusable: "false" +}, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 11, + columnNumber: 2 + } +}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + d: "M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 22, + columnNumber: 3 + } +})); + +/***/ }), + +/***/ "./components/icon-picker/icon-picker-toolbar-button.tsx": +/*!***************************************************************!*\ + !*** ./components/icon-picker/icon-picker-toolbar-button.tsx ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_99909__) { + +"use strict"; +__nested_webpack_require_99909__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_99909__.d(__nested_webpack_exports__, { +/* harmony export */ IconPickerToolbarButton: function() { return /* binding */ IconPickerToolbarButton; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_99909__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_99909__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_99909__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_99909__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_99909__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_99909__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_99909__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_99909__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _icon_picker__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_99909__(/*! ./icon-picker */ "./components/icon-picker/icon-picker.tsx"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_99909__(/*! ./icon */ "./components/icon-picker/icon.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/icon-picker/icon-picker-toolbar-button.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + +const StyledIconPickerDropdown = _emotion_styled__WEBPACK_IMPORTED_MODULE_3___default()((0,_icon_picker__WEBPACK_IMPORTED_MODULE_4__.IconPicker))` + margin: 6px; + width: 248px; + height: 248px; +`; +const IconPickerToolbarButton = props => { + const { + value, + buttonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select Icon') + } = props; + const buttonIcon = value?.name && value?.iconSet ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icon__WEBPACK_IMPORTED_MODULE_5__.Icon, { + name: value?.name, + iconSet: value?.iconSet, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 25, + columnNumber: 35 + } + }) : null; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Dropdown, { + className: "component-icon-picker-toolbar-button", + contentClassName: "component-icon-picker-toolbar-button__content", + popoverProps: { + placement: 'bottom-start' + }, + renderToggle: ({ + isOpen, + onToggle + }) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToolbarButton, { + onClick: onToggle, + "aria-expanded": isOpen, + icon: buttonIcon, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 35, + columnNumber: 5 + } + }, buttonLabel), + renderContent: () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledIconPickerDropdown, _extends({}, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 39, + columnNumber: 25 + } + })), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 28, + columnNumber: 3 + } + }); +}; + +/***/ }), + +/***/ "./components/icon-picker/icon-picker.tsx": +/*!************************************************!*\ + !*** ./components/icon-picker/icon-picker.tsx ***! + \************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_104269__) { + +"use strict"; +__nested_webpack_require_104269__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_104269__.d(__nested_webpack_exports__, { +/* harmony export */ IconPicker: function() { return /* binding */ IconPicker; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_104269__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_104269__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_104269__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_104269__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_104269__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_104269__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_104269__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_104269__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_104269__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_104269__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var react_window__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_104269__(/*! react-window */ "react-window"); +/* harmony import */ var react_window__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_104269__.n(react_window__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _hooks_use_icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_104269__(/*! ../../hooks/use-icons */ "./hooks/use-icons/index.ts"); +/* harmony import */ var _hooks_use_filtered_list__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_104269__(/*! ../../hooks/use-filtered-list */ "./hooks/use-filtered-list/index.ts"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_104269__(/*! ./icon */ "./components/icon-picker/icon.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/icon-picker/icon-picker.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + + + + +/** + * TooltipContent + * + * The `@wordpress/components` Tooltip component tries to clone the child element + * passed into it. This child will get some additional children passed in. In some cases + * this clashes with elements that use dangerouslySetInnerHTML. This component is a + * workaround for that. It will just wrap the children in a div and pass that to the + * Tooltip component. + */ +const TooltipContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TooltipContent(props, ref) { + const { + children + } = props; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", _extends({ + ref: ref, + className: "component-icon-picker__tooltip-content" + }, props, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 33, + columnNumber: 4 + } + }), children); +}); +const StyledIconButton = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_icon__WEBPACK_IMPORTED_MODULE_8__.Icon))` + background-color: ${({ + selected +}) => selected ? 'black' : 'white'}; + color: ${({ + selected +}) => selected ? 'white' : 'black'}; + fill: ${({ + selected +}) => selected ? 'white' : 'black'}; + padding: 5px; + border: none; + border-radius: 4px; + height: 34px; + width: 34px; + display: flex; + align-items: center; + justify-content: center; + + &:hover { + background-color: ${({ + selected +}) => selected ? '#555D66' : '#f3f4f5'}; + } + + & svg { + max-height: 100%; + max-width: 100%; + height: auto; + width: 100%; + object-fit: contain; + } +`; +const IconLabel = props => { + const { + icon, + isChecked + } = props; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tooltip, { + text: icon.label, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 80, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TooltipContent, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 81, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledIconButton, { + selected: isChecked, + key: icon.name, + name: icon.name, + iconSet: icon.iconSet, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 82, + columnNumber: 5 + } + }))); +}; +const IconGridItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.memo)(props => { + const { + columnIndex, + rowIndex, + style, + data + } = props; + const { + icons, + selectedIcon, + onChange + } = data; + const index = rowIndex * 5 + columnIndex; + const icon = icons[index]; + const isChecked = selectedIcon?.name === icon?.name && selectedIcon?.iconSet === icon?.iconSet; + if (!icon) { + return null; + } + + // We need to cast the IconLabel to a string because types in WP are not correct + const label = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(IconLabel, { + isChecked: isChecked, + icon: icon, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 128, + columnNumber: 17 + } + }); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + style: style, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 131, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.CheckboxControl, { + key: icon.name, + label: label, + checked: isChecked, + onChange: () => onChange(icon), + className: "component-icon-picker__checkbox-control", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 132, + columnNumber: 4 + } + })); +}, react_window__WEBPACK_IMPORTED_MODULE_5__.areEqual); +const StyledIconGrid = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,react_window__WEBPACK_IMPORTED_MODULE_5__.FixedSizeGrid))` + .component-icon-picker__checkbox-control { + margin-bottom: 0; + } + + .components-checkbox-control__input, + .components-checkbox-control__input-container { + display: none; + } +`; +const IconGrid = props => { + const { + icons, + selectedIcon, + onChange + } = props; + const itemData = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + icons, + selectedIcon, + onChange + }), [icons, selectedIcon, onChange]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.NavigableMenu, { + orientation: "vertical", + className: "component-icon-picker__list", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 178, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledIconGrid, { + columnCount: 5, + columnWidth: 248 / 5, + rowCount: Math.ceil(icons.length / 5), + rowHeight: 248 / 5, + itemData: itemData, + height: 200, + width: 248, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 179, + columnNumber: 4 + } + }, IconGridItem)); +}; +const IconPicker = props => { + const { + value, + onChange, + label = '', + ...rest + } = props; + const icons = (0,_hooks_use_icons__WEBPACK_IMPORTED_MODULE_6__.useIcons)(); + const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.useInstanceId)(IconPicker); + const id = `icon-picker-${instanceId}`; + const [searchTerm, setSearchTerm] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const [filteredIcons] = (0,_hooks_use_filtered_list__WEBPACK_IMPORTED_MODULE_7__.useFilteredList)(icons, searchTerm); + const hasIcons = !!filteredIcons.length; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.BaseControl, _extends({ + label: label, + id: id, + className: "component-icon-picker" + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 219, + columnNumber: 3 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SearchControl, { + value: searchTerm, + onChange: setSearchTerm, + id: id, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 220, + columnNumber: 4 + } + }), hasIcons ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(IconGrid, { + icons: filteredIcons, + selectedIcon: value, + onChange: onChange, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 222, + columnNumber: 5 + } + }) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 224, + columnNumber: 5 + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No icons were found...'))); +}; + +/***/ }), + +/***/ "./components/icon-picker/icon.tsx": +/*!*****************************************!*\ + !*** ./components/icon-picker/icon.tsx ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_114530__) { + +"use strict"; +__nested_webpack_require_114530__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_114530__.d(__nested_webpack_exports__, { +/* harmony export */ Icon: function() { return /* binding */ Icon; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_114530__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_114530__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_114530__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_114530__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _hooks_use_icons__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_114530__(/*! ../../hooks/use-icons */ "./hooks/use-icons/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/icon-picker/icon.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + +const Icon = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Icon(props, ref) { + const { + name, + iconSet, + onClick, + ...rest + } = props; + const icon = (0,_hooks_use_icons__WEBPACK_IMPORTED_MODULE_2__.useIcon)(iconSet, name); + if (!icon || Array.isArray(icon)) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, { + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 26, + columnNumber: 11 + } + }); + } + + // only add interactive props to component if a onClick handler was provided + const iconProps = {}; + if (typeof onClick === 'function') { + iconProps.role = 'button'; + iconProps.tabIndex = 0; + iconProps['aria-label'] = 'Change Icon'; + iconProps.onClick = onClick; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", _extends({}, iconProps, { + // eslint-disable-next-line react/no-danger + dangerouslySetInnerHTML: { + __html: icon.source + } + }, rest, { + ref: ref, + __self: this, + __source: { + fileName: _jsxFileName, + lineNumber: 39, + columnNumber: 4 + } + })); +}); + +/***/ }), + +/***/ "./components/icon-picker/index.tsx": +/*!******************************************!*\ + !*** ./components/icon-picker/index.tsx ***! + \******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_117448__) { + +"use strict"; +__nested_webpack_require_117448__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_117448__.d(__nested_webpack_exports__, { +/* harmony export */ Icon: function() { return /* reexport safe */ _icon__WEBPACK_IMPORTED_MODULE_0__.Icon; }, +/* harmony export */ IconPicker: function() { return /* reexport safe */ _icon_picker__WEBPACK_IMPORTED_MODULE_1__.IconPicker; }, +/* harmony export */ IconPickerToolbarButton: function() { return /* reexport safe */ _icon_picker_toolbar_button__WEBPACK_IMPORTED_MODULE_2__.IconPickerToolbarButton; }, +/* harmony export */ InlineIconPicker: function() { return /* reexport safe */ _inline_icon_picker__WEBPACK_IMPORTED_MODULE_3__.InlineIconPicker; } +/* harmony export */ }); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_117448__(/*! ./icon */ "./components/icon-picker/icon.tsx"); +/* harmony import */ var _icon_picker__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_117448__(/*! ./icon-picker */ "./components/icon-picker/icon-picker.tsx"); +/* harmony import */ var _icon_picker_toolbar_button__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_117448__(/*! ./icon-picker-toolbar-button */ "./components/icon-picker/icon-picker-toolbar-button.tsx"); +/* harmony import */ var _inline_icon_picker__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_117448__(/*! ./inline-icon-picker */ "./components/icon-picker/inline-icon-picker.tsx"); + + + + + +/***/ }), + +/***/ "./components/icon-picker/inline-icon-picker.tsx": +/*!*******************************************************!*\ + !*** ./components/icon-picker/inline-icon-picker.tsx ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_119171__) { + +"use strict"; +__nested_webpack_require_119171__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_119171__.d(__nested_webpack_exports__, { +/* harmony export */ IconPickerDropdown: function() { return /* binding */ IconPickerDropdown; }, +/* harmony export */ InlineIconPicker: function() { return /* binding */ InlineIconPicker; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_119171__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_119171__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_119171__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_119171__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_119171__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_119171__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _icon_picker__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_119171__(/*! ./icon-picker */ "./components/icon-picker/icon-picker.tsx"); +/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_119171__(/*! ./icon */ "./components/icon-picker/icon.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/icon-picker/inline-icon-picker.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + +const StyledIconPickerDropdown = _emotion_styled__WEBPACK_IMPORTED_MODULE_1___default()((0,_icon_picker__WEBPACK_IMPORTED_MODULE_3__.IconPicker))` + margin: 6px; + width: 248px; + height: 248px; +`; +const IconPickerDropdown = props => { + const { + renderToggle, + ...iconPickerProps + } = props; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Dropdown, { + className: "component-icon-picker-inline-button", + contentClassName: "component-icon-picker-inline__content", + popoverProps: { + placement: 'bottom-start' + }, + renderToggle: renderToggle, + renderContent: () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StyledIconPickerDropdown, _extends({}, iconPickerProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 30, + columnNumber: 25 + } + })), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 25, + columnNumber: 3 + } + }); +}; +const InlineIconPicker = props => { + const { + value, + ...rest + } = props; + const IconButton = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(({ + onToggle + }) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, _extends({ + name: value?.name, + iconSet: value?.iconSet, + onClick: onToggle + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 39, + columnNumber: 4 + } + })), [value, rest]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(IconPickerDropdown, _extends({ + renderToggle: IconButton + }, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 44, + columnNumber: 9 + } + })); +}; + +/***/ }), + +/***/ "./components/image/index.tsx": +/*!************************************!*\ + !*** ./components/image/index.tsx ***! + \************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_123280__) { + +"use strict"; +__nested_webpack_require_123280__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_123280__.d(__nested_webpack_exports__, { +/* harmony export */ Image: function() { return /* binding */ Image; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_123280__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_123280__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_123280__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_123280__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_123280__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_123280__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_123280__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_123280__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _hooks_use_media__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_123280__(/*! ../../hooks/use-media */ "./hooks/use-media/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/image/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + +const Image = ({ + id, + size = 'full', + onSelect, + focalPoint = { + x: 0.5, + y: 0.5 + }, + onChangeFocalPoint = undefined, + labels = {}, + canEditImage = true, + allowedTypes = ['image'], + ...rest +}) => { + const hasImage = !!id; + const { + media, + isResolvingMedia + } = (0,_hooks_use_media__WEBPACK_IMPORTED_MODULE_4__.useMedia)(id); + const shouldDisplayFocalPointPicker = typeof onChangeFocalPoint === 'function'; + if (!hasImage && !canEditImage) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, { + className: "block-editor-media-placeholder", + withIllustration: true, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 37, + columnNumber: 10 + } + }); + } + if (!hasImage && canEditImage) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaPlaceholder, { + labels: labels, + onSelect: onSelect, + accept: "image", + multiple: false, + allowedTypes: allowedTypes, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 42, + columnNumber: 4 + } + }); + } + if (isResolvingMedia) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 53, + columnNumber: 10 + } + }); + } + // @ts-ignore-next-line - The media object is not typed by WordPress currently + const imageUrl = media?.media_details?.sizes?.[size]?.source_url ?? media?.source_url; + const altText = media?.alt_text; + if (shouldDisplayFocalPointPicker) { + const focalPointStyle = { + objectFit: 'cover', + objectPosition: `${focalPoint.x * 100}% ${focalPoint.y * 100}%` + }; + rest.style = { + ...rest.style, + ...focalPointStyle + }; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, shouldDisplayFocalPointPicker && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 74, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { + title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Image Settings'), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 75, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.FocalPointPicker, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Focal Point Picker'), + url: imageUrl, + value: focalPoint, + onChange: onChangeFocalPoint, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 76, + columnNumber: 7 + } + }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", _extends({ + src: imageUrl, + alt: altText + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 85, + columnNumber: 4 + } + }))); +}; + +/***/ }), + +/***/ "./components/index.ts": +/*!*****************************!*\ + !*** ./components/index.ts ***! + \*****************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_129060__) { + +"use strict"; +__nested_webpack_require_129060__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_129060__.d(__nested_webpack_exports__, { +/* harmony export */ AbstractRepeater: function() { return /* reexport safe */ _repeater__WEBPACK_IMPORTED_MODULE_10__.AbstractRepeater; }, +/* harmony export */ CircularProgressBar: function() { return /* reexport safe */ _counter__WEBPACK_IMPORTED_MODULE_26__.CircularProgressBar; }, +/* harmony export */ ClipboardButton: function() { return /* reexport safe */ _clipboard_button__WEBPACK_IMPORTED_MODULE_9__.ClipboardButton; }, +/* harmony export */ ColorSetting: function() { return /* reexport safe */ _color_settings__WEBPACK_IMPORTED_MODULE_8__.ColorSetting; }, +/* harmony export */ ContentPicker: function() { return /* reexport safe */ _content_picker__WEBPACK_IMPORTED_MODULE_6__.ContentPicker; }, +/* harmony export */ ContentSearch: function() { return /* reexport safe */ _content_search__WEBPACK_IMPORTED_MODULE_5__.ContentSearch; }, +/* harmony export */ Counter: function() { return /* reexport safe */ _counter__WEBPACK_IMPORTED_MODULE_26__.Counter; }, +/* harmony export */ CustomBlockAppender: function() { return /* reexport safe */ _custom_block_appender__WEBPACK_IMPORTED_MODULE_4__.CustomBlockAppender; }, +/* harmony export */ DragHandle: function() { return /* reexport safe */ _drag_handle__WEBPACK_IMPORTED_MODULE_7__.DragHandle; }, +/* harmony export */ Icon: function() { return /* reexport safe */ _icon_picker__WEBPACK_IMPORTED_MODULE_3__.Icon; }, +/* harmony export */ IconPicker: function() { return /* reexport safe */ _icon_picker__WEBPACK_IMPORTED_MODULE_3__.IconPicker; }, +/* harmony export */ IconPickerToolbarButton: function() { return /* reexport safe */ _icon_picker__WEBPACK_IMPORTED_MODULE_3__.IconPickerToolbarButton; }, +/* harmony export */ Image: function() { return /* reexport safe */ _image__WEBPACK_IMPORTED_MODULE_13__.Image; }, +/* harmony export */ InlineIconPicker: function() { return /* reexport safe */ _icon_picker__WEBPACK_IMPORTED_MODULE_3__.InlineIconPicker; }, +/* harmony export */ InnerBlockSlider: function() { return /* reexport safe */ _inner_block_slider__WEBPACK_IMPORTED_MODULE_2__.InnerBlockSlider; }, +/* harmony export */ IsAdmin: function() { return /* reexport safe */ _is_admin__WEBPACK_IMPORTED_MODULE_0__.IsAdmin; }, +/* harmony export */ Link: function() { return /* reexport safe */ _link__WEBPACK_IMPORTED_MODULE_11__.Link; }, +/* harmony export */ MediaToolbar: function() { return /* reexport safe */ _media_toolbar__WEBPACK_IMPORTED_MODULE_12__.MediaToolbar; }, +/* harmony export */ Optional: function() { return /* reexport safe */ _optional__WEBPACK_IMPORTED_MODULE_1__.Optional; }, +/* harmony export */ PostAuthor: function() { return /* reexport safe */ _post_author__WEBPACK_IMPORTED_MODULE_19__.PostAuthor; }, +/* harmony export */ PostCategoryList: function() { return /* reexport safe */ _post_category_list__WEBPACK_IMPORTED_MODULE_22__.PostCategoryList; }, +/* harmony export */ PostContext: function() { return /* reexport safe */ _post_context__WEBPACK_IMPORTED_MODULE_14__.PostContext; }, +/* harmony export */ PostDate: function() { return /* reexport safe */ _post_date__WEBPACK_IMPORTED_MODULE_20__.PostDate; }, +/* harmony export */ PostDatePicker: function() { return /* reexport safe */ _post_date__WEBPACK_IMPORTED_MODULE_20__.PostDatePicker; }, +/* harmony export */ PostExcerpt: function() { return /* reexport safe */ _post_excerpt__WEBPACK_IMPORTED_MODULE_18__.PostExcerpt; }, +/* harmony export */ PostFeaturedImage: function() { return /* reexport safe */ _post_featured_image__WEBPACK_IMPORTED_MODULE_16__.PostFeaturedImage; }, +/* harmony export */ PostMeta: function() { return /* reexport safe */ _post_meta__WEBPACK_IMPORTED_MODULE_17__.PostMeta; }, +/* harmony export */ PostPrimaryCategory: function() { return /* reexport safe */ _post_primary_category__WEBPACK_IMPORTED_MODULE_24__.PostPrimaryCategory; }, +/* harmony export */ PostPrimaryTerm: function() { return /* reexport safe */ _post_primary_term__WEBPACK_IMPORTED_MODULE_23__.PostPrimaryTerm; }, +/* harmony export */ PostTermList: function() { return /* reexport safe */ _post_term_list__WEBPACK_IMPORTED_MODULE_21__.PostTermList; }, +/* harmony export */ PostTitle: function() { return /* reexport safe */ _post_title__WEBPACK_IMPORTED_MODULE_15__.PostTitle; }, +/* harmony export */ Repeater: function() { return /* reexport safe */ _repeater__WEBPACK_IMPORTED_MODULE_10__.Repeater; }, +/* harmony export */ RichTextCharacterLimit: function() { return /* reexport safe */ _rich_text_character_limit__WEBPACK_IMPORTED_MODULE_25__.RichTextCharacterLimit; }, +/* harmony export */ getCharacterCount: function() { return /* reexport safe */ _rich_text_character_limit__WEBPACK_IMPORTED_MODULE_25__.getCharacterCount; } +/* harmony export */ }); +/* harmony import */ var _is_admin__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_129060__(/*! ./is-admin */ "./components/is-admin/index.tsx"); +/* harmony import */ var _optional__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_129060__(/*! ./optional */ "./components/optional/index.ts"); +/* harmony import */ var _inner_block_slider__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_129060__(/*! ./inner-block-slider */ "./components/inner-block-slider/index.js"); +/* harmony import */ var _icon_picker__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_129060__(/*! ./icon-picker */ "./components/icon-picker/index.tsx"); +/* harmony import */ var _custom_block_appender__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_129060__(/*! ./custom-block-appender */ "./components/custom-block-appender/index.tsx"); +/* harmony import */ var _content_search__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_129060__(/*! ./content-search */ "./components/content-search/index.tsx"); +/* harmony import */ var _content_picker__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_129060__(/*! ./content-picker */ "./components/content-picker/index.tsx"); +/* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_129060__(/*! ./drag-handle */ "./components/drag-handle/index.tsx"); +/* harmony import */ var _color_settings__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_129060__(/*! ./color-settings */ "./components/color-settings/index.tsx"); +/* harmony import */ var _clipboard_button__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_129060__(/*! ./clipboard-button */ "./components/clipboard-button/index.tsx"); +/* harmony import */ var _repeater__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_129060__(/*! ./repeater */ "./components/repeater/index.js"); +/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_129060__(/*! ./link */ "./components/link/index.tsx"); +/* harmony import */ var _media_toolbar__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_129060__(/*! ./media-toolbar */ "./components/media-toolbar/index.tsx"); +/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_129060__(/*! ./image */ "./components/image/index.tsx"); +/* harmony import */ var _post_context__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_129060__(/*! ./post-context */ "./components/post-context/index.tsx"); +/* harmony import */ var _post_title__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_129060__(/*! ./post-title */ "./components/post-title/index.tsx"); +/* harmony import */ var _post_featured_image__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_129060__(/*! ./post-featured-image */ "./components/post-featured-image/index.tsx"); +/* harmony import */ var _post_meta__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_129060__(/*! ./post-meta */ "./components/post-meta/index.tsx"); +/* harmony import */ var _post_excerpt__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_129060__(/*! ./post-excerpt */ "./components/post-excerpt/index.tsx"); +/* harmony import */ var _post_author__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_129060__(/*! ./post-author */ "./components/post-author/index.tsx"); +/* harmony import */ var _post_date__WEBPACK_IMPORTED_MODULE_20__ = __nested_webpack_require_129060__(/*! ./post-date */ "./components/post-date/index.tsx"); +/* harmony import */ var _post_term_list__WEBPACK_IMPORTED_MODULE_21__ = __nested_webpack_require_129060__(/*! ./post-term-list */ "./components/post-term-list/index.tsx"); +/* harmony import */ var _post_category_list__WEBPACK_IMPORTED_MODULE_22__ = __nested_webpack_require_129060__(/*! ./post-category-list */ "./components/post-category-list/index.tsx"); +/* harmony import */ var _post_primary_term__WEBPACK_IMPORTED_MODULE_23__ = __nested_webpack_require_129060__(/*! ./post-primary-term */ "./components/post-primary-term/index.tsx"); +/* harmony import */ var _post_primary_category__WEBPACK_IMPORTED_MODULE_24__ = __nested_webpack_require_129060__(/*! ./post-primary-category */ "./components/post-primary-category/index.tsx"); +/* harmony import */ var _rich_text_character_limit__WEBPACK_IMPORTED_MODULE_25__ = __nested_webpack_require_129060__(/*! ./rich-text-character-limit */ "./components/rich-text-character-limit/index.tsx"); +/* harmony import */ var _counter__WEBPACK_IMPORTED_MODULE_26__ = __nested_webpack_require_129060__(/*! ./counter */ "./components/counter/index.tsx"); + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/***/ }), + +/***/ "./components/inner-block-slider/icons.js": +/*!************************************************!*\ + !*** ./components/inner-block-slider/icons.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_138475__) { + +"use strict"; +__nested_webpack_require_138475__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_138475__.d(__nested_webpack_exports__, { +/* harmony export */ ChevronLeft: function() { return /* binding */ ChevronLeft; }, +/* harmony export */ ChevronRight: function() { return /* binding */ ChevronRight; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_138475__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_138475__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/inner-block-slider/icons.js"; + +const ChevronLeft = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { + xmlns: "http://www.w3.org/2000/svg", + width: "40", + height: "40", + fill: "none", + viewBox: "0 0 14.4 23.7", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 2, + columnNumber: 2 + } +}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + stroke: "currentColor", + strokeWidth: "3", + d: "M11.19,1.81l-9.12,10,9.12,10", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 9, + columnNumber: 3 + } +})); +const ChevronRight = () => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { + xmlns: "http://www.w3.org/2000/svg", + width: "40", + height: "40", + fill: "none", + viewBox: "0 0 14.4 23.7", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 14, + columnNumber: 2 + } +}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", { + stroke: "currentColor", + strokeWidth: "3", + d: "M2.1,21.9l9.1-10l-9.1-10", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 21, + columnNumber: 3 + } +})); + + +/***/ }), + +/***/ "./components/inner-block-slider/index.js": +/*!************************************************!*\ + !*** ./components/inner-block-slider/index.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_140719__) { + +"use strict"; +__nested_webpack_require_140719__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_140719__.d(__nested_webpack_exports__, { +/* harmony export */ InnerBlockSlider: function() { return /* binding */ InnerBlockSlider; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_140719__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_140719__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_140719__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_140719__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_140719__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); +/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_140719__(/*! @emotion/react */ "@emotion/react"); +/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_140719__.n(_emotion_react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_140719__(/*! ./icons */ "./components/inner-block-slider/icons.js"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/inner-block-slider/index.js"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +/* eslint-disable */ +// @ts-nocheck + + + + + +/** @jsx jsx */ + + +const InnerBlockSlider = ({ + parentBlockId, + slidesPerPage = 1, + allowedBlock, + template = null, + slideHeight = null +}) => { + const [currentPage, setCurrentPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(1); + _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_4___default()('InnerBlockSlider', { + since: '1.15.12', + version: '1.16', + alternative: 'the useInnerBlocksProps hook to render the inner blocks and then use the same JS library that powers the slider on the frontend in the editor', + plugin: '10up Block Components' + }); + let innerBlockTemplate = template; + if (!innerBlockTemplate) { + innerBlockTemplate = [[allowedBlock]]; + } + const slideBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select('core/block-editor').getBlock(parentBlockId).innerBlocks); + const { + insertBlock + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)('core/editor'); + const slides = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + const slideCount = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + const totalPages = Math.ceil(slideBlocks.length / slidesPerPage); + const totalWidth = 100 / slidesPerPage * slideBlocks.length; + const slideSlotWidth = 100 / slideBlocks.length; + const moveOffset = slideSlotWidth * (currentPage - 1) * slidesPerPage; + const addSlide = () => { + const created = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)(allowedBlock); + insertBlock(created, undefined, parentBlockId); + }; + + /** + * Reset page to 1 if slidesPerPage changes + */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setCurrentPage(1); + }, [slidesPerPage]); + + /** + * If a slide is added, switch to the new slide. If one is deleted, make sure we don't + * show a non-existent slide. + */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!slideCount.current) { + slideCount.current = slideBlocks.length; + } else if (slideBlocks.length > slideCount.current) { + // Slide added + slideCount.current = slideBlocks.length; + setCurrentPage(totalPages); + } else if (slideBlocks.length < slideCount.current) { + // Slide deleted + slideCount.current = slideBlocks.length; + if (currentPage > totalPages) { + setCurrentPage(totalPages); + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [slideBlocks.length]); + const slidesCSS = (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.css)` + /* stylelint-disable */ + width: ${totalWidth}%; + transform: translate3d(-${moveOffset}%, 0px, 0px); + ${slideHeight ? `height: ${slideHeight};` : ''} + display: flex; + flex-wrap: nowrap; + + & > .wp-block { + width: ${slideSlotWidth}%; + } + `; + const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useInnerBlocksProps)({ + className: 'slides', + ref: slides + }, { + template: innerBlockTemplate, + orientation: 'horizontal', + allowedBlocks: [allowedBlock] + }); + const prevEnabled = currentPage > 1; + const nextEnabled = currentPage < totalPages; + return (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: "inner-block-slider", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 114, + columnNumber: 3 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: "slides-outer", + style: { + overflow: 'hidden' + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 115, + columnNumber: 4 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", _extends({}, innerBlocksProps, { + css: slidesCSS, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 116, + columnNumber: 5 + } + }))), (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: "navigation", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 118, + columnNumber: 4 + } + }, [...Array(totalPages).keys()].map(i => (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", { + "aria-label": `Slide ${i + 1}`, + onClick: () => { + setCurrentPage(i + 1); + }, + type: "button", + key: i + 1, + className: `dot ${currentPage === i + 1 ? 'current' : ''}`, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 120, + columnNumber: 6 + } + })), (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", { + "aria-label": "Add new slide", + onClick: () => { + addSlide(); + }, + type: "button", + className: "add", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 131, + columnNumber: 5 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("svg", { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + role: "img", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 139, + columnNumber: 6 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", { + d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 140, + columnNumber: 7 + } + })))), (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: "controls", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 144, + columnNumber: 4 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: `prev-container ${!prevEnabled ? 'disable' : ''}`, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 145, + columnNumber: 5 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", { + onClick: () => { + if (prevEnabled) { + setCurrentPage(currentPage - 1); + } + }, + type: "button", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 146, + columnNumber: 6 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_6__.ChevronLeft, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 154, + columnNumber: 7 + } + }))), (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { + className: `next-container ${!nextEnabled ? 'disable' : ''}`, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 157, + columnNumber: 5 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)("button", { + onClick: () => { + if (nextEnabled) { + setCurrentPage(currentPage + 1); + } + }, + type: "button", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 158, + columnNumber: 6 + } + }, (0,_emotion_react__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons__WEBPACK_IMPORTED_MODULE_6__.ChevronRight, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 166, + columnNumber: 7 + } + }))))); +}; + +/***/ }), + +/***/ "./components/is-admin/index.tsx": +/*!***************************************!*\ + !*** ./components/is-admin/index.tsx ***! + \***************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_150851__) { + +"use strict"; +__nested_webpack_require_150851__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_150851__.d(__nested_webpack_exports__, { +/* harmony export */ IsAdmin: function() { return /* binding */ IsAdmin; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_150851__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_150851__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_150851__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_150851__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +/* + * IsAdmin + * + * A wrapper component that checks whether the current user has admin capabilities + * and only returns the child components if the user is an admin. You can pass a + * fallback component via the fallback prop. + */ +const IsAdmin = ({ + fallback = null, + children +}) => { + const hasAdminPermissions = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store).canUser('read', 'users?roles=1'), []); + return hasAdminPermissions ? children : fallback; +}; + +/***/ }), + +/***/ "./components/link/index.tsx": +/*!***********************************!*\ + !*** ./components/link/index.tsx ***! + \***********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_152499__) { + +"use strict"; +__nested_webpack_require_152499__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_152499__.d(__nested_webpack_exports__, { +/* harmony export */ Link: function() { return /* binding */ Link; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_152499__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_152499__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_152499__(/*! classnames */ "./node_modules/classnames/index.js"); +/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_152499__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_152499__(/*! @emotion/styled */ "@emotion/styled"); +/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_152499__.n(_emotion_styled__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_152499__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_152499__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_152499__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_152499__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_152499__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_152499__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _styled_components_context__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_152499__(/*! ../styled-components-context */ "./components/styled-components-context/index.tsx"); +/* harmony import */ var _hooks_use_on_click_outside__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_152499__(/*! ../../hooks/use-on-click-outside */ "./hooks/use-on-click-outside.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/link/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } +/** + * External dependencies + */ + + + +/** + * WordPress dependencies + */ + + + +// @ts-ignore-next-line - The type definitions for the block editor are missing the __experimentalLinkControl import. + + +/** + * Internal Dependencies + */ + + +/* + * Given the Link block's type attribute, return the query params to give to + * /wp/v2/search. + */ +function getSuggestionsQuery(type, kind) { + switch (type) { + case 'post': + case 'page': + return { + type: 'post', + subtype: type + }; + case 'category': + return { + type: 'term', + subtype: 'category' + }; + case 'tag': + return { + type: 'term', + subtype: 'post_tag' + }; + case 'post_format': + return { + type: 'post-format' + }; + default: + break; + } + switch (kind) { + case 'taxonomy': + return { + type: 'term', + subtype: type + }; + case 'post-type': + return { + type: 'post', + subtype: type + }; + default: + return {}; + } +} +const StylesRichTextLink = _emotion_styled__WEBPACK_IMPORTED_MODULE_2___default()((0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.RichText))` + --color--warning: #f00; + + /* Reset margins for this block alone. */ + --global--spacing-vertical: 0; + --global--spacing-vertical: 0; + + color: var(--wp--style--color--link); + position: relative; + display: block; + align-items: center; + gap: 0.5em; + text-decoration: underline; + + /* This holds the text URL input */ + & > div { + text-decoration: underline; + } + + .dashicon { + text-decoration: none; + font-size: 1em; + width: 1.5em; + height: 1.5em; + border-radius: 50%; + background: transparent; + display: flex; + align-items: center; + justify-content: center; + color: var(--color--warning); + } +`; +/* + * Link component that can be used inside other Gutenberg blocks for setting up URLs. + * + * The link should not be visible if the block is not focused. This will maintain nicer + * visuals in the block editor as a whole. + */ +const Link = ({ + value = '', + type = '', + opensInNewTab = false, + url = undefined, + onLinkChange, + onTextChange, + onLinkRemove = null, + kind = '', + placeholder = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Link text ...', '10up-block-components'), + className = undefined, + ...rest +}) => { + const [isPopoverVisible, setIsPopoverVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const [isValidLink, setIsValidLink] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const openPopover = () => setIsPopoverVisible(true); + const closePopover = () => setIsPopoverVisible(false); + const linkRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const popoverRef = (0,_hooks_use_on_click_outside__WEBPACK_IMPORTED_MODULE_7__.useOnClickOutside)(closePopover); + const link = { + url, + opensInNewTab, + title: value // don't allow HTML to display inside the + }; + + /** + * Check if the URL and Value are set. If yes, then the component is valid. + * Otherwise, we will output a visual reminder to the editor that one of the + * two needs to be set. + */ + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setIsValidLink(!!url && !!value); + }, [url, value]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_styled_components_context__WEBPACK_IMPORTED_MODULE_6__.StyledComponentContext, { + cacheKey: "tenup-component-link", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 152, + columnNumber: 3 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(StylesRichTextLink, _extends({ + tagName: "a", + className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('tenup-block-components-link__label', className), + value: value, + onChange: onTextChange, + "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Link text', '10up-block-components'), + placeholder: placeholder, + __unstablePastePlainText: true, + allowedFormats: [], + onClick: openPopover + // @ts-ignore-next-line - The ref is not typed correctly in the RichText component. + , + ref: linkRef + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 153, + columnNumber: 4 + } + })), !isValidLink && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Tooltip, { + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('URL or Text has not been set', '10up-block-components'), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 169, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 177, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Icon, { + icon: "warning", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 178, + columnNumber: 7 + } + }))), isPopoverVisible && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Popover + // @ts-ignore-next-line - In order to support older versions of Gutenberg, we need to pass the anchorRef prop. + , { + anchorRef: linkRef.current, + anchor: linkRef.current, + ref: popoverRef, + focusOnMount: false, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 184, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_5__.__experimentalLinkControl, { + hasTextControl: true, + className: "tenup-block-components-link__link-control", + value: link, + showInitialSuggestions: true, + noDirectEntry: !!type, + noURLSuggestion: !!type, + suggestionsQuery: getSuggestionsQuery(type, kind), + onChange: onLinkChange, + onRemove: onLinkRemove, + settings: [{ + id: 'opensInNewTab', + title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Open in new tab', '10up-block-components') + }], + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 191, + columnNumber: 6 + } + }))); +}; + +/***/ }), + +/***/ "./components/media-toolbar/index.tsx": +/*!********************************************!*\ + !*** ./components/media-toolbar/index.tsx ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_162094__) { + +"use strict"; +__nested_webpack_require_162094__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_162094__.d(__nested_webpack_exports__, { +/* harmony export */ MediaToolbar: function() { return /* binding */ MediaToolbar; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_162094__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_162094__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_162094__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_162094__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_162094__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_162094__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_162094__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_162094__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _hooks_use_media__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_162094__(/*! ../../hooks/use-media */ "./hooks/use-media/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/media-toolbar/index.tsx"; + + +// @ts-ignore-next-line - The types for this package are incorrect. + + + +const DEFAULT_LABELS = { + add: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Add Image', '10up-block-components'), + remove: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove Image', '10up-block-components'), + replace: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Replace Image', '10up-block-components') +}; + +/* + * MediaToolbar + * + * This is a helper component that adds the Media Replace Flow + * with some buttons to add or remove an image. + * + * This should be used on components that have optional images. + */ +const MediaToolbar = ({ + onSelect, + onRemove, + isOptional = false, + id, + labels = {} +}) => { + const hasImage = !!id; + const { + media + } = (0,_hooks_use_media__WEBPACK_IMPORTED_MODULE_4__.useMedia)(id); + const mergedLabels = { + ...DEFAULT_LABELS, + ...labels + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarGroup, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 65, + columnNumber: 3 + } + }, hasImage ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaReplaceFlow, { + mediaId: id, + mediaUrl: media?.source_url, + onSelect: onSelect, + name: mergedLabels.replace, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 68, + columnNumber: 6 + } + }), !!isOptional && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton, { + onClick: onRemove, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 75, + columnNumber: 7 + } + }, mergedLabels.remove)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaUploadCheck, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 81, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaUpload, { + onSelect: onSelect, + render: ({ + open + }) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton, { + onClick: open, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 85, + columnNumber: 8 + } + }, mergedLabels.add), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 82, + columnNumber: 6 + } + }))); +}; + +/***/ }), + +/***/ "./components/optional/index.ts": +/*!**************************************!*\ + !*** ./components/optional/index.ts ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_167023__) { + +"use strict"; +__nested_webpack_require_167023__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_167023__.d(__nested_webpack_exports__, { +/* harmony export */ Optional: function() { return /* binding */ Optional; } +/* harmony export */ }); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_167023__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_167023__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); +// @ts-ignore-next-line - The WordPress types are missing the hasFinishedResolution method. + +const Optional = ({ + value = '', + children +}) => { + const { + isSelected + } = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockEditContext)(); + return (isSelected || !!value) && children; +}; + +/***/ }), + +/***/ "./components/post-author/index.tsx": +/*!******************************************!*\ + !*** ./components/post-author/index.tsx ***! + \******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_168179__) { + +"use strict"; +__nested_webpack_require_168179__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_168179__.d(__nested_webpack_exports__, { +/* harmony export */ PostAuthor: function() { return /* binding */ PostAuthor; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_168179__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_168179__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_168179__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_168179__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_168179__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_168179__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_168179__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_168179__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_168179__(/*! ../../hooks */ "./hooks/index.ts"); +/* harmony import */ var _author__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_168179__(/*! ../author */ "./components/author/index.tsx"); +/* harmony import */ var _author_context__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_168179__(/*! ../author/context */ "./components/author/context.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-author/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + +const PostAuthor = props => { + const { + children, + ...rest + } = props; + const { + postId, + postType + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.usePost)(); + const [author, hasResolved] = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getEditedEntityRecord, + getUser, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const postQuery = ['postType', postType, postId]; + const post = getEditedEntityRecord(...postQuery); + const hasResolvedPost = hasFinishedResolution('getEditedEntityRecord', postQuery); + + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const _authorId = hasResolvedPost ? post?.author : undefined; + const author = getUser(_authorId); + const hasResolvedAuthor = hasFinishedResolution('getUser', [_authorId]); + return [author, hasResolvedAuthor && hasResolvedPost]; + }, [postType, postId]); + const hasRenderCallback = typeof children === 'function'; + const hasChildComponents = !hasRenderCallback && _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Children.count(children); + if (!hasResolved) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 53, + columnNumber: 10 + } + }); + } + if (hasChildComponents) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_author_context__WEBPACK_IMPORTED_MODULE_6__.AuthorContext.Provider, { + value: author, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 58, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 59, + columnNumber: 5 + } + }), children)); + } + if (hasRenderCallback) { + return children(author); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_author__WEBPACK_IMPORTED_MODULE_5__.Name, _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 68, + columnNumber: 9 + } + })); +}; +PostAuthor.Name = _author__WEBPACK_IMPORTED_MODULE_5__.Name; +PostAuthor.FirstName = _author__WEBPACK_IMPORTED_MODULE_5__.FirstName; +PostAuthor.LastName = _author__WEBPACK_IMPORTED_MODULE_5__.LastName; +PostAuthor.Avatar = _author__WEBPACK_IMPORTED_MODULE_5__.Avatar; +PostAuthor.Bio = _author__WEBPACK_IMPORTED_MODULE_5__.Bio; +PostAuthor.Email = _author__WEBPACK_IMPORTED_MODULE_5__.Email; + +/***/ }), + +/***/ "./components/post-category-list/index.tsx": +/*!*************************************************!*\ + !*** ./components/post-category-list/index.tsx ***! + \*************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_173639__) { + +"use strict"; +__nested_webpack_require_173639__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_173639__.d(__nested_webpack_exports__, { +/* harmony export */ PostCategoryList: function() { return /* binding */ PostCategoryList; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_173639__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_173639__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_173639__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_173639__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _post_term_list__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_173639__(/*! ../post-term-list */ "./components/post-term-list/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-category-list/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + +const PostCategoryList = ({ + taxonomyName = 'category', + noResultsMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Please select a category', 'tenup'), + ...rest +}) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_post_term_list__WEBPACK_IMPORTED_MODULE_2__.PostTermList, _extends({ + taxonomyName: taxonomyName, + noResultsMessage: noResultsMessage +}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 8, + columnNumber: 7 + } +})); + +/***/ }), + +/***/ "./components/post-context/context.ts": +/*!********************************************!*\ + !*** ./components/post-context/context.ts ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_175846__) { + +"use strict"; +__nested_webpack_require_175846__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_175846__.d(__nested_webpack_exports__, { +/* harmony export */ DEFAULT_POST_CONTEXT: function() { return /* binding */ DEFAULT_POST_CONTEXT; }, +/* harmony export */ PostContext: function() { return /* binding */ PostContext; }, +/* harmony export */ usePostContext: function() { return /* binding */ usePostContext; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_175846__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_175846__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + +const DEFAULT_POST_CONTEXT = { + postId: undefined, + postType: undefined, + isEditable: undefined +}; +const PostContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(DEFAULT_POST_CONTEXT); +const usePostContext = () => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PostContext); +}; + +/***/ }), + +/***/ "./components/post-context/index.tsx": +/*!*******************************************!*\ + !*** ./components/post-context/index.tsx ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_177209__) { + +"use strict"; +__nested_webpack_require_177209__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_177209__.d(__nested_webpack_exports__, { +/* harmony export */ PostContext: function() { return /* binding */ PostContext; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_177209__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_177209__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_177209__(/*! ./context */ "./components/post-context/context.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-context/index.tsx"; + + + +const PostContext = ({ + children, + postId, + postType, + isEditable = false +}) => { + const value = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + postId, + postType, + isEditable + }), [postId, postType, isEditable]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_context__WEBPACK_IMPORTED_MODULE_1__.PostContext.Provider, { + value: value, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 41, + columnNumber: 9 + } + }, children); +}; + +/***/ }), + +/***/ "./components/post-date/index.tsx": +/*!****************************************!*\ + !*** ./components/post-date/index.tsx ***! + \****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_178829__) { + +"use strict"; +__nested_webpack_require_178829__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_178829__.d(__nested_webpack_exports__, { +/* harmony export */ PostDate: function() { return /* binding */ PostDate; }, +/* harmony export */ PostDatePicker: function() { return /* binding */ PostDatePicker; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_178829__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_178829__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_178829__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_178829__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_178829__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_178829__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_178829__(/*! @wordpress/date */ "@wordpress/date"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_178829__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_178829__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_178829__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _hooks_use_popover__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_178829__(/*! ../../hooks/use-popover */ "./hooks/use-popover/index.tsx"); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_178829__(/*! ../../hooks */ "./hooks/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-date/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + +const PostDatePicker = ({ + date, + setDate +}) => { + const settings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.getSettings)(); + // To know if the current time format is a 12 hour time, look for "a". + // Also make sure this "a" is not escaped by a "/". + const is12Hour = /a(?!\\)/i.test(settings.formats.time.toLowerCase() // Test only for the lower case "a". + .replace(/\\\\/g, '') // Replace "//" with empty strings. + .split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash. + ); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.DateTimePicker, { + currentDate: date, + onChange: setDate, + is12Hour: is12Hour, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 27, + columnNumber: 9 + } + }); +}; +const PostDate = ({ + placeholder = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No date set', 'tenup'), + format, + ...rest +}) => { + const { + postId, + postType, + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_6__.usePost)(); + const [date, setDate] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__.useEntityProp)('postType', postType, 'date', postId); + const [siteFormat] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__.useEntityProp)('root', 'site', 'date_format'); + const settings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.getSettings)(); + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const resolvedFormat = format || siteFormat || settings.formats.date; + const { + toggleProps, + Popover + } = (0,_hooks_use_popover__WEBPACK_IMPORTED_MODULE_5__.usePopover)(); + const timeString = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.dateI18n)(resolvedFormat, date, timezone) || placeholder; + let parentProps = { + ...rest + }; + if (isEditable) { + parentProps = { + ...toggleProps, + ...parentProps + }; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", _extends({ + dateTime: (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.dateI18n)('c', date, timezone), + itemProp: "datePublished" + }, parentProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 76, + columnNumber: 4 + } + }), timeString), isEditable && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Popover, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 84, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PostDatePicker, { + date: date, + setDate: date => setDate(date), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 85, + columnNumber: 6 + } + }))); +}; + +/***/ }), + +/***/ "./components/post-excerpt/index.tsx": +/*!*******************************************!*\ + !*** ./components/post-excerpt/index.tsx ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_184624__) { + +"use strict"; +__nested_webpack_require_184624__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_184624__.d(__nested_webpack_exports__, { +/* harmony export */ PostExcerpt: function() { return /* binding */ PostExcerpt; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_184624__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_184624__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_184624__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_184624__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_184624__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_184624__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_184624__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_184624__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_184624__(/*! ../../hooks */ "./hooks/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-excerpt/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + +const PostExcerpt = ({ + placeholder = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter excerpt...', 'tenup'), + ...rest +}) => { + const { + postId, + postType, + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.usePost)(); + const [rawExcerpt = '', setExcerpt, fullExcerpt] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityProp)('postType', postType, 'excerpt', postId); + if (!isEditable) { + // eslint-disable-next-line react/no-danger + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", _extends({}, rest, { + dangerouslySetInnerHTML: { + __html: fullExcerpt?.rendered + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 33, + columnNumber: 10 + } + })); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, _extends({ + tagName: "p", + placeholder: placeholder, + value: rawExcerpt, + onChange: value => setExcerpt(value), + allowedFormats: [] + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 37, + columnNumber: 3 + } + })); +}; + +/***/ }), + +/***/ "./components/post-featured-image/index.tsx": +/*!**************************************************!*\ + !*** ./components/post-featured-image/index.tsx ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_188189__) { + +"use strict"; +__nested_webpack_require_188189__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_188189__.d(__nested_webpack_exports__, { +/* harmony export */ PostFeaturedImage: function() { return /* binding */ PostFeaturedImage; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_188189__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_188189__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_188189__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_188189__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_188189__(/*! ../../hooks */ "./hooks/index.ts"); +/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_188189__(/*! ../image */ "./components/image/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-featured-image/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + +const PostFeaturedImage = props => { + const { + postId, + postType, + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_2__.usePost)(); + const [featuredImage, setFeaturedImage] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityProp)('postType', postType, 'featured_media', postId); + const handleImageSelect = image => { + setFeaturedImage(image.id); + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_image__WEBPACK_IMPORTED_MODULE_3__.Image, _extends({ + id: featuredImage, + canEditImage: isEditable, + onSelect: handleImageSelect + }, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 21, + columnNumber: 3 + } + })); +}; + +/***/ }), + +/***/ "./components/post-meta/index.tsx": +/*!****************************************!*\ + !*** ./components/post-meta/index.tsx ***! + \****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_190735__) { + +"use strict"; +__nested_webpack_require_190735__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_190735__.d(__nested_webpack_exports__, { +/* harmony export */ PostMeta: function() { return /* binding */ PostMeta; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_190735__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_190735__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_190735__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_190735__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_190735__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_190735__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_190735__(/*! ../../hooks */ "./hooks/index.ts"); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_190735__(/*! ./utilities */ "./components/post-meta/utilities.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-meta/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + +const MetaString = props => { + const { + metaKey, + tagName = 'p', + ...rest + } = props; + const [metaValue, setMetaValue] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePostMetaValue)(metaKey); + const { + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePost)(); + if (!isEditable) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, _extends({ + value: metaValue ?? '', + tagName: tagName + }, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 24, + columnNumber: 10 + } + })); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, _extends({ + value: metaValue ?? '', + onChange: value => setMetaValue(value), + tagName: tagName + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 28, + columnNumber: 3 + } + })); +}; +const MetaNumber = props => { + const { + metaKey, + ...rest + } = props; + const [metaValue, setMetaValue] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePostMetaValue)(metaKey); + const { + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePost)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalNumberControl, _extends({ + value: metaValue, + onChange: value => setMetaValue(parseInt(value ?? '', 10)), + disabled: !isEditable + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 50, + columnNumber: 3 + } + })); +}; +const MetaBoolean = props => { + const { + metaKey, + ...rest + } = props; + const [metaValue, setMetaValue] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePostMetaValue)(metaKey); + const { + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePost)(); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, _extends({ + checked: metaValue, + onChange: setMetaValue, + disabled: !isEditable + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 72, + columnNumber: 3 + } + })); +}; +const PostMeta = props => { + const { + metaKey, + children + } = props; + const [isSupported] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.useIsSupportedMetaField)(metaKey); + const [metaValue, setMetaValue] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePostMetaValue)(metaKey); + const metaValueType = typeof metaValue; + if (!isSupported) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { + className: "tenup-block-components-post-meta-placeholder", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 113, + columnNumber: 4 + } + }, `${metaKey} - Meta Value`); + } + if (typeof children === 'function') { + return children(metaValue, setMetaValue); + } + if (metaValueType === 'number') { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(MetaNumber, _extends({}, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 122, + columnNumber: 10 + } + })); + } + if (metaValueType === 'boolean') { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(MetaBoolean, _extends({}, props, { + label: (0,_utilities__WEBPACK_IMPORTED_MODULE_4__.toSentence)(metaKey), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 126, + columnNumber: 10 + } + })); + } + + // @ts-ignore-next-line - The types here are not accurate. + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(MetaString, _extends({}, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 130, + columnNumber: 9 + } + })); +}; +PostMeta.String = MetaString; +PostMeta.Number = MetaNumber; +PostMeta.Boolean = MetaBoolean; + +/***/ }), + +/***/ "./components/post-meta/utilities.ts": +/*!*******************************************!*\ + !*** ./components/post-meta/utilities.ts ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_197073__) { + +"use strict"; +__nested_webpack_require_197073__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_197073__.d(__nested_webpack_exports__, { +/* harmony export */ toKebab: function() { return /* binding */ toKebab; }, +/* harmony export */ toSentence: function() { return /* binding */ toSentence; } +/* harmony export */ }); +// Checks whether character is Uppercase. +// Crude version. Checks only A-Z. +function isCaps(char) { + if (char.match(/[A-Z]/)) return true; + return false; +} + +// Checks whether character is digit. +function isDigit(char) { + if (char.match(/[0-9]/)) return true; + return false; +} +function toKebab(string) { + return string.split('').map((letter, index) => { + const previousLetter = string[index - 1] || ''; + const currentLetter = letter; + if (isDigit(currentLetter) && !isDigit(previousLetter)) { + return `-${currentLetter}`; + } + if (!isCaps(currentLetter)) return currentLetter; + if (previousLetter === '') { + return `${currentLetter.toLowerCase()}`; + } + if (isCaps(previousLetter)) { + return `${currentLetter.toLowerCase()}`; + } + return `-${currentLetter.toLowerCase()}`; + }).join('').trim().replace(/[-_\s]+/g, '-'); +} +function toSentence(string) { + const interim = toKebab(string).replace(/-/g, ' '); + return interim.slice(0, 1).toUpperCase() + interim.slice(1); +} + +/***/ }), + +/***/ "./components/post-primary-category/index.tsx": +/*!****************************************************!*\ + !*** ./components/post-primary-category/index.tsx ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_198726__) { + +"use strict"; +__nested_webpack_require_198726__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_198726__.d(__nested_webpack_exports__, { +/* harmony export */ PostPrimaryCategory: function() { return /* binding */ PostPrimaryCategory; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_198726__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_198726__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_198726__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_198726__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _post_primary_term__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_198726__(/*! ../post-primary-term */ "./components/post-primary-term/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-primary-category/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + +const PostPrimaryCategory = ({ + placeholder = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select a category', 'tenup'), + taxonomyName = 'category', + isLink = true, + ...rest +}) => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_post_primary_term__WEBPACK_IMPORTED_MODULE_2__.PostPrimaryTerm, _extends({ + placeholder: placeholder, + taxonomyName: taxonomyName, + isLink: isLink +}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 12, + columnNumber: 2 + } +})); + +/***/ }), + +/***/ "./components/post-primary-term/index.tsx": +/*!************************************************!*\ + !*** ./components/post-primary-term/index.tsx ***! + \************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_200990__) { + +"use strict"; +__nested_webpack_require_200990__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_200990__.d(__nested_webpack_exports__, { +/* harmony export */ PostPrimaryTerm: function() { return /* binding */ PostPrimaryTerm; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_200990__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_200990__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_200990__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_200990__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_200990__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); +/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_200990__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_200990__(/*! ../../hooks */ "./hooks/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-primary-term/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + +const PostPrimaryTerm = ({ + taxonomyName = 'category', + placeholder = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select a term', 'tenup'), + isLink = true, + ...rest +}) => { + const [primaryTerm, isSupportedTaxonomy] = (0,_hooks__WEBPACK_IMPORTED_MODULE_3__.usePrimaryTerm)(taxonomyName); + const hasPrimaryTerm = !!primaryTerm; + const termString = hasPrimaryTerm ? primaryTerm.name : placeholder; + const termUrl = hasPrimaryTerm ? primaryTerm.link : '#'; + if (!isSupportedTaxonomy) { + return null; + } + const Tag = isLink ? 'a' : 'span'; + const wrapperProps = { + ...rest + }; + if (isLink) { + wrapperProps.href = termUrl; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Tag, _extends({}, wrapperProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 54, + columnNumber: 9 + } + }), (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__.decodeEntities)(termString)); +}; + +/***/ }), + +/***/ "./components/post-term-list/context.ts": +/*!**********************************************!*\ + !*** ./components/post-term-list/context.ts ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_203977__) { + +"use strict"; +__nested_webpack_require_203977__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_203977__.d(__nested_webpack_exports__, { +/* harmony export */ PostTermContext: function() { return /* binding */ PostTermContext; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_203977__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_203977__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + +const DEFAULT_TERM = { + id: 0, + name: '', + link: '', + slug: '', + count: 0, + description: '', + parent: 0, + taxonomy: '', + meta: [], + _links: {} +}; +const PostTermContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(DEFAULT_TERM); + +/***/ }), + +/***/ "./components/post-term-list/index.tsx": +/*!*********************************************!*\ + !*** ./components/post-term-list/index.tsx ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_205090__) { + +"use strict"; +__nested_webpack_require_205090__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_205090__.d(__nested_webpack_exports__, { +/* harmony export */ PostTermList: function() { return /* binding */ PostTermList; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_205090__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_205090__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_205090__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_205090__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_205090__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_205090__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_205090__(/*! @wordpress/editor */ "@wordpress/editor"); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_205090__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _optional__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_205090__(/*! ../optional */ "./components/optional/index.ts"); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_205090__(/*! ../../hooks */ "./hooks/index.ts"); +/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_205090__(/*! ./context */ "./components/post-term-list/context.ts"); +/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_205090__(/*! ./item */ "./components/post-term-list/item.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-term-list/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + + +const PostTermList = ({ + tagName: TagName = 'ul', + taxonomyName = 'category', + children = null, + noResultsMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Please select a term', 'tenup'), + ...rest +}) => { + const { + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.usePost)(); + const hasRenderCallback = typeof children === 'function'; + const hasChildComponents = !hasRenderCallback && _wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Children.count(children); + const [selectedTerms, hasResolvedSelectedTerms] = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.useSelectedTerms)(taxonomyName); + const [taxonomy, hasResolvedTaxonomy] = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.useTaxonomy)(taxonomyName); + const { + toggleProps, + Popover + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.usePopover)(); + if (!hasResolvedSelectedTerms || !hasResolvedTaxonomy) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 61, + columnNumber: 10 + } + }); + } + const PostTaxonomiesTermSelector = taxonomy?.hierarchical ? _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__.PostTaxonomiesHierarchicalTermSelector : _wordpress_editor__WEBPACK_IMPORTED_MODULE_3__.PostTaxonomiesFlatTermSelector; + if (hasRenderCallback) { + return children({ + selectedTerms, + isEditable: !!isEditable + }); + } + let listElementProps = { + ...rest + }; + if (isEditable) { + listElementProps = { + ...listElementProps, + ...toggleProps + }; + } + const hasSelectedTerms = !!(selectedTerms && selectedTerms.length > 0); + if (hasChildComponents) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_optional__WEBPACK_IMPORTED_MODULE_4__.Optional, { + value: hasSelectedTerms, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 88, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, listElementProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 89, + columnNumber: 6 + } + }), hasSelectedTerms ? selectedTerms.map(term => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_context__WEBPACK_IMPORTED_MODULE_6__.PostTermContext.Provider, { + value: term, + key: term.id, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 92, + columnNumber: 9 + } + }, children)) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 97, + columnNumber: 8 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 98, + columnNumber: 9 + } + }, noResultsMessage)))), isEditable && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Popover, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 104, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PostTaxonomiesTermSelector, { + slug: taxonomyName, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 105, + columnNumber: 7 + } + }))); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_optional__WEBPACK_IMPORTED_MODULE_4__.Optional, { + value: hasSelectedTerms, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 114, + columnNumber: 4 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, listElementProps, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 115, + columnNumber: 5 + } + }), hasSelectedTerms ? selectedTerms.map(term => (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { + key: term.id, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 118, + columnNumber: 8 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { + href: term.link, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 119, + columnNumber: 9 + } + }, term.name))) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 123, + columnNumber: 7 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("i", { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 124, + columnNumber: 8 + } + }, noResultsMessage)))), isEditable && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Popover, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 130, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PostTaxonomiesTermSelector, { + slug: taxonomyName, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 131, + columnNumber: 6 + } + }))); +}; +PostTermList.ListItem = _item__WEBPACK_IMPORTED_MODULE_7__.ListItem; +PostTermList.TermLink = _item__WEBPACK_IMPORTED_MODULE_7__.TermLink; + +/***/ }), + +/***/ "./components/post-term-list/item.tsx": +/*!********************************************!*\ + !*** ./components/post-term-list/item.tsx ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_213707__) { + +"use strict"; +__nested_webpack_require_213707__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_213707__.d(__nested_webpack_exports__, { +/* harmony export */ ListItem: function() { return /* binding */ ListItem; }, +/* harmony export */ TermLink: function() { return /* binding */ TermLink; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_213707__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_213707__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_213707__(/*! ./context */ "./components/post-term-list/context.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-term-list/item.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + +const ListItem = ({ + tagName: TagName = 'li', + children, + ...rest +}) => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 17, + columnNumber: 9 + } + }), children); +}; +const TermLink = props => { + const { + link, + name + } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_context__WEBPACK_IMPORTED_MODULE_1__.PostTermContext); + return ( + // @ts-ignore-next-line - The inert attribute is not yet in the HTMLAnchorElement type. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", _extends({ + href: link, + inert: "true" + }, props, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 25, + columnNumber: 3 + } + }), name) + ); +}; + +/***/ }), + +/***/ "./components/post-title/index.tsx": +/*!*****************************************!*\ + !*** ./components/post-title/index.tsx ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_216040__) { + +"use strict"; +__nested_webpack_require_216040__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_216040__.d(__nested_webpack_exports__, { +/* harmony export */ PostTitle: function() { return /* binding */ PostTitle; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_216040__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_216040__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_216040__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_216040__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_216040__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_216040__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_216040__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_216040__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_216040__(/*! ../../hooks */ "./hooks/index.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/post-title/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + +const PostTitle = ({ + tagName: TagName = 'h1', + ...rest +}) => { + const { + postId, + postType, + isEditable + } = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.usePost)(); + const [rawTitle = '', setTitle, fullTitle] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityProp)('postType', postType, 'title', postId); + const titlePlaceholder = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)( + // @ts-ignore-next-line - The type definitions for the block-editor store are incomplete. + select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store).getSettings().titlePlaceholder, []); + if (!isEditable) { + // @ts-ignore-next-line + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(TagName, _extends({}, rest, { + dangerouslySetInnerHTML: { + __html: fullTitle?.rendered + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 27, + columnNumber: 10 + } + })); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, _extends({ + tagName: TagName, + placeholder: titlePlaceholder, + value: rawTitle, + onChange: value => setTitle(value), + allowedFormats: [] + }, rest, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 31, + columnNumber: 3 + } + })); +}; + +/***/ }), + +/***/ "./components/repeater/index.js": +/*!**************************************!*\ + !*** ./components/repeater/index.js ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_219752__) { + +"use strict"; +__nested_webpack_require_219752__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_219752__.d(__nested_webpack_exports__, { +/* harmony export */ AbstractRepeater: function() { return /* binding */ AbstractRepeater; }, +/* harmony export */ AttributeRepeater: function() { return /* binding */ AttributeRepeater; }, +/* harmony export */ Repeater: function() { return /* binding */ Repeater; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_219752__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_219752__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_219752__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_219752__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_219752__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_219752__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_219752__(/*! uuid */ "uuid"); +/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__nested_webpack_require_219752__.n(uuid__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_219752__(/*! @dnd-kit/core */ "@dnd-kit/core"); +/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_219752__(/*! @dnd-kit/sortable */ "@dnd-kit/sortable"); +/* harmony import */ var _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var _dnd_kit_modifiers__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_219752__(/*! @dnd-kit/modifiers */ "@dnd-kit/modifiers"); +/* harmony import */ var _dnd_kit_modifiers__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_dnd_kit_modifiers__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_219752__(/*! @dnd-kit/utilities */ "@dnd-kit/utilities"); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__nested_webpack_require_219752__.n(_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var _drag_handle__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_219752__(/*! ../drag-handle */ "./components/drag-handle/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/repeater/index.js"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + + + + + + + + + + + + + +/** + * The Sortable Item Component. + * + * @param {object} props React props + * @param {Function} props.children Render prop to render the children. + * @param {object} props.item The repeater item object. + * @param {Function} props.setItem A function to set state of a repeater item. + * @param {Function} props.removeItem A function to delete a repeater item. + * @param {string} props.id A string identifier for a repeater item. + * @returns {*} React JSX + */ +const SortableItem = ({ + children, + item = {}, + setItem = null, + removeItem = null, + id = '' +}) => { + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + isDragging + } = (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__.useSortable)({ + id + }); + const style = { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_10__.CSS.Transform.toString(transform), + transition, + display: 'flex', + zIndex: isDragging ? 999 : 1, + position: 'relative' + }; + const repeaterItem = children(item, id, setItem, removeItem); + const clonedRepeaterChild = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(repeaterItem, { + ref: setNodeRef, + style, + className: isDragging ? `${repeaterItem.props.className} repeater-item--is-dragging` : repeaterItem.props.className + }, [(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_drag_handle__WEBPACK_IMPORTED_MODULE_11__.DragHandle, _extends({ + className: "repeater-item__drag-handle" + }, attributes, listeners, { + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 63, + columnNumber: 4 + } + })), repeaterItem.props.children]); + return clonedRepeaterChild; +}; + +/** + * The Repeater Component. + * + * @param {object} props React props + * @param {Function} props.children Render prop to render the children. + * @param {string} props.addButton render prop to customize the "Add item" button. + * @param {boolean} props.allowReordering boolean to toggle reordering of Repeater items. + * @param {Function} props.onChange callback function to update the block attribute. + * @param {Array} props.value array of Repeater items. + * @param {Array} props.defaultValue array of default Repeater items. + * @returns {*} React JSX + */ +const AbstractRepeater = ({ + children, + addButton = null, + allowReordering = false, + onChange, + value, + defaultValue = [] +}) => { + const sensors = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.useSensors)((0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.PointerSensor), (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.useSensor)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.KeyboardSensor, { + coordinateGetter: _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__.sortableKeyboardCoordinates + })); + function handleDragEnd(event) { + const { + active, + over + } = event; + if (active.id !== over.id) { + const moveArray = items => { + const oldIndex = items.findIndex(item => item.id === active.id); + const newIndex = items.findIndex(item => item.id === over.id); + return (0,_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__.arrayMove)(items, oldIndex, newIndex); + }; + onChange(moveArray(value)); + } + } + + /** + * Adds a new repeater item. + */ + function addItem() { + /* + * [...defaultValue] does a shallow copy. To ensure deep-copy, + * we do JSON.parse(JSON.stringify()). + */ + const defaultValueCopy = JSON.parse(JSON.stringify(defaultValue)); + if (!defaultValue.length) { + defaultValueCopy.push({}); + } + defaultValueCopy[0].id = (0,uuid__WEBPACK_IMPORTED_MODULE_6__.v4)(); + onChange([...value, ...defaultValueCopy]); + } + + /** + * Updates the item currently being edited. + * + * @param {string|number|boolean} newValue The value that should be used to updated the item. + * @param {number} index The index at which the item should be updated. + */ + function setItem(newValue, index) { + /* + * [...value] does a shallow copy. To ensure deep-copy, + * we do JSON.parse(JSON.stringify()). + */ + const valueCopy = JSON.parse(JSON.stringify(value)); + if (typeof newValue === 'object' && newValue !== null) { + valueCopy[index] = { + ...valueCopy[index], + ...newValue + }; + } else { + valueCopy[index] = newValue; + } + onChange(valueCopy); + } + + /** + * Removes an item from the list. + * + * @param {number} index The index of the item that needs to be removed. + */ + function removeItem(index) { + const valueCopy = JSON.parse(JSON.stringify(value)).filter((item, innerIndex) => index !== innerIndex); + onChange(valueCopy); + } + const itemIds = value.map(item => item.id); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, allowReordering ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.DndContext, { + sensors: sensors, + collisionDetection: _dnd_kit_core__WEBPACK_IMPORTED_MODULE_7__.closestCenter, + onDragEnd: e => handleDragEnd(e), + modifiers: [_dnd_kit_modifiers__WEBPACK_IMPORTED_MODULE_9__.restrictToVerticalAxis], + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 171, + columnNumber: 5 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__.SortableContext, { + items: itemIds, + strategy: _dnd_kit_sortable__WEBPACK_IMPORTED_MODULE_8__.verticalListSortingStrategy, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 177, + columnNumber: 6 + } + }, value.map((item, key) => { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(SortableItem, { + item: item, + setItem: val => setItem(val, key), + removeItem: () => removeItem(key), + key: item.id, + id: item.id, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 180, + columnNumber: 9 + } + }, (item, id, setItem, removeItem) => { + return children(item, id, val => setItem(val, key), () => removeItem(key)); + }); + }))) : value.map((item, key) => { + return children(item, item.id, val => setItem(val, key), () => removeItem(key)); + }), typeof addButton === 'function' ? addButton(addItem) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Button, { + variant: "primary", + onClick: () => addItem(), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 213, + columnNumber: 5 + } + }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Add item'))); +}; +const AttributeRepeater = ({ + children, + attribute = null, + addButton = null, + allowReordering = false +}) => { + const { + clientId, + name + } = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockEditContext)(); + const { + updateBlockAttributes + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.dispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store); + const attributeValue = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { + const attributes = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlockAttributes(clientId); + return attributes[attribute] || []; + }); + const { + defaultRepeaterData + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { + return { + defaultRepeaterData: select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.store).getBlockType(name).attributes[attribute].default + }; + }); + if (defaultRepeaterData.length) { + defaultRepeaterData[0].id = (0,uuid__WEBPACK_IMPORTED_MODULE_6__.v4)(); + } + const handleOnChange = value => { + updateBlockAttributes(clientId, { + [attribute]: value + }); + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(AbstractRepeater, { + addButton: addButton, + allowReordering: allowReordering, + onChange: handleOnChange, + value: attributeValue, + defaultValue: defaultRepeaterData, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 251, + columnNumber: 3 + } + }, children); +}; +const Repeater = ({ + children, + addButton = null, + allowReordering = false, + onChange, + value, + defaultValue = [], + attribute = null +}) => { + if (attribute) { + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(AttributeRepeater, { + attribute: attribute, + addButton: addButton, + allowReordering: allowReordering, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 274, + columnNumber: 4 + } + }, children); + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(AbstractRepeater, { + addButton: addButton, + allowReordering: allowReordering, + onChange: onChange, + value: value, + defaultValue: defaultValue, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 285, + columnNumber: 3 + } + }, children); +}; + +/***/ }), + +/***/ "./components/rich-text-character-limit/index.tsx": +/*!********************************************************!*\ + !*** ./components/rich-text-character-limit/index.tsx ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_233662__) { + +"use strict"; +__nested_webpack_require_233662__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_233662__.d(__nested_webpack_exports__, { +/* harmony export */ RichTextCharacterLimit: function() { return /* binding */ RichTextCharacterLimit; }, +/* harmony export */ getCharacterCount: function() { return /* binding */ getCharacterCount; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_233662__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_233662__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_233662__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_233662__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_233662__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); +/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_233662__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_233662__(/*! @floating-ui/react-dom */ "@floating-ui/react-dom"); +/* harmony import */ var _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_233662__.n(_floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _counter__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_233662__(/*! ../counter */ "./components/counter/index.tsx"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/rich-text-character-limit/index.tsx"; + +function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } + +// @ts-ignore-next-line - The type definitions for the block-editor package are incomplete. + + + + + +/* + * Get Character Count + * + * get character count from `RichText` string. + */ +const getCharacterCount = str => { + if (!str) { + return 0; + } + const richTextContent = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__.create)({ + html: str + }); + const textContent = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__.getTextContent)(richTextContent); + return textContent.length; +}; +/* + * Rich Text Character Limit + * + * extend `RichText` with the ability to add a character limit. + */ +const RichTextCharacterLimit = ({ + limit = 100, + enforce = true, + value, + onChange, + ...richTextProps +}) => { + const { + isSelected + } = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockEditContext)(); + const { + floatingStyles, + refs: { + setReference, + setFloating + } + } = (0,_floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3__.useFloating)({ + open: isSelected, + placement: 'bottom-end', + strategy: 'fixed', + whileElementsMounted: _floating_ui_react_dom__WEBPACK_IMPORTED_MODULE_3__.autoUpdate + }); + const [count, setCount] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(0); + const [richTextValue, setRichTextValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(value); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setCount(getCharacterCount(richTextValue)); + }, [richTextValue]); + + /* + * Sanitize + * + * remove characters if `enforce` is set to true. + */ + const sanitize = (str = value) => { + const richTextContent = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__.create)({ + html: str + }); + const isOverLimit = getCharacterCount(str) > limit; + if (isOverLimit && enforce) { + // Workaround which fixes an issue with `` not updating. + setRichTextValue(''); + return (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__.remove)(richTextContent, limit, getCharacterCount(str)); + } + return richTextContent; + }; + + /* + * Rich Text On Change + * + * set rich text value and run `onChange` from initial props. + */ + const richTextOnChange = (str = value) => { + const sanitized = (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_2__.toHTMLString)({ + value: sanitize(str) + }); + setRichTextValue(sanitized); + onChange(sanitized); + }; + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText, _extends({}, richTextProps, { + value: richTextValue, + onChange: str => richTextOnChange(str), + ref: setReference, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 91, + columnNumber: 4 + } + })), isSelected && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_counter__WEBPACK_IMPORTED_MODULE_4__.Counter, { + count: count, + limit: limit, + ref: setFloating, + style: floatingStyles, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 98, + columnNumber: 5 + } + })); +}; + + +/***/ }), + +/***/ "./components/styled-components-context/index.tsx": +/*!********************************************************!*\ + !*** ./components/styled-components-context/index.tsx ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_239491__) { + +"use strict"; +__nested_webpack_require_239491__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_239491__.d(__nested_webpack_exports__, { +/* harmony export */ StyledComponentContext: function() { return /* binding */ StyledComponentContext; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_239491__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_239491__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_239491__(/*! @emotion/react */ "@emotion/react"); +/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_239491__.n(_emotion_react__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_239491__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_239491__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_239491__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/components/styled-components-context/index.tsx"; + + + + + +const StyledComponentContext = ({ + children, + cacheKey +}) => { + const fallbackKey = `${(0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(StyledComponentContext)}`; + const defaultCache = (0,_emotion_cache__WEBPACK_IMPORTED_MODULE_2__["default"])({ + key: cacheKey || fallbackKey + }); + const [cache, setCache] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultCache); + const nodeRef = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useRefEffect)(node => { + if (node) { + setCache((0,_emotion_cache__WEBPACK_IMPORTED_MODULE_2__["default"])({ + key: cacheKey || fallbackKey, + container: node + })); + } + return () => { + setCache(defaultCache); + }; + }, [cacheKey, fallbackKey]); + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { + ref: nodeRef, + style: { + display: 'none' + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 48, + columnNumber: 4 + } + }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_emotion_react__WEBPACK_IMPORTED_MODULE_1__.CacheProvider, { + value: cache, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 49, + columnNumber: 4 + } + }, children)); +}; + +/***/ }), + +/***/ "./hooks/index.ts": +/*!************************!*\ + !*** ./hooks/index.ts ***! + \************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_242627__) { + +"use strict"; +__nested_webpack_require_242627__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_242627__.d(__nested_webpack_exports__, { +/* harmony export */ useAllTerms: function() { return /* reexport safe */ _use_all_terms__WEBPACK_IMPORTED_MODULE_8__.useAllTerms; }, +/* harmony export */ useBlockParentAttributes: function() { return /* reexport safe */ _use_block_parent_attributes__WEBPACK_IMPORTED_MODULE_5__.useBlockParentAttributes; }, +/* harmony export */ useFilteredList: function() { return /* reexport safe */ _use_filtered_list__WEBPACK_IMPORTED_MODULE_3__.useFilteredList; }, +/* harmony export */ useFlatInnerBlocks: function() { return /* reexport safe */ _use_flat_inner_blocks__WEBPACK_IMPORTED_MODULE_19__.useFlatInnerBlocks; }, +/* harmony export */ useHasSelectedInnerBlock: function() { return /* reexport safe */ _use_has_selected_inner_block__WEBPACK_IMPORTED_MODULE_0__.useHasSelectedInnerBlock; }, +/* harmony export */ useIcon: function() { return /* reexport safe */ _use_icons__WEBPACK_IMPORTED_MODULE_2__.useIcon; }, +/* harmony export */ useIcons: function() { return /* reexport safe */ _use_icons__WEBPACK_IMPORTED_MODULE_2__.useIcons; }, +/* harmony export */ useIsPluginActive: function() { return /* reexport safe */ _use_is_plugin_active__WEBPACK_IMPORTED_MODULE_12__.useIsPluginActive; }, +/* harmony export */ useIsSupportedMetaField: function() { return /* reexport safe */ _use_is_supported_meta_value__WEBPACK_IMPORTED_MODULE_18__.useIsSupportedMetaField; }, +/* harmony export */ useIsSupportedTaxonomy: function() { return /* reexport safe */ _use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_7__.useIsSupportedTaxonomy; }, +/* harmony export */ useMedia: function() { return /* reexport safe */ _use_media__WEBPACK_IMPORTED_MODULE_4__.useMedia; }, +/* harmony export */ usePopover: function() { return /* reexport safe */ _use_popover__WEBPACK_IMPORTED_MODULE_14__.usePopover; }, +/* harmony export */ usePost: function() { return /* reexport safe */ _use_post__WEBPACK_IMPORTED_MODULE_6__.usePost; }, +/* harmony export */ usePostMetaValue: function() { return /* reexport safe */ _use_post_meta_value__WEBPACK_IMPORTED_MODULE_16__.usePostMetaValue; }, +/* harmony export */ usePrimaryTerm: function() { return /* reexport safe */ _use_primary_term__WEBPACK_IMPORTED_MODULE_13__.usePrimaryTerm; }, +/* harmony export */ useRequestData: function() { return /* reexport safe */ _use_request_data__WEBPACK_IMPORTED_MODULE_1__.useRequestData; }, +/* harmony export */ useScript: function() { return /* reexport safe */ _use_script__WEBPACK_IMPORTED_MODULE_15__.useScript; }, +/* harmony export */ useSelectedTermIds: function() { return /* reexport safe */ _use_selected_term_ids__WEBPACK_IMPORTED_MODULE_9__.useSelectedTermIds; }, +/* harmony export */ useSelectedTerms: function() { return /* reexport safe */ _use_selected_terms__WEBPACK_IMPORTED_MODULE_10__.useSelectedTerms; }, +/* harmony export */ useSelectedTermsOfSavedPost: function() { return /* reexport safe */ _use_selected_terms_of_saved_post__WEBPACK_IMPORTED_MODULE_11__.useSelectedTermsOfSavedPost; }, +/* harmony export */ useTaxonomy: function() { return /* reexport safe */ _use_taxonomy__WEBPACK_IMPORTED_MODULE_17__.useTaxonomy; } +/* harmony export */ }); +/* harmony import */ var _use_has_selected_inner_block__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_242627__(/*! ./use-has-selected-inner-block */ "./hooks/use-has-selected-inner-block/index.ts"); +/* harmony import */ var _use_request_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_242627__(/*! ./use-request-data */ "./hooks/use-request-data/index.ts"); +/* harmony import */ var _use_icons__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_242627__(/*! ./use-icons */ "./hooks/use-icons/index.ts"); +/* harmony import */ var _use_filtered_list__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_242627__(/*! ./use-filtered-list */ "./hooks/use-filtered-list/index.ts"); +/* harmony import */ var _use_media__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_242627__(/*! ./use-media */ "./hooks/use-media/index.ts"); +/* harmony import */ var _use_block_parent_attributes__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_242627__(/*! ./use-block-parent-attributes */ "./hooks/use-block-parent-attributes/index.ts"); +/* harmony import */ var _use_post__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_242627__(/*! ./use-post */ "./hooks/use-post/index.ts"); +/* harmony import */ var _use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_242627__(/*! ./use-is-supported-taxonomy */ "./hooks/use-is-supported-taxonomy/index.ts"); +/* harmony import */ var _use_all_terms__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_242627__(/*! ./use-all-terms */ "./hooks/use-all-terms/index.ts"); +/* harmony import */ var _use_selected_term_ids__WEBPACK_IMPORTED_MODULE_9__ = __nested_webpack_require_242627__(/*! ./use-selected-term-ids */ "./hooks/use-selected-term-ids/index.ts"); +/* harmony import */ var _use_selected_terms__WEBPACK_IMPORTED_MODULE_10__ = __nested_webpack_require_242627__(/*! ./use-selected-terms */ "./hooks/use-selected-terms/index.ts"); +/* harmony import */ var _use_selected_terms_of_saved_post__WEBPACK_IMPORTED_MODULE_11__ = __nested_webpack_require_242627__(/*! ./use-selected-terms-of-saved-post */ "./hooks/use-selected-terms-of-saved-post/index.ts"); +/* harmony import */ var _use_is_plugin_active__WEBPACK_IMPORTED_MODULE_12__ = __nested_webpack_require_242627__(/*! ./use-is-plugin-active */ "./hooks/use-is-plugin-active/index.ts"); +/* harmony import */ var _use_primary_term__WEBPACK_IMPORTED_MODULE_13__ = __nested_webpack_require_242627__(/*! ./use-primary-term */ "./hooks/use-primary-term/index.ts"); +/* harmony import */ var _use_popover__WEBPACK_IMPORTED_MODULE_14__ = __nested_webpack_require_242627__(/*! ./use-popover */ "./hooks/use-popover/index.tsx"); +/* harmony import */ var _use_script__WEBPACK_IMPORTED_MODULE_15__ = __nested_webpack_require_242627__(/*! ./use-script */ "./hooks/use-script/index.ts"); +/* harmony import */ var _use_post_meta_value__WEBPACK_IMPORTED_MODULE_16__ = __nested_webpack_require_242627__(/*! ./use-post-meta-value */ "./hooks/use-post-meta-value/index.ts"); +/* harmony import */ var _use_taxonomy__WEBPACK_IMPORTED_MODULE_17__ = __nested_webpack_require_242627__(/*! ./use-taxonomy */ "./hooks/use-taxonomy/index.ts"); +/* harmony import */ var _use_is_supported_meta_value__WEBPACK_IMPORTED_MODULE_18__ = __nested_webpack_require_242627__(/*! ./use-is-supported-meta-value */ "./hooks/use-is-supported-meta-value/index.ts"); +/* harmony import */ var _use_flat_inner_blocks__WEBPACK_IMPORTED_MODULE_19__ = __nested_webpack_require_242627__(/*! ./use-flat-inner-blocks */ "./hooks/use-flat-inner-blocks/index.ts"); + + + + + + + + + + + + + + + + + + + + + +/***/ }), + +/***/ "./hooks/use-all-terms/index.ts": +/*!**************************************!*\ + !*** ./hooks/use-all-terms/index.ts ***! + \**************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_249489__) { + +"use strict"; +__nested_webpack_require_249489__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_249489__.d(__nested_webpack_exports__, { +/* harmony export */ useAllTerms: function() { return /* binding */ useAllTerms; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_249489__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_249489__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_249489__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_249489__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +const useAllTerms = taxonomyName => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getEntityRecords, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const termsSelector = ['taxonomy', taxonomyName, { + per_page: -1, + context: 'view' + }]; + const terms = getEntityRecords(...termsSelector); + const hasResolvedTerms = hasFinishedResolution('getEntityRecords', termsSelector); + return [terms, hasResolvedTerms]; + }, [taxonomyName]); +}; + +/***/ }), + +/***/ "./hooks/use-block-parent-attributes/index.ts": +/*!****************************************************!*\ + !*** ./hooks/use-block-parent-attributes/index.ts ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_251319__) { + +"use strict"; +__nested_webpack_require_251319__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_251319__.d(__nested_webpack_exports__, { +/* harmony export */ useBlockParentAttributes: function() { return /* binding */ useBlockParentAttributes; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_251319__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_251319__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_251319__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_251319__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); + +// @ts-ignore-next-line - The type definitions for the block-editor package are incomplete. + + +/* + * useBlockParentAttributes + * + * allows you to easily interface with the attributes of the direct + * parent of the current block + */ +function useBlockParentAttributes() { + const { + clientId + } = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockEditContext)(); + const parentBlocks = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)( + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlockParents(clientId), [clientId]); + const parentBlockClientId = parentBlocks[parentBlocks.length - 1]; + const parentBlock = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)( + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).getBlock(parentBlockClientId), [parentBlockClientId]); + const { + updateBlockAttributes + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store); + const setParentAttributes = attributes => { + updateBlockAttributes(parentBlockClientId, attributes); + }; + return [parentBlock?.attributes ?? {}, setParentAttributes]; +} + +/***/ }), + +/***/ "./hooks/use-filtered-list/index.ts": +/*!******************************************!*\ + !*** ./hooks/use-filtered-list/index.ts ***! + \******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_253872__) { + +"use strict"; +__nested_webpack_require_253872__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_253872__.d(__nested_webpack_exports__, { +/* harmony export */ useFilteredList: function() { return /* binding */ useFilteredList; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_253872__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_253872__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _leeoniya_ufuzzy__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_253872__(/*! @leeoniya/ufuzzy */ "@leeoniya/ufuzzy"); +/* harmony import */ var _leeoniya_ufuzzy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_253872__.n(_leeoniya_ufuzzy__WEBPACK_IMPORTED_MODULE_1__); + + + +// eslint-disable-next-line new-cap +const fuzzy = new (_leeoniya_ufuzzy__WEBPACK_IMPORTED_MODULE_1___default())(); + +/** + * useFilteredList + * + * @param {Array} list list of items to filter + * @param {string} searchTerm search term string + * @param {string?} property name of the prop + * @returns {Array} filtered list + */ +function useFilteredList(list = [], searchTerm = '', property = 'name') { + const [filteredList, setFilteredList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(list); + const propertyList = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => list.map(item => item[property]), [list, property]); + const filterList = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(searchTerm => { + const matchedNames = fuzzy.filter(propertyList, searchTerm); + const results = matchedNames?.map(index => list[index]) || []; + return results; + }, [propertyList, list]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const hasListItems = !!list?.length; + const hasSearchTerm = searchTerm !== ''; + const canFilter = hasSearchTerm && hasListItems; + const newFilteredList = canFilter ? filterList(searchTerm) : list; + setFilteredList(newFilteredList); + }, [searchTerm, filterList, list]); + return [filteredList]; +} + +/***/ }), + +/***/ "./hooks/use-flat-inner-blocks/index.ts": +/*!**********************************************!*\ + !*** ./hooks/use-flat-inner-blocks/index.ts ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_256346__) { + +"use strict"; +__nested_webpack_require_256346__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_256346__.d(__nested_webpack_exports__, { +/* harmony export */ useFlatInnerBlocks: function() { return /* binding */ useFlatInnerBlocks; } +/* harmony export */ }); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_256346__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_256346__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_256346__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_256346__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); + + +const useFlatInnerBlocks = clientId => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { + function recursivelyGetInnerBlocks(clientId) { + let allInnerBlocks = []; + + // @ts-expect-error - TS doesn't know about the block editor store + const innerBlocks = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.store).getBlocks(clientId); + innerBlocks.forEach(block => { + allInnerBlocks.push(block); + allInnerBlocks = allInnerBlocks.concat(recursivelyGetInnerBlocks(block.clientId)); + }); + return allInnerBlocks; + } + return recursivelyGetInnerBlocks(clientId); + }, [clientId]); +}; + +/***/ }), + +/***/ "./hooks/use-has-selected-inner-block/index.ts": +/*!*****************************************************!*\ + !*** ./hooks/use-has-selected-inner-block/index.ts ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_258228__) { + +"use strict"; +__nested_webpack_require_258228__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_258228__.d(__nested_webpack_exports__, { +/* harmony export */ useHasSelectedInnerBlock: function() { return /* binding */ useHasSelectedInnerBlock; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_258228__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_258228__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_258228__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_258228__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); + +// @ts-ignore-next-line - The type definitions for the block-editor package are incomplete. + + +/* + * useHasSelectedInnerBlock + * Determine whether one of the inner blocks currently is selected + */ +function useHasSelectedInnerBlock() { + const { + clientId + } = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockEditContext)(); + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)( + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + select => select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.store).hasSelectedInnerBlock(clientId, true), [clientId]); +} + +/***/ }), + +/***/ "./hooks/use-icons/index.ts": +/*!**********************************!*\ + !*** ./hooks/use-icons/index.ts ***! + \**********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_260005__) { + +"use strict"; +__nested_webpack_require_260005__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_260005__.d(__nested_webpack_exports__, { +/* harmony export */ useIcon: function() { return /* binding */ useIcon; }, +/* harmony export */ useIcons: function() { return /* binding */ useIcons; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_260005__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_260005__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_260005__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_260005__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _stores__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_260005__(/*! ../../stores */ "./stores/index.ts"); + + + +function transformIcons(iconSet) { + return iconSet.icons.map(icon => ({ + ...icon, + iconSet: iconSet.name + })); +} +const useIcons = (iconSet = '') => { + const [icons, setIcons] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]); + const rawIcons = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + const { + getIconSet, + getIconSets + } = select(_stores__WEBPACK_IMPORTED_MODULE_2__.iconStore); + if (iconSet) { + return getIconSet(iconSet); + } + return getIconSets(); + }, [iconSet]); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { + if (iconSet) { + setIcons(transformIcons(rawIcons)); + } + setIcons(Object.values(rawIcons).reduce((rawIcons, iconSet) => [...rawIcons, ...transformIcons(iconSet)], [])); + }, [rawIcons, iconSet]); + return icons; +}; +const useIcon = (iconSet, name) => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + return select(_stores__WEBPACK_IMPORTED_MODULE_2__.iconStore).getIcon(iconSet, name); + }, [iconSet, name]); +}; + + +/***/ }), + +/***/ "./hooks/use-is-plugin-active/index.ts": +/*!*********************************************!*\ + !*** ./hooks/use-is-plugin-active/index.ts ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_262437__) { + +"use strict"; +__nested_webpack_require_262437__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_262437__.d(__nested_webpack_exports__, { +/* harmony export */ useIsPluginActive: function() { return /* binding */ useIsPluginActive; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_262437__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_262437__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_262437__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_262437__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +const ACTIVE_STATUSES = ['active', 'network-active']; + +/** + * Custom hook to check if a plugin is active and whether its resolution has finished. + * + * @param {string} pluginName The name of the plugin to check. + * @returns {[boolean, boolean]} A tuple with the first value being whether the plugin is active and the second value being whether the resolution has finished. + */ +const useIsPluginActive = pluginName => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + const storeSelectors = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const plugin = storeSelectors.getPlugin(pluginName); + const hasResolvedPlugins = storeSelectors.hasFinishedResolution('getPlugin', [pluginName]); + + // @ts-ignore-next-line - The check here is intentional to see if the plugin is active. + const isPluginActive = ACTIVE_STATUSES.includes(plugin?.status); + return [isPluginActive, hasResolvedPlugins]; + }, [pluginName]); +}; + +/***/ }), + +/***/ "./hooks/use-is-supported-meta-value/index.ts": +/*!****************************************************!*\ + !*** ./hooks/use-is-supported-meta-value/index.ts ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_264607__) { + +"use strict"; +__nested_webpack_require_264607__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_264607__.d(__nested_webpack_exports__, { +/* harmony export */ useIsSupportedMetaField: function() { return /* binding */ useIsSupportedMetaField; } +/* harmony export */ }); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_264607__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_264607__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _use_post__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_264607__(/*! ../use-post */ "./hooks/use-post/index.ts"); + + +const useIsSupportedMetaField = metaKey => { + const { + postId, + postType + } = (0,_use_post__WEBPACK_IMPORTED_MODULE_1__.usePost)(); + const { + record + } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__.useEntityRecord)('postType', postType, postId); + const { + meta + } = record || {}; // Add type assertion + const supportedMetaKeys = Object.keys(meta || {}); + const isSupportedMetaField = supportedMetaKeys?.some(name => name === metaKey); + return [!!isSupportedMetaField]; +}; + +/***/ }), + +/***/ "./hooks/use-is-supported-taxonomy/index.ts": +/*!**************************************************!*\ + !*** ./hooks/use-is-supported-taxonomy/index.ts ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_266143__) { + +"use strict"; +__nested_webpack_require_266143__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_266143__.d(__nested_webpack_exports__, { +/* harmony export */ useIsSupportedTaxonomy: function() { return /* binding */ useIsSupportedTaxonomy; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_266143__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_266143__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_266143__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_266143__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +const useIsSupportedTaxonomy = (postType, taxonomyName) => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getPostType, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const postTypeObject = getPostType(postType); + const hasResolvedPostType = hasFinishedResolution('getPostType', [postType]); + const isSupportedTaxonomy = postTypeObject?.taxonomies?.some(name => name === taxonomyName); + return [!!isSupportedTaxonomy, hasResolvedPostType]; + }, [postType, taxonomyName]); +}; + +/***/ }), + +/***/ "./hooks/use-media/index.ts": +/*!**********************************!*\ + !*** ./hooks/use-media/index.ts ***! + \**********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_267953__) { + +"use strict"; +__nested_webpack_require_267953__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_267953__.d(__nested_webpack_exports__, { +/* harmony export */ useMedia: function() { return /* binding */ useMedia; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_267953__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_267953__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_267953__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_267953__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +function useMedia(id) { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getMedia, + isResolving, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const mediaParameters = [id, { + context: 'view' + }]; + return { + media: getMedia(...mediaParameters), + isResolvingMedia: isResolving('getMedia', mediaParameters), + hasResolvedMedia: hasFinishedResolution('getMedia', mediaParameters) + }; + }, [id]); +} + +/***/ }), + +/***/ "./hooks/use-on-click-outside.ts": +/*!***************************************!*\ + !*** ./hooks/use-on-click-outside.ts ***! + \***************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_269696__) { + +"use strict"; +__nested_webpack_require_269696__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_269696__.d(__nested_webpack_exports__, { +/* harmony export */ useOnClickOutside: function() { return /* binding */ useOnClickOutside; } +/* harmony export */ }); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_269696__(/*! @wordpress/compose */ "@wordpress/compose"); +/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_269696__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * useOnClickOutside + * + * Note: This hook is only intended to be used in the WordPress backend/block editor. + * + * @param {Function} onClickOutside callback that will get invoked when the user clicks outside of the target + * @returns {object} ref to the target element + */ +function useOnClickOutside(onClickOutside) { + const ref = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__.useRefEffect)(element => { + if (!element) { + return () => {}; + } + const listener = event => { + // Do nothing if clicking ref's element or descendent elements + if (!element || element.contains(event.target)) { + return; + } + onClickOutside(event); + }; + const ownerDocument = element.ownerDocument || document; + const isRenderedInsideIframe = ownerDocument !== document; + const editorCanvasIframe = document.querySelector('[name="editor-canvas"]'); + const editorCanvasDocument = editorCanvasIframe?.contentDocument; + ownerDocument.addEventListener('mousedown', listener); + ownerDocument.addEventListener('touchstart', listener); + + // If the element is rendered inside an iframe, we need to listen to events on the parent document + // as well to detect clicks outside the iframe. + if (isRenderedInsideIframe) { + document.addEventListener('mousedown', listener); + document.addEventListener('touchstart', listener); + + // If the element is rendered outside the editor canvas iframe, we need to listen to events on the editor canvas + // document as well to detect clicks inside the editor canvas. + } else if (editorCanvasDocument) { + editorCanvasDocument.addEventListener('mousedown', listener); + editorCanvasDocument.addEventListener('touchstart', listener); + } + return () => { + ownerDocument.removeEventListener('mousedown', listener); + ownerDocument.removeEventListener('touchstart', listener); + if (isRenderedInsideIframe) { + document.removeEventListener('mousedown', listener); + document.removeEventListener('touchstart', listener); + } else if (editorCanvasDocument) { + editorCanvasDocument.removeEventListener('mousedown', listener); + editorCanvasDocument.removeEventListener('touchstart', listener); + } + }; + }, [onClickOutside]); + return ref; +} + +/***/ }), + +/***/ "./hooks/use-popover/index.tsx": +/*!*************************************!*\ + !*** ./hooks/use-popover/index.tsx ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_272820__) { + +"use strict"; +__nested_webpack_require_272820__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_272820__.d(__nested_webpack_exports__, { +/* harmony export */ usePopover: function() { return /* binding */ usePopover; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_272820__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_272820__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_272820__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_272820__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _use_on_click_outside__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_272820__(/*! ../use-on-click-outside */ "./hooks/use-on-click-outside.ts"); +var _jsxFileName = "/Users/fabiankaegy/Developer/10up/block-components/hooks/use-popover/index.tsx"; + + + + +const usePopover = () => { + // Use internal state instead of a ref to make sure that the component + // re-renders when the popover's anchor updates. + const [popoverAnchor, setPopoverAnchor] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(); + const [isVisible, setIsVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const toggleVisible = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + setIsVisible(visible => !visible); + }, []); + const toggleProps = { + onClick: toggleVisible, + 'aria-expanded': isVisible, + ref: setPopoverAnchor + }; + const ref = (0,_use_on_click_outside__WEBPACK_IMPORTED_MODULE_2__.useOnClickOutside)(() => setIsVisible(false)); + const PopoverComponent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + children + }) => { + if (!isVisible) { + return null; + } + return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Popover, { + ref: ref, + anchor: popoverAnchor, + focusOnMount: false, + animate: false, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 35, + columnNumber: 6 + } + }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + style: { + padding: '16px', + minWidth: '250px' + }, + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 36, + columnNumber: 7 + } + }, children)); + }, [isVisible, popoverAnchor, ref]); + return { + setPopoverAnchor, + toggleVisible, + toggleProps, + Popover: PopoverComponent + }; +}; + +/***/ }), + +/***/ "./hooks/use-post-meta-value/index.ts": +/*!********************************************!*\ + !*** ./hooks/use-post-meta-value/index.ts ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_275976__) { + +"use strict"; +__nested_webpack_require_275976__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_275976__.d(__nested_webpack_exports__, { +/* harmony export */ usePostMetaValue: function() { return /* binding */ usePostMetaValue; } +/* harmony export */ }); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_275976__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_275976__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _use_post__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_275976__(/*! ../use-post */ "./hooks/use-post/index.ts"); + + +const usePostMetaValue = metaKey => { + const { + postId, + postType + } = (0,_use_post__WEBPACK_IMPORTED_MODULE_1__.usePost)(); + const [meta, setMeta] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__.useEntityProp)('postType', postType, 'meta', postId); + if (!meta || !metaKey || !Object.prototype.hasOwnProperty.call(meta, metaKey)) { + return [undefined, () => {}]; + } + const metaValue = meta[metaKey]; + const setMetaValue = newValue => { + setMeta({ + ...meta, + [metaKey]: newValue + }); + }; + return [metaValue, setMetaValue]; +}; + +/***/ }), + +/***/ "./hooks/use-post/index.ts": +/*!*********************************!*\ + !*** ./hooks/use-post/index.ts ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_277494__) { + +"use strict"; +__nested_webpack_require_277494__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_277494__.d(__nested_webpack_exports__, { +/* harmony export */ usePost: function() { return /* binding */ usePost; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_277494__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_277494__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_277494__(/*! @wordpress/editor */ "@wordpress/editor"); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_277494__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _components_post_context_context__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_277494__(/*! ../../components/post-context/context */ "./components/post-context/context.ts"); + +// @ts-ignore-next-line - The type definitions for the editor package are incomplete. + + +function usePost() { + const { + postId: blockContextPostId, + postType: blockContextPostType, + isEditable: blockContextIsEditable + } = (0,_components_post_context_context__WEBPACK_IMPORTED_MODULE_2__.usePostContext)(); + const { + globalPostId, + globalPostType + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => ({ + globalPostId: select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_1__.store).getCurrentPostId(), + globalPostType: select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_1__.store).getCurrentPostType() + }), []); + const hasBlockContext = !!blockContextPostId && !!blockContextPostType; + return { + postId: blockContextPostId || globalPostId, + postType: blockContextPostType || globalPostType, + isEditable: hasBlockContext ? blockContextIsEditable : true + }; +} + +/***/ }), + +/***/ "./hooks/use-primary-term/index.ts": +/*!*****************************************!*\ + !*** ./hooks/use-primary-term/index.ts ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_279712__) { + +"use strict"; +__nested_webpack_require_279712__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_279712__.d(__nested_webpack_exports__, { +/* harmony export */ usePrimaryTerm: function() { return /* binding */ usePrimaryTerm; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_279712__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_279712__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_279712__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_279712__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_279712__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_279712__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _use_post__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_279712__(/*! ../use-post */ "./hooks/use-post/index.ts"); +/* harmony import */ var _use_is_plugin_active__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_279712__(/*! ../use-is-plugin-active */ "./hooks/use-is-plugin-active/index.ts"); +/* harmony import */ var _use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_279712__(/*! ../use-is-supported-taxonomy */ "./hooks/use-is-supported-taxonomy/index.ts"); + + + + + + +const usePrimaryTerm = taxonomyName => { + const { + postType, + isEditable + } = (0,_use_post__WEBPACK_IMPORTED_MODULE_3__.usePost)(); + const [isYoastSeoActive, hasResolvedIsPluginActive] = (0,_use_is_plugin_active__WEBPACK_IMPORTED_MODULE_4__.useIsPluginActive)('wordpress-seo/wp-seo'); + const [isSupportedTaxonomy, hasResolvedIsSupportedTaxonomy] = (0,_use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_5__.useIsSupportedTaxonomy)(postType, taxonomyName); + const primaryTermId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + if (!hasResolvedIsSupportedTaxonomy || !hasResolvedIsPluginActive) { + return null; + } + if (!isYoastSeoActive && hasResolvedIsPluginActive) { + // eslint-disable-next-line no-console + console.error('Yoast SEO is not active. Please install and activate Yoast SEO to use the PostPrimaryCategory component.'); + return null; + } + if (!isSupportedTaxonomy && hasResolvedIsSupportedTaxonomy) { + // eslint-disable-next-line no-console + console.error(`The taxonomy "${taxonomyName}" is not supported for the post type "${postType}". Please use a supported taxonomy.`); + return null; + } + const yoastStore = select('yoast-seo/editor'); + if (!yoastStore) { + // eslint-disable-next-line no-console + console.error(`The yoast-seo/editor store does is not available.`); + return null; + } + + // @ts-ignore-next-line - The type definitions for the Yoast store are incomplete. + return select('yoast-seo/editor').getPrimaryTaxonomyId(taxonomyName); + }, [taxonomyName, isYoastSeoActive, isSupportedTaxonomy, hasResolvedIsSupportedTaxonomy, hasResolvedIsPluginActive]); + const primaryTerm = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + if (!primaryTermId) { + return null; + } + const { + getEntityRecord + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store); + return getEntityRecord('taxonomy', taxonomyName, primaryTermId); + }, [primaryTermId]); + return [!isEditable ? { + name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Primary Term', 'tenup'), + link: '#' + } : primaryTerm, isSupportedTaxonomy]; +}; + +/***/ }), + +/***/ "./hooks/use-request-data/index.ts": +/*!*****************************************!*\ + !*** ./hooks/use-request-data/index.ts ***! + \*****************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_283852__) { + +"use strict"; +__nested_webpack_require_283852__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_283852__.d(__nested_webpack_exports__, { +/* harmony export */ useRequestData: function() { return /* binding */ useRequestData; } +/* harmony export */ }); +/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_283852__(/*! lodash/isObject */ "./node_modules/lodash/isObject.js"); +/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_283852__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_283852__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_283852__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_283852__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_283852__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); +/** + * External dependencies + */ +// eslint-disable-next-line import/no-extraneous-dependencies + + +/** + * WordPress dependencies + */ + +// @ts-ignore-next-line - The type definitions for the data package are incomplete. + + +/** + * Hook for retrieving data from the WordPress REST API. + * + * @param {string} entity The entity to retrieve. ie. postType + * @param {string} kind The entity kind to retrieve. ie. posts + * @param {object | number} [query] Optional. Query to pass to the geEntityRecords request. Defaults to an empty object. If a number is passed, it is used as the ID of the entity to retrieve via getEntityRecord. + * @returns {Array} The data returned from the request. + */ +const useRequestData = (entity, kind, query = {}) => { + const functionToCall = lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default()(query) ? 'getEntityRecords' : 'getEntityRecord'; + const { + invalidateResolution + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)('core/data'); + const { + data, + isLoading + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => { + return { + // @ts-ignore-next-line - The type definitions for the data package are incomplete. + data: select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store)[functionToCall](entity, kind, query), + isLoading: select('core/data').isResolving(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store, functionToCall, [entity, kind, query]) + }; + }, [entity, kind, query]); + const invalidateResolver = () => { + invalidateResolution(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store, functionToCall, [entity, kind, query]); + }; + return [data, isLoading, invalidateResolver]; +}; + +/***/ }), + +/***/ "./hooks/use-script/index.ts": +/*!***********************************!*\ + !*** ./hooks/use-script/index.ts ***! + \***********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_287009__) { + +"use strict"; +__nested_webpack_require_287009__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_287009__.d(__nested_webpack_exports__, { +/* harmony export */ useScript: function() { return /* binding */ useScript; } +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_287009__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_287009__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Add a script tag to body + * + * @param {string} scriptSource Source URL of the script to be loaded. + * @returns {HTMLScriptElement} The script tag. + */ +const useScript = scriptSource => { + const scriptElement = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const [scriptLoaded, setScriptLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (window) { + scriptElement.current = document.createElement('script'); + scriptElement.current.src = scriptSource; + scriptElement.current.async = true; + scriptElement.current.type = 'text/javascript'; + scriptElement.current.addEventListener('load', () => { + setScriptLoaded(true); + }, { + once: true, + passive: true + }); + document.body.appendChild(scriptElement.current); + } + return () => { + scriptElement.current?.remove(); + }; + }, [scriptSource]); + return { + hasLoaded: scriptLoaded, + scriptElement: scriptElement.current + }; +}; + +/***/ }), + +/***/ "./hooks/use-selected-term-ids/index.ts": +/*!**********************************************!*\ + !*** ./hooks/use-selected-term-ids/index.ts ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_288940__) { + +"use strict"; +__nested_webpack_require_288940__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_288940__.d(__nested_webpack_exports__, { +/* harmony export */ useSelectedTermIds: function() { return /* binding */ useSelectedTermIds; } +/* harmony export */ }); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_288940__(/*! @wordpress/editor */ "@wordpress/editor"); +/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_288940__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_288940__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_288940__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_288940__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_288940__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__); +// @ts-ignore-next-line - The type definitions for the editor package are incomplete. + + + +const useSelectedTermIds = taxonomyName => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getTaxonomy, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store); + const taxonomyObject = getTaxonomy(taxonomyName); + const hasResolvedTaxonomyObject = hasFinishedResolution('getTaxonomy', [taxonomyName]); + const { + getEditedPostAttribute + } = select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store); + const selectedTermIds = getEditedPostAttribute(taxonomyObject?.rest_base); + return [selectedTermIds, hasResolvedTaxonomyObject]; + }, [taxonomyName]); +}; + +/***/ }), + +/***/ "./hooks/use-selected-terms-of-saved-post/index.ts": +/*!*********************************************************!*\ + !*** ./hooks/use-selected-terms-of-saved-post/index.ts ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_291309__) { + +"use strict"; +__nested_webpack_require_291309__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_291309__.d(__nested_webpack_exports__, { +/* harmony export */ useSelectedTermsOfSavedPost: function() { return /* binding */ useSelectedTermsOfSavedPost; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_291309__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_291309__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_291309__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_291309__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +const useSelectedTermsOfSavedPost = (taxonomyName, postId) => { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getEntityRecords, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const selectedTermsQuery = ['taxonomy', taxonomyName, { + per_page: -1, + post: postId + }]; + const terms = getEntityRecords(...selectedTermsQuery); + const hasResolvedTerms = hasFinishedResolution('getEntityRecords', selectedTermsQuery); + return [terms, hasResolvedTerms]; + }, [taxonomyName, postId]); +}; + +/***/ }), + +/***/ "./hooks/use-selected-terms/index.ts": +/*!*******************************************!*\ + !*** ./hooks/use-selected-terms/index.ts ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_293181__) { + +"use strict"; +__nested_webpack_require_293181__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_293181__.d(__nested_webpack_exports__, { +/* harmony export */ useSelectedTerms: function() { return /* binding */ useSelectedTerms; } +/* harmony export */ }); +/* harmony import */ var _use_post__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_293181__(/*! ../use-post */ "./hooks/use-post/index.ts"); +/* harmony import */ var _use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_293181__(/*! ../use-is-supported-taxonomy */ "./hooks/use-is-supported-taxonomy/index.ts"); +/* harmony import */ var _use_all_terms__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_293181__(/*! ../use-all-terms */ "./hooks/use-all-terms/index.ts"); +/* harmony import */ var _use_selected_term_ids__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_293181__(/*! ../use-selected-term-ids */ "./hooks/use-selected-term-ids/index.ts"); +/* harmony import */ var _use_selected_terms_of_saved_post__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_293181__(/*! ../use-selected-terms-of-saved-post */ "./hooks/use-selected-terms-of-saved-post/index.ts"); + + + + + +const useSelectedTerms = taxonomyName => { + const { + postId, + postType, + isEditable + } = (0,_use_post__WEBPACK_IMPORTED_MODULE_0__.usePost)(); + const [isSupportedTaxonomy, hasResolvedIsSupportedTaxonomy] = (0,_use_is_supported_taxonomy__WEBPACK_IMPORTED_MODULE_1__.useIsSupportedTaxonomy)(postType, taxonomyName); + const [selectedTermIds, hasResolvedSelectedTermIds] = (0,_use_selected_term_ids__WEBPACK_IMPORTED_MODULE_3__.useSelectedTermIds)(taxonomyName); + const [terms, hasResolvedTerms] = (0,_use_all_terms__WEBPACK_IMPORTED_MODULE_2__.useAllTerms)(taxonomyName); + const [selectedTermsOfSavedPost, hasResolvedSelectedTermsOfSavedPost] = (0,_use_selected_terms_of_saved_post__WEBPACK_IMPORTED_MODULE_4__.useSelectedTermsOfSavedPost)(taxonomyName, postId); + if (!hasResolvedIsSupportedTaxonomy) { + return [[], false]; + } + if (!isSupportedTaxonomy && hasResolvedIsSupportedTaxonomy) { + // eslint-disable-next-line no-console + console.error(`The taxonomy "${taxonomyName}" is not supported for the post type "${postType}". Please use a supported taxonomy.`); + return [[], true]; + } + if (!isEditable && !hasResolvedSelectedTermsOfSavedPost || isEditable && (!hasResolvedTerms || !hasResolvedSelectedTermIds)) { + return [[], false]; + } + if (!isEditable && hasResolvedSelectedTermsOfSavedPost) { + return [selectedTermsOfSavedPost, hasResolvedSelectedTermsOfSavedPost]; + } + return [terms?.filter(term => selectedTermIds?.includes(term.id)), hasResolvedTerms && hasResolvedSelectedTermIds]; +}; + +/***/ }), + +/***/ "./hooks/use-taxonomy/index.ts": +/*!*************************************!*\ + !*** ./hooks/use-taxonomy/index.ts ***! + \*************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_296079__) { + +"use strict"; +__nested_webpack_require_296079__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_296079__.d(__nested_webpack_exports__, { +/* harmony export */ useTaxonomy: function() { return /* binding */ useTaxonomy; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_296079__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_296079__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_296079__(/*! @wordpress/core-data */ "@wordpress/core-data"); +/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_296079__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__); + + +function useTaxonomy(taxonomyName) { + return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => { + // @ts-ignore-next-line - The type definitions for the core store are incomplete. + const { + getTaxonomy, + hasFinishedResolution + } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.store); + const hasResolvedTaxonomy = hasFinishedResolution('getTaxonomy', [taxonomyName]); + const taxonomy = getTaxonomy(taxonomyName); + return [taxonomy, hasResolvedTaxonomy]; + }, [taxonomyName]); +} + +/***/ }), + +/***/ "./stores/icons/actions.ts": +/*!*********************************!*\ + !*** ./stores/icons/actions.ts ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_297720__) { + +"use strict"; +__nested_webpack_require_297720__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_297720__.d(__nested_webpack_exports__, { +/* harmony export */ registerIconSet: function() { return /* binding */ registerIconSet; }, +/* harmony export */ removeIconSet: function() { return /* binding */ removeIconSet; } +/* harmony export */ }); +/** + * Returns an action object used in signalling that new block styles have been added. + * + * @param {object} iconSet icon set. + * + * @returns {object} Action object. + */ +function registerIconSet(iconSet) { + return { + type: 'REGISTER_ICON_SET', + iconSet + }; +} + +/** + * Returns an action object used in signalling that block styles have been removed. + * + * @param {string} name Icon Set name. + * + * @returns {object} Action object. + */ +function removeIconSet(name) { + return { + type: 'REMOVE_ICON_SET', + name + }; +} + +/***/ }), + +/***/ "./stores/icons/index.ts": +/*!*******************************!*\ + !*** ./stores/icons/index.ts ***! + \*******************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_298825__) { + +"use strict"; +__nested_webpack_require_298825__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_298825__.d(__nested_webpack_exports__, { +/* harmony export */ store: function() { return /* binding */ store; } +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_298825__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_298825__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_298825__(/*! ./reducer */ "./stores/icons/reducer.ts"); +/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_298825__(/*! ./selectors */ "./stores/icons/selectors.ts"); +/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_298825__(/*! ./actions */ "./stores/icons/actions.ts"); +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +const STORE_NAME = 'tenup/icons'; + +/** + * Store definition for the icons namespace. + * + * @type {object} + */ +const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createReduxStore)(STORE_NAME, { + reducer: _reducer__WEBPACK_IMPORTED_MODULE_1__["default"], + selectors: _selectors__WEBPACK_IMPORTED_MODULE_2__, + actions: _actions__WEBPACK_IMPORTED_MODULE_3__ +}); +const hasStore = !!(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(STORE_NAME); +if (!hasStore) { + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.register)(store); +} + +/***/ }), + +/***/ "./stores/icons/reducer.ts": +/*!*********************************!*\ + !*** ./stores/icons/reducer.ts ***! + \*********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_300613__) { + +"use strict"; +__nested_webpack_require_300613__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_300613__.d(__nested_webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ reducer; } +/* harmony export */ }); +/* eslint-disable default-param-last */ + +/* + * Reducer managing the block style variations. + */ +function reducer(state = { + iconSets: {} +}, action) { + switch (action.type) { + case 'REGISTER_ICON_SET': + return { + ...state, + iconSets: { + ...state.iconSets, + [action.iconSet.name]: action.iconSet + } + }; + case 'REMOVE_ICON_SET': + // eslint-disable-next-line no-prototype-builtins + if (state.iconSets.hasOwnProperty(action.name)) { + const newState = { + ...state + }; + delete newState.iconSets[action.name]; + return newState; + } + return state; + default: + return state; + } +} + +/***/ }), + +/***/ "./stores/icons/selectors.ts": +/*!***********************************!*\ + !*** ./stores/icons/selectors.ts ***! + \***********************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_301789__) { + +"use strict"; +__nested_webpack_require_301789__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_301789__.d(__nested_webpack_exports__, { +/* harmony export */ getIcon: function() { return /* binding */ getIcon; }, +/* harmony export */ getIconSet: function() { return /* binding */ getIconSet; }, +/* harmony export */ getIconSets: function() { return /* binding */ getIconSets; }, +/* harmony export */ getIcons: function() { return /* binding */ getIcons; } +/* harmony export */ }); +/* eslint-disable no-prototype-builtins */ + +/** + * Returns all icons sets + * + * @param {object} state Data state. + * + * @returns {Array?} Icon Sets. + */ +function getIconSets(state) { + const { + iconSets + } = state; + return Object.values(iconSets); +} + +/** + * Returns an Icon Set by its name + * + * @param {object} state Data state. + * @param {string} name Name of the Icon Set. + * + * @returns {object?} Icon Set. + */ +function getIconSet(state, name) { + const { + iconSets + } = state; + const iconSet = iconSets[name] ?? []; + return iconSet; +} + +/** + * Returns an icon of an icon set by its name + * + * @param {object} state Data state. + * @param {string} name Name of the Icon Set. + * + * @returns {Array?} List of Icons. + */ +function getIcons(state, name) { + const { + iconSets + } = state; + return iconSets?.hasOwnProperty(name) ? iconSets[name]?.icons ?? [] : []; +} + +/** + * Returns an icon of an icon set by its name + * + * @param {object} state Data state. + * @param {string} name Name of the Icon Set. + * @param {string} iconName Name of the iconName. + * + * @returns {object?} Icon. + */ +function getIcon(state, name, iconName) { + const { + iconSets + } = state; + return iconSets?.hasOwnProperty(name) ? iconSets[name]?.icons?.find(item => item.name === iconName) ?? [] : undefined; +} + +/***/ }), + +/***/ "./stores/index.ts": +/*!*************************!*\ + !*** ./stores/index.ts ***! + \*************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_303783__) { + +"use strict"; +__nested_webpack_require_303783__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_303783__.d(__nested_webpack_exports__, { +/* harmony export */ iconStore: function() { return /* reexport safe */ _icons__WEBPACK_IMPORTED_MODULE_0__.store; } +/* harmony export */ }); +/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_303783__(/*! ./icons */ "./stores/icons/index.ts"); + + +/***/ }), + +/***/ "./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_304579__) { + +"use strict"; +__nested_webpack_require_304579__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_304579__.d(__nested_webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ createCache; } +/* harmony export */ }); +/* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_304579__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Tokenizer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Utility.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_5__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_6__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Serializer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_7__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Middleware.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_8__ = __nested_webpack_require_304579__(/*! stylis */ "./node_modules/stylis/src/Parser.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_304579__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_304579__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + + + + +var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { + var previous = 0; + var character = 0; + + while (true) { + previous = character; + character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)(); // &\f + + if (previous === 38 && character === 12) { + points[index] = 1; + } + + if ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + break; + } + + (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)(); + } + + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.slice)(begin, stylis__WEBPACK_IMPORTED_MODULE_3__.position); +}; + +var toRules = function toRules(parsed, points) { + // pretend we've started with a comma + var index = -1; + var character = 44; + + do { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + case 0: + // &\f + if (character === 38 && (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 12) { + // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings + // stylis inserts \f after & to know when & where it should replace this sequence with the context selector + // and when it should just concatenate the outer and inner selectors + // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here + points[index] = 1; + } + + parsed[index] += identifierWithPointTracking(stylis__WEBPACK_IMPORTED_MODULE_3__.position - 1, points, index); + break; + + case 2: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_3__.delimit)(character); + break; + + case 4: + // comma + if (character === 44) { + // colon + parsed[++index] = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 58 ? '&\f' : ''; + points[index] = parsed[index].length; + break; + } + + // fallthrough + + default: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_4__.from)(character); + } + } while (character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)()); + + return parsed; +}; + +var getRules = function getRules(value, points) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.dealloc)(toRules((0,stylis__WEBPACK_IMPORTED_MODULE_3__.alloc)(value), points)); +}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 + + +var fixedElements = /* #__PURE__ */new WeakMap(); +var compat = function compat(element) { + if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo + // negative .length indicates that this rule has been already prefixed + element.length < 1) { + return; + } + + var value = element.value, + parent = element.parent; + var isImplicitRule = element.column === parent.column && element.line === parent.line; + + while (parent.type !== 'rule') { + parent = parent.parent; + if (!parent) return; + } // short-circuit for the simplest case + + + if (element.props.length === 1 && value.charCodeAt(0) !== 58 + /* colon */ + && !fixedElements.get(parent)) { + return; + } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) + // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" + + + if (isImplicitRule) { + return; + } + + fixedElements.set(element, true); + var points = []; + var rules = getRules(value, points); + var parentRules = parent.props; + + for (var i = 0, k = 0; i < rules.length; i++) { + for (var j = 0; j < parentRules.length; j++, k++) { + element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; + } + } +}; +var removeLabel = function removeLabel(element) { + if (element.type === 'decl') { + var value = element.value; + + if ( // charcode for l + value.charCodeAt(0) === 108 && // charcode for b + value.charCodeAt(2) === 98) { + // this ignores label + element["return"] = ''; + element.value = ''; + } + } +}; +var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; + +var isIgnoringComment = function isIgnoringComment(element) { + return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; +}; + +var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { + return function (element, index, children) { + if (element.type !== 'rule' || cache.compat) return; + var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); + + if (unsafePseudoClasses) { + var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` + // + // considering this input: + // .a { + // .b /* comm */ {} + // color: hotpink; + // } + // we get output corresponding to this: + // .a { + // & { + // /* comm */ + // color: hotpink; + // } + // .b {} + // } + + var commentContainer = isNested ? element.parent.children : // global rule at the root level + children; + + for (var i = commentContainer.length - 1; i >= 0; i--) { + var node = commentContainer[i]; + + if (node.line < element.line) { + break; + } // it is quite weird but comments are *usually* put at `column: element.column - 1` + // so we seek *from the end* for the node that is earlier than the rule's `element` and check that + // this will also match inputs like this: + // .a { + // /* comm */ + // .b {} + // } + // + // but that is fine + // + // it would be the easiest to change the placement of the comment to be the first child of the rule: + // .a { + // .b { /* comm */ } + // } + // with such inputs we wouldn't have to search for the comment at all + // TODO: consider changing this comment placement in the next major version + + + if (node.column < element.column) { + if (isIgnoringComment(node)) { + return; + } + + break; + } + } + + unsafePseudoClasses.forEach(function (unsafePseudoClass) { + console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); + }); + } + }; +}; + +var isImportRule = function isImportRule(element) { + return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; +}; + +var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { + for (var i = index - 1; i >= 0; i--) { + if (!isImportRule(children[i])) { + return true; + } + } + + return false; +}; // use this to remove incorrect elements from further processing +// so they don't get handed to the `sheet` (or anything else) +// as that could potentially lead to additional logs which in turn could be overhelming to the user + + +var nullifyElement = function nullifyElement(element) { + element.type = ''; + element.value = ''; + element["return"] = ''; + element.children = ''; + element.props = ''; +}; + +var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { + if (!isImportRule(element)) { + return; + } + + if (element.parent) { + console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); + nullifyElement(element); + } else if (isPrependedWithRegularRules(index, children)) { + console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); + nullifyElement(element); + } +}; + +/* eslint-disable no-fallthrough */ + +function prefix(value, length) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.hash)(value, length)) { + // color-adjust + case 5103: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'print-' + value + value; + // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) + + case 5737: + case 4201: + case 3177: + case 3433: + case 1641: + case 4457: + case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break + + case 5572: + case 6356: + case 5844: + case 3191: + case 6645: + case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, + + case 6391: + case 5879: + case 5623: + case 6135: + case 4599: + case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) + + case 4215: + case 6389: + case 5109: + case 5365: + case 5621: + case 3829: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // appearance, user-select, transform, hyphens, text-size-adjust + + case 5349: + case 4246: + case 4810: + case 6968: + case 2756: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // flex, flex-direction + + case 6828: + case 4268: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // order + + case 6165: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-' + value + value; + // align-items + + case 5187: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(\w+).+(:[^]+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-$1$2' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-$1$2') + value; + // align-self + + case 5443: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-item-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /flex-|-self/, '') + value; + // align-content + + case 4675: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-line-pack' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /align-content|flex-|-self/, '') + value; + // flex-shrink + + case 5548: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'shrink', 'negative') + value; + // flex-basis + + case 5292: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'basis', 'preferred-size') + value; + // flex-grow + + case 6060: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, '-grow', '') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'grow', 'positive') + value; + // transition + + case 4554: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /([^-])(transform)/g, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2') + value; + // cursor + + case 6187: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(zoom-|grab)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), /(image-set)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), value, '') + value; + // background, background-image + + case 5495: + case 3959: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(image-set\([^]*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1' + '$`$1'); + // justify-content + + case 4968: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(flex-)?(.*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-pack:$3' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // (margin|padding)-inline-(start|end) + + case 4095: + case 3583: + case 4068: + case 2532: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+)-inline(.+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1$2') + value; + // (min|max)?(width|height|inline-size|block-size) + + case 8116: + case 7059: + case 5753: + case 5535: + case 5445: + case 5701: + case 4933: + case 4677: + case 5533: + case 5789: + case 5021: + case 4765: + // stretch, max-content, min-content, fill-available + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 1 - length > 6) switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1)) { + // (m)ax-content, (m)in-content + case 109: + // - + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 4) !== 45) break; + // (f)ill-available, (f)it-content + + case 102: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(.+)-([^]+)/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2-$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; + // (s)tretch + + case 115: + return ~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, 'stretch') ? prefix((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'stretch', 'fill-available'), length) + value : value; + } + break; + // position: sticky + + case 4949: + // (s)ticky? + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1) !== 115) break; + // display: (flex|inline-flex) + + case 6444: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, (0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 3 - (~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, '!important') && 10))) { + // stic(k)y + case 107: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, ':', ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + value; + // (inline-)?fl(e)x + + case 101: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + '$2box$3') + value; + } + + break; + // writing-mode + + case 5936: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 11)) { + // vertical-l(r) + case 114: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; + // vertical-r(l) + + case 108: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; + // horizontal(-)tb + + case 45: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; + } + + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + } + + return value; +} + +var prefixer = function prefixer(element, index, children, callback) { + if (element.length > -1) if (!element["return"]) switch (element.type) { + case stylis__WEBPACK_IMPORTED_MODULE_5__.DECLARATION: + element["return"] = prefix(element.value, element.length); + break; + + case stylis__WEBPACK_IMPORTED_MODULE_5__.KEYFRAMES: + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + value: (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(element.value, '@', '@' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + })], callback); + + case stylis__WEBPACK_IMPORTED_MODULE_5__.RULESET: + if (element.length) return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.combine)(element.props, function (value) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.match)(value, /(::plac\w+|:read-\w+)/)) { + // :read-(only|write) + case ':read-only': + case ':read-write': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(read-\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + })], callback); + // :placeholder + + case '::placeholder': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'input-$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'input-$1')] + })], callback); + } + + return ''; + }); + } +}; + +var defaultStylisPlugins = [prefixer]; + +var createCache = function createCache(options) { + var key = options.key; + + if ( true && !key) { + throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements."); + } + + if (key === 'css') { + var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration + // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) + // note this very very intentionally targets all style elements regardless of the key to ensure + // that creating a cache works inside of render of a React component + + Array.prototype.forEach.call(ssrStyles, function (node) { + // we want to only move elements which have a space in the data-emotion attribute value + // because that indicates that it is an Emotion 11 server-side rendered style elements + // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector + // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) + // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles + // will not result in the Emotion 10 styles being destroyed + var dataEmotionAttribute = node.getAttribute('data-emotion'); + + if (dataEmotionAttribute.indexOf(' ') === -1) { + return; + } + document.head.appendChild(node); + node.setAttribute('data-s', ''); + }); + } + + var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; + + if (true) { + // $FlowFixMe + if (/[^a-z-]/.test(key)) { + throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed"); + } + } + + var inserted = {}; + var container; + var nodesToHydrate = []; + + { + container = options.container || document.head; + Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which + // means that the style elements we're looking at are only Emotion 11 server-rendered style elements + document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { + var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe + + for (var i = 1; i < attrib.length; i++) { + inserted[attrib[i]] = true; + } + + nodesToHydrate.push(node); + }); + } + + var _insert; + + var omnipresentPlugins = [compat, removeLabel]; + + if (true) { + omnipresentPlugins.push(createUnsafeSelectorsAlarm({ + get compat() { + return cache.compat; + } + + }), incorrectImportAlarm); + } + + { + var currentSheet; + var finalizingPlugins = [stylis__WEBPACK_IMPORTED_MODULE_6__.stringify, true ? function (element) { + if (!element.root) { + if (element["return"]) { + currentSheet.insert(element["return"]); + } else if (element.value && element.type !== stylis__WEBPACK_IMPORTED_MODULE_5__.COMMENT) { + // insert empty rule in non-production environments + // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet + currentSheet.insert(element.value + "{}"); + } + } + } : 0]; + var serializer = (0,stylis__WEBPACK_IMPORTED_MODULE_7__.middleware)(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); + + var stylis = function stylis(styles) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)((0,stylis__WEBPACK_IMPORTED_MODULE_8__.compile)(styles), serializer); + }; + + _insert = function insert(selector, serialized, sheet, shouldCache) { + currentSheet = sheet; + + if ( true && serialized.map !== undefined) { + currentSheet = { + insert: function insert(rule) { + sheet.insert(rule + serialized.map); + } + }; + } + + stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); + + if (shouldCache) { + cache.inserted[serialized.name] = true; + } + }; + } + + var cache = { + key: key, + sheet: new _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__.StyleSheet({ + key: key, + container: container, + nonce: options.nonce, + speedy: options.speedy, + prepend: options.prepend, + insertionPoint: options.insertionPoint + }), + nonce: options.nonce, + inserted: inserted, + registered: {}, + insert: _insert + }; + cache.sheet.hydrate(nodesToHydrate); + return cache; +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_329509__) { + +"use strict"; +__nested_webpack_require_329509__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_329509__.d(__nested_webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ memoize; } +/* harmony export */ }); +function memoize(fn) { + var cache = Object.create(null); + return function (arg) { + if (cache[arg] === undefined) cache[arg] = fn(arg); + return cache[arg]; + }; +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_330311__) { + +"use strict"; +__nested_webpack_require_330311__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_330311__.d(__nested_webpack_exports__, { +/* harmony export */ StyleSheet: function() { return /* binding */ StyleSheet; } +/* harmony export */ }); +/* + +Based off glamor's StyleSheet, thanks Sunil ❤️ + +high performance StyleSheet for css-in-js systems + +- uses multiple style tags behind the scenes for millions of rules +- uses `insertRule` for appending in production for *much* faster performance + +// usage + +import { StyleSheet } from '@emotion/sheet' + +let styleSheet = new StyleSheet({ key: '', container: document.head }) + +styleSheet.insert('#box { border: 1px solid red; }') +- appends a css rule into the stylesheet + +styleSheet.flush() +- empties the stylesheet of all its contents + +*/ +// $FlowFixMe +function sheetForTag(tag) { + if (tag.sheet) { + // $FlowFixMe + return tag.sheet; + } // this weirdness brought to you by firefox + + /* istanbul ignore next */ + + + for (var i = 0; i < document.styleSheets.length; i++) { + if (document.styleSheets[i].ownerNode === tag) { + // $FlowFixMe + return document.styleSheets[i]; + } + } +} + +function createStyleElement(options) { + var tag = document.createElement('style'); + tag.setAttribute('data-emotion', options.key); + + if (options.nonce !== undefined) { + tag.setAttribute('nonce', options.nonce); + } + + tag.appendChild(document.createTextNode('')); + tag.setAttribute('data-s', ''); + return tag; +} + +var StyleSheet = /*#__PURE__*/function () { + // Using Node instead of HTMLElement since container may be a ShadowRoot + function StyleSheet(options) { + var _this = this; + + this._insertTag = function (tag) { + var before; + + if (_this.tags.length === 0) { + if (_this.insertionPoint) { + before = _this.insertionPoint.nextSibling; + } else if (_this.prepend) { + before = _this.container.firstChild; + } else { + before = _this.before; + } + } else { + before = _this.tags[_this.tags.length - 1].nextSibling; + } + + _this.container.insertBefore(tag, before); + + _this.tags.push(tag); + }; + + this.isSpeedy = options.speedy === undefined ? "development" === 'production' : options.speedy; + this.tags = []; + this.ctr = 0; + this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets + + this.key = options.key; + this.container = options.container; + this.prepend = options.prepend; + this.insertionPoint = options.insertionPoint; + this.before = null; + } + + var _proto = StyleSheet.prototype; + + _proto.hydrate = function hydrate(nodes) { + nodes.forEach(this._insertTag); + }; + + _proto.insert = function insert(rule) { + // the max length is how many rules we have per style tag, it's 65000 in speedy mode + // it's 1 in dev because we insert source maps that map a single rule to a location + // and you can only have one source map per style tag + if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { + this._insertTag(createStyleElement(this)); + } + + var tag = this.tags[this.tags.length - 1]; + + if (true) { + var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; + + if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) { + // this would only cause problem in speedy mode + // but we don't want enabling speedy to affect the observable behavior + // so we report this error at all times + console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.'); + } + this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; + } + + if (this.isSpeedy) { + var sheet = sheetForTag(tag); + + try { + // this is the ultrafast version, works across browsers + // the big drawback is that the css won't be editable in devtools + sheet.insertRule(rule, sheet.cssRules.length); + } catch (e) { + if ( true && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { + console.error("There was a problem inserting the following rule: \"" + rule + "\"", e); + } + } + } else { + tag.appendChild(document.createTextNode(rule)); + } + + this.ctr++; + }; + + _proto.flush = function flush() { + // $FlowFixMe + this.tags.forEach(function (tag) { + return tag.parentNode && tag.parentNode.removeChild(tag); + }); + this.tags = []; + this.ctr = 0; + + if (true) { + this._alreadyInsertedOrderInsensitiveRule = false; + } + }; + + return StyleSheet; +}(); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_335614__) { + +"use strict"; +__nested_webpack_require_335614__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_335614__.d(__nested_webpack_exports__, { +/* harmony export */ "default": function() { return /* binding */ weakMemoize; } +/* harmony export */ }); +var weakMemoize = function weakMemoize(func) { + // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps + var cache = new WeakMap(); + return function (arg) { + if (cache.has(arg)) { + // $FlowFixMe + return cache.get(arg); + } + + var ret = func(arg); + cache.set(arg, ret); + return ret; + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/lodash/isObject.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isObject.js ***! + \*****************************************/ +/***/ (function(module) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ "@dnd-kit/core": +/*!********************************!*\ + !*** external "@dnd-kit/core" ***! + \********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); + +/***/ }), + +/***/ "@dnd-kit/modifiers": +/*!*************************************!*\ + !*** external "@dnd-kit/modifiers" ***! + \*************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @dnd-kit/modifiers */ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js"); + +/***/ }), + +/***/ "@dnd-kit/sortable": +/*!************************************!*\ + !*** external "@dnd-kit/sortable" ***! + \************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @dnd-kit/sortable */ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js"); + +/***/ }), + +/***/ "@dnd-kit/utilities": +/*!*************************************!*\ + !*** external "@dnd-kit/utilities" ***! + \*************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + +/***/ }), + +/***/ "@emotion/react": +/*!*********************************!*\ + !*** external "@emotion/react" ***! + \*********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @emotion/react */ "./node_modules/@emotion/react/dist/emotion-react.browser.development.esm.js"); + +/***/ }), + +/***/ "@emotion/styled": +/*!**********************************!*\ + !*** external "@emotion/styled" ***! + \**********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @emotion/styled */ "./node_modules/@emotion/styled/dist/emotion-styled.browser.development.esm.js"); + +/***/ }), + +/***/ "@floating-ui/react-dom": +/*!*****************************************!*\ + !*** external "@floating-ui/react-dom" ***! + \*****************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @floating-ui/react-dom */ "./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js"); + +/***/ }), + +/***/ "@leeoniya/ufuzzy": +/*!***********************************!*\ + !*** external "@leeoniya/ufuzzy" ***! + \***********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @leeoniya/ufuzzy */ "./node_modules/@leeoniya/ufuzzy/dist/uFuzzy.mjs"); + +/***/ }), + +/***/ "@tanstack/react-query": +/*!****************************************!*\ + !*** external "@tanstack/react-query" ***! + \****************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @tanstack/react-query */ "./node_modules/@tanstack/react-query/build/modern/index.cjs"); + +/***/ }), + +/***/ "@wordpress/api-fetch": +/*!***************************************!*\ + !*** external "@wordpress/api-fetch" ***! + \***************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); + +/***/ }), + +/***/ "@wordpress/block-editor": +/*!******************************************!*\ + !*** external "@wordpress/block-editor" ***! + \******************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); + +/***/ }), + +/***/ "@wordpress/blocks": +/*!************************************!*\ + !*** external "@wordpress/blocks" ***! + \************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); + +/***/ }), + +/***/ "@wordpress/components": +/*!****************************************!*\ + !*** external "@wordpress/components" ***! + \****************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); + +/***/ }), + +/***/ "@wordpress/compose": +/*!*************************************!*\ + !*** external "@wordpress/compose" ***! + \*************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); + +/***/ }), + +/***/ "@wordpress/core-data": +/*!***************************************!*\ + !*** external "@wordpress/core-data" ***! + \***************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); + +/***/ }), + +/***/ "@wordpress/data": +/*!**********************************!*\ + !*** external "@wordpress/data" ***! + \**********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); + +/***/ }), + +/***/ "@wordpress/date": +/*!**********************************!*\ + !*** external "@wordpress/date" ***! + \**********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); + +/***/ }), + +/***/ "@wordpress/deprecated": +/*!****************************************!*\ + !*** external "@wordpress/deprecated" ***! + \****************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated"); + +/***/ }), + +/***/ "@wordpress/dom-ready": +/*!***************************************!*\ + !*** external "@wordpress/dom-ready" ***! + \***************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); + +/***/ }), + +/***/ "@wordpress/editor": +/*!************************************!*\ + !*** external "@wordpress/editor" ***! + \************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor"); + +/***/ }), + +/***/ "@wordpress/element": +/*!*************************************!*\ + !*** external "@wordpress/element" ***! + \*************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); + +/***/ }), + +/***/ "@wordpress/hooks": +/*!***********************************!*\ + !*** external "@wordpress/hooks" ***! + \***********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks"); + +/***/ }), + +/***/ "@wordpress/html-entities": +/*!*******************************************!*\ + !*** external "@wordpress/html-entities" ***! + \*******************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); + +/***/ }), + +/***/ "@wordpress/i18n": +/*!**********************************!*\ + !*** external "@wordpress/i18n" ***! + \**********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); + +/***/ }), + +/***/ "@wordpress/icons": +/*!***********************************!*\ + !*** external "@wordpress/icons" ***! + \***********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/index.js"); + +/***/ }), + +/***/ "@wordpress/rich-text": +/*!***************************************!*\ + !*** external "@wordpress/rich-text" ***! + \***************************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); + +/***/ }), + +/***/ "@wordpress/url": +/*!*********************************!*\ + !*** external "@wordpress/url" ***! + \*********************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); + +/***/ }), + +/***/ "react-window": +/*!*******************************!*\ + !*** external "react-window" ***! + \*******************************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! react-window */ "./node_modules/react-window/dist/index.esm.js"); + +/***/ }), + +/***/ "uuid": +/*!***********************!*\ + !*** external "uuid" ***! + \***********************/ +/***/ (function(module) { + +"use strict"; +module.exports = __webpack_require__(/*! uuid */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/index.js"); + +/***/ }), + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/***/ (function(module, exports) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = ''; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (arg) { + classes = appendClass(classes, parseValue(arg)); + } + } + + return classes; + } + + function parseValue (arg) { + if (typeof arg === 'string' || typeof arg === 'number') { + return arg; + } + + if (typeof arg !== 'object') { + return ''; + } + + if (Array.isArray(arg)) { + return classNames.apply(null, arg); + } + + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + return arg.toString(); + } + + var classes = ''; + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes = appendClass(classes, key); + } + } + + return classes; + } + + function appendClass (value, newClass) { + if (!newClass) { + return value; + } + + if (value) { + return value + ' ' + newClass; + } + + return value + newClass; + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/stylis/src/Enum.js": +/*!*****************************************!*\ + !*** ./node_modules/stylis/src/Enum.js ***! + \*****************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_346672__) { + +"use strict"; +__nested_webpack_require_346672__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_346672__.d(__nested_webpack_exports__, { +/* harmony export */ CHARSET: function() { return /* binding */ CHARSET; }, +/* harmony export */ COMMENT: function() { return /* binding */ COMMENT; }, +/* harmony export */ COUNTER_STYLE: function() { return /* binding */ COUNTER_STYLE; }, +/* harmony export */ DECLARATION: function() { return /* binding */ DECLARATION; }, +/* harmony export */ DOCUMENT: function() { return /* binding */ DOCUMENT; }, +/* harmony export */ FONT_FACE: function() { return /* binding */ FONT_FACE; }, +/* harmony export */ FONT_FEATURE_VALUES: function() { return /* binding */ FONT_FEATURE_VALUES; }, +/* harmony export */ IMPORT: function() { return /* binding */ IMPORT; }, +/* harmony export */ KEYFRAMES: function() { return /* binding */ KEYFRAMES; }, +/* harmony export */ LAYER: function() { return /* binding */ LAYER; }, +/* harmony export */ MEDIA: function() { return /* binding */ MEDIA; }, +/* harmony export */ MOZ: function() { return /* binding */ MOZ; }, +/* harmony export */ MS: function() { return /* binding */ MS; }, +/* harmony export */ NAMESPACE: function() { return /* binding */ NAMESPACE; }, +/* harmony export */ PAGE: function() { return /* binding */ PAGE; }, +/* harmony export */ RULESET: function() { return /* binding */ RULESET; }, +/* harmony export */ SUPPORTS: function() { return /* binding */ SUPPORTS; }, +/* harmony export */ VIEWPORT: function() { return /* binding */ VIEWPORT; }, +/* harmony export */ WEBKIT: function() { return /* binding */ WEBKIT; } +/* harmony export */ }); +var MS = '-ms-' +var MOZ = '-moz-' +var WEBKIT = '-webkit-' + +var COMMENT = 'comm' +var RULESET = 'rule' +var DECLARATION = 'decl' + +var PAGE = '@page' +var MEDIA = '@media' +var IMPORT = '@import' +var CHARSET = '@charset' +var VIEWPORT = '@viewport' +var SUPPORTS = '@supports' +var DOCUMENT = '@document' +var NAMESPACE = '@namespace' +var KEYFRAMES = '@keyframes' +var FONT_FACE = '@font-face' +var COUNTER_STYLE = '@counter-style' +var FONT_FEATURE_VALUES = '@font-feature-values' +var LAYER = '@layer' + + +/***/ }), + +/***/ "./node_modules/stylis/src/Middleware.js": +/*!***********************************************!*\ + !*** ./node_modules/stylis/src/Middleware.js ***! + \***********************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_349136__) { + +"use strict"; +__nested_webpack_require_349136__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_349136__.d(__nested_webpack_exports__, { +/* harmony export */ middleware: function() { return /* binding */ middleware; }, +/* harmony export */ namespace: function() { return /* binding */ namespace; }, +/* harmony export */ prefixer: function() { return /* binding */ prefixer; }, +/* harmony export */ rulesheet: function() { return /* binding */ rulesheet; } +/* harmony export */ }); +/* harmony import */ var _Enum_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_349136__(/*! ./Enum.js */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var _Utility_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_349136__(/*! ./Utility.js */ "./node_modules/stylis/src/Utility.js"); +/* harmony import */ var _Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__ = __nested_webpack_require_349136__(/*! ./Tokenizer.js */ "./node_modules/stylis/src/Tokenizer.js"); +/* harmony import */ var _Serializer_js__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_349136__(/*! ./Serializer.js */ "./node_modules/stylis/src/Serializer.js"); +/* harmony import */ var _Prefixer_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_349136__(/*! ./Prefixer.js */ "./node_modules/stylis/src/Prefixer.js"); + + + + + + +/** + * @param {function[]} collection + * @return {function} + */ +function middleware (collection) { + var length = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.sizeof)(collection) + + return function (element, index, children, callback) { + var output = '' + + for (var i = 0; i < length; i++) + output += collection[i](element, index, children, callback) || '' + + return output + } +} + +/** + * @param {function} callback + * @return {function} + */ +function rulesheet (callback) { + return function (element) { + if (!element.root) + if (element = element.return) + callback(element) + } +} + +/** + * @param {object} element + * @param {number} index + * @param {object[]} children + * @param {function} callback + */ +function prefixer (element, index, children, callback) { + if (element.length > -1) + if (!element.return) + switch (element.type) { + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.DECLARATION: element.return = (0,_Prefixer_js__WEBPACK_IMPORTED_MODULE_2__.prefix)(element.value, element.length, children) + return + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.KEYFRAMES: + return (0,_Serializer_js__WEBPACK_IMPORTED_MODULE_3__.serialize)([(0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.copy)(element, {value: (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(element.value, '@', '@' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT)})], callback) + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.RULESET: + if (element.length) + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.combine)(element.props, function (value) { + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(value, /(::plac\w+|:read-\w+)/)) { + // :read-(only|write) + case ':read-only': case ':read-write': + return (0,_Serializer_js__WEBPACK_IMPORTED_MODULE_3__.serialize)([(0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.copy)(element, {props: [(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /:(read-\w+)/, ':' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MOZ + '$1')]})], callback) + // :placeholder + case '::placeholder': + return (0,_Serializer_js__WEBPACK_IMPORTED_MODULE_3__.serialize)([ + (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.copy)(element, {props: [(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /:(plac\w+)/, ':' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + 'input-$1')]}), + (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.copy)(element, {props: [(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /:(plac\w+)/, ':' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MOZ + '$1')]}), + (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.copy)(element, {props: [(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /:(plac\w+)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'input-$1')]}) + ], callback) + } + + return '' + }) + } +} + +/** + * @param {object} element + * @param {number} index + * @param {object[]} children + */ +function namespace (element) { + switch (element.type) { + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.RULESET: + element.props = element.props.map(function (value) { + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.combine)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_4__.tokenize)(value), function (value, index, children) { + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, 0)) { + // \f + case 12: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.substr)(value, 1, (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.strlen)(value)) + // \0 ( + > ~ + case 0: case 40: case 43: case 62: case 126: + return value + // : + case 58: + if (children[++index] === 'global') + children[index] = '', children[++index] = '\f' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.substr)(children[index], index = 1, -1) + // \s + case 32: + return index === 1 ? '' : value + default: + switch (index) { + case 0: element = value + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.sizeof)(children) > 1 ? '' : value + case index = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.sizeof)(children) - 1: case 2: + return index === 2 ? value + element + element : value + element + default: + return value + } + } + }) + }) + } +} + + +/***/ }), + +/***/ "./node_modules/stylis/src/Parser.js": +/*!*******************************************!*\ + !*** ./node_modules/stylis/src/Parser.js ***! + \*******************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_354962__) { + +"use strict"; +__nested_webpack_require_354962__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_354962__.d(__nested_webpack_exports__, { +/* harmony export */ comment: function() { return /* binding */ comment; }, +/* harmony export */ compile: function() { return /* binding */ compile; }, +/* harmony export */ declaration: function() { return /* binding */ declaration; }, +/* harmony export */ parse: function() { return /* binding */ parse; }, +/* harmony export */ ruleset: function() { return /* binding */ ruleset; } +/* harmony export */ }); +/* harmony import */ var _Enum_js__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_354962__(/*! ./Enum.js */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var _Utility_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_354962__(/*! ./Utility.js */ "./node_modules/stylis/src/Utility.js"); +/* harmony import */ var _Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_354962__(/*! ./Tokenizer.js */ "./node_modules/stylis/src/Tokenizer.js"); + + + + +/** + * @param {string} value + * @return {object[]} + */ +function compile (value) { + return (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.dealloc)(parse('', null, null, null, [''], value = (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.alloc)(value), 0, [0], value)) +} + +/** + * @param {string} value + * @param {object} root + * @param {object?} parent + * @param {string[]} rule + * @param {string[]} rules + * @param {string[]} rulesets + * @param {number[]} pseudo + * @param {number[]} points + * @param {string[]} declarations + * @return {object} + */ +function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { + var index = 0 + var offset = 0 + var length = pseudo + var atrule = 0 + var property = 0 + var previous = 0 + var variable = 1 + var scanning = 1 + var ampersand = 1 + var character = 0 + var type = '' + var props = rules + var children = rulesets + var reference = rule + var characters = type + + while (scanning) + switch (previous = character, character = (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.next)()) { + // ( + case 40: + if (previous != 108 && (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.charat)(characters, length - 1) == 58) { + if ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.indexof)(characters += (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.replace)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.delimit)(character), '&', '&\f'), '&\f') != -1) + ampersand = -1 + break + } + // " ' [ + case 34: case 39: case 91: + characters += (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.delimit)(character) + break + // \t \n \r \s + case 9: case 10: case 13: case 32: + characters += (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.whitespace)(previous) + break + // \ + case 92: + characters += (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.escaping)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.caret)() - 1, 7) + continue + // / + case 47: + switch ((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.peek)()) { + case 42: case 47: + ;(0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.append)(comment((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.commenter)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.next)(), (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.caret)()), root, parent), declarations) + break + default: + characters += '/' + } + break + // { + case 123 * variable: + points[index++] = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(characters) * ampersand + // } ; \0 + case 125 * variable: case 59: case 0: + switch (character) { + // \0 } + case 0: case 125: scanning = 0 + // ; + case 59 + offset: if (ampersand == -1) characters = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.replace)(characters, /\f/g, '') + if (property > 0 && ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(characters) - length)) + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.append)(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration((0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.replace)(characters, ' ', '') + ';', rule, parent, length - 2), declarations) + break + // @ ; + case 59: characters += ';' + // { rule/at-rule + default: + ;(0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.append)(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets) + + if (character === 123) + if (offset === 0) + parse(characters, root, reference, reference, props, rulesets, length, points, children) + else + switch (atrule === 99 && (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.charat)(characters, 3) === 110 ? 100 : atrule) { + // d l m s + case 100: case 108: case 109: case 115: + parse(value, reference, reference, rule && (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.append)(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) + break + default: + parse(characters, reference, reference, reference, [''], children, 0, points, children) + } + } + + index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo + break + // : + case 58: + length = 1 + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(characters), property = previous + default: + if (variable < 1) + if (character == 123) + --variable + else if (character == 125 && variable++ == 0 && (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.prev)() == 125) + continue + + switch (characters += (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.from)(character), character * variable) { + // & + case 38: + ampersand = offset > 0 ? 1 : (characters += '\f', -1) + break + // , + case 44: + points[index++] = ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(characters) - 1) * ampersand, ampersand = 1 + break + // @ + case 64: + // - + if ((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.peek)() === 45) + characters += (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.delimit)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.next)()) + + atrule = (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.peek)(), offset = length = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(type = characters += (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.identifier)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.caret)())), character++ + break + // - + case 45: + if (previous === 45 && (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.strlen)(characters) == 2) + variable = 0 + } + } + + return rulesets +} + +/** + * @param {string} value + * @param {object} root + * @param {object?} parent + * @param {number} index + * @param {number} offset + * @param {string[]} rules + * @param {number[]} points + * @param {string} type + * @param {string[]} props + * @param {string[]} children + * @param {number} length + * @return {object} + */ +function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) { + var post = offset - 1 + var rule = offset === 0 ? rules : [''] + var size = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.sizeof)(rule) + + for (var i = 0, j = 0, k = 0; i < index; ++i) + for (var x = 0, y = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.substr)(value, post + 1, post = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.abs)(j = points[i])), z = value; x < size; ++x) + if (z = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.trim)(j > 0 ? rule[x] + ' ' + y : (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.replace)(y, /&\f/g, rule[x]))) + props[k++] = z + + return (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.node)(value, root, parent, offset === 0 ? _Enum_js__WEBPACK_IMPORTED_MODULE_2__.RULESET : type, props, children, length) +} + +/** + * @param {number} value + * @param {object} root + * @param {object?} parent + * @return {object} + */ +function comment (value, root, parent) { + return (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.node)(value, root, parent, _Enum_js__WEBPACK_IMPORTED_MODULE_2__.COMMENT, (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.from)((0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.char)()), (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.substr)(value, 2, -2), 0) +} + +/** + * @param {string} value + * @param {object} root + * @param {object?} parent + * @param {number} length + * @return {object} + */ +function declaration (value, root, parent, length) { + return (0,_Tokenizer_js__WEBPACK_IMPORTED_MODULE_0__.node)(value, root, parent, _Enum_js__WEBPACK_IMPORTED_MODULE_2__.DECLARATION, (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.substr)(value, 0, length), (0,_Utility_js__WEBPACK_IMPORTED_MODULE_1__.substr)(value, length + 1, -1), length) +} + + +/***/ }), + +/***/ "./node_modules/stylis/src/Prefixer.js": +/*!*********************************************!*\ + !*** ./node_modules/stylis/src/Prefixer.js ***! + \*********************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_364015__) { + +"use strict"; +__nested_webpack_require_364015__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_364015__.d(__nested_webpack_exports__, { +/* harmony export */ prefix: function() { return /* binding */ prefix; } +/* harmony export */ }); +/* harmony import */ var _Enum_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_364015__(/*! ./Enum.js */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var _Utility_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_364015__(/*! ./Utility.js */ "./node_modules/stylis/src/Utility.js"); + + + +/** + * @param {string} value + * @param {number} length + * @param {object[]} children + * @return {string} + */ +function prefix (value, length, children) { + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.hash)(value, length)) { + // color-adjust + case 5103: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + 'print-' + value + value + // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) + case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: + // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break + case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: + // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, + case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: + // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) + case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + value + // tab-size + case 4789: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MOZ + value + value + // appearance, user-select, transform, hyphens, text-size-adjust + case 5349: case 4246: case 4810: case 6968: case 2756: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MOZ + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + value + value + // writing-mode + case 5936: + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, length + 11)) { + // vertical-l(r) + case 114: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb') + value + // vertical-r(l) + case 108: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value + // horizontal(-)tb + case 45: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /[svh]\w+-[tblr]{2}/, 'lr') + value + // default: fallthrough to below + } + // flex, flex-direction, scroll-snap-type, writing-mode + case 6828: case 4268: case 2903: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + value + value + // order + case 6165: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'flex-' + value + value + // align-items + case 5187: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(\w+).+(:[^]+)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + 'box-$1$2' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'flex-$1$2') + value + // align-self + case 5443: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'flex-item-' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /flex-|-self/g, '') + (!(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(value, /flex-|baseline/) ? _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'grid-row-' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /flex-|-self/g, '') : '') + value + // align-content + case 4675: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'flex-line-pack' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /align-content|flex-|-self/g, '') + value + // flex-shrink + case 5548: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'shrink', 'negative') + value + // flex-basis + case 5292: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'basis', 'preferred-size') + value + // flex-grow + case 6060: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + 'box-' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, '-grow', '') + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'grow', 'positive') + value + // transition + case 4554: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /([^-])(transform)/g, '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$2') + value + // cursor + case 6187: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(zoom-|grab)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$1'), /(image-set)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$1'), value, '') + value + // background, background-image + case 5495: case 3959: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(image-set\([^]*)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$1' + '$`$1') + // justify-content + case 4968: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(.+:)(flex-)?(.*)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + 'box-pack:$3' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + value + value + // justify-self + case 4200: + if (!(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(value, /flex-|baseline/)) return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'grid-column-align' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.substr)(value, length) + value + break + // grid-template-(columns|rows) + case 2592: case 3360: + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'template-', '') + value + // grid-(row|column)-start + case 4384: case 3616: + if (children && children.some(function (element, index) { return length = index, (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(element.props, /grid-\w+-end/) })) { + return ~(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.indexof)(value + (children = children[length].value), 'span') ? value : (_Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, '-start', '') + value + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + 'grid-row-span:' + (~(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.indexof)(children, 'span') ? (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(children, /\d+/) : +(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(children, /\d+/) - +(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(value, /\d+/)) + ';') + } + return _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, '-start', '') + value + // grid-(row|column)-end + case 4896: case 4128: + return (children && children.some(function (element) { return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.match)(element.props, /grid-\w+-start/) })) ? value : _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, '-end', '-span'), 'span ', '') + value + // (margin|padding)-inline-(start|end) + case 4095: case 3583: case 4068: case 2532: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(.+)-inline(.+)/, _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$1$2') + value + // (min|max)?(width|height|inline-size|block-size) + case 8116: case 7059: case 5753: case 5535: + case 5445: case 5701: case 4933: case 4677: + case 5533: case 5789: case 5021: case 4765: + // stretch, max-content, min-content, fill-available + if ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.strlen)(value) - 1 - length > 6) + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, length + 1)) { + // (m)ax-content, (m)in-content + case 109: + // - + if ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, length + 4) !== 45) + break + // (f)ill-available, (f)it-content + case 102: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(.+:)(.+)-([^]+)/, '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$2-$3' + '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MOZ + ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, length + 3) == 108 ? '$3' : '$2-$3')) + value + // (s)tretch + case 115: + return ~(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.indexof)(value, 'stretch') ? prefix((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'stretch', 'fill-available'), length, children) + value : value + } + break + // grid-(column|row) + case 5152: case 5920: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (_Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + a + ':' + b + f) + (c ? (_Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value }) + // position: sticky + case 4949: + // stick(y)? + if ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, length + 6) === 121) + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, ':', ':' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT) + value + break + // display: (flex|inline-flex|grid|inline-grid) + case 6444: + switch ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, 14) === 45 ? 18 : 11)) { + // (inline-)?fle(x) + case 120: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + ((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.WEBKIT + '$2$3' + '$1' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS + '$2box$3') + value + // (inline-)?gri(d) + case 100: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, ':', ':' + _Enum_js__WEBPACK_IMPORTED_MODULE_1__.MS) + value + } + break + // scroll-margin, scroll-margin-(top|right|bottom|left) + case 5719: case 2647: case 2135: case 3927: case 2391: + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.replace)(value, 'scroll-', 'scroll-snap-') + value + } + + return value +} + + +/***/ }), + +/***/ "./node_modules/stylis/src/Serializer.js": +/*!***********************************************!*\ + !*** ./node_modules/stylis/src/Serializer.js ***! + \***********************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_375664__) { + +"use strict"; +__nested_webpack_require_375664__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_375664__.d(__nested_webpack_exports__, { +/* harmony export */ serialize: function() { return /* binding */ serialize; }, +/* harmony export */ stringify: function() { return /* binding */ stringify; } +/* harmony export */ }); +/* harmony import */ var _Enum_js__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_375664__(/*! ./Enum.js */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var _Utility_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_375664__(/*! ./Utility.js */ "./node_modules/stylis/src/Utility.js"); + + + +/** + * @param {object[]} children + * @param {function} callback + * @return {string} + */ +function serialize (children, callback) { + var output = '' + var length = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.sizeof)(children) + + for (var i = 0; i < length; i++) + output += callback(children[i], i, children, callback) || '' + + return output +} + +/** + * @param {object} element + * @param {number} index + * @param {object[]} children + * @param {function} callback + * @return {string} + */ +function stringify (element, index, children, callback) { + switch (element.type) { + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.LAYER: if (element.children.length) break + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.IMPORT: case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.DECLARATION: return element.return = element.return || element.value + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.COMMENT: return '' + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}' + case _Enum_js__WEBPACK_IMPORTED_MODULE_1__.RULESET: element.value = element.props.join(',') + } + + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.strlen)(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' +} + + +/***/ }), + +/***/ "./node_modules/stylis/src/Tokenizer.js": +/*!**********************************************!*\ + !*** ./node_modules/stylis/src/Tokenizer.js ***! + \**********************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_377878__) { + +"use strict"; +__nested_webpack_require_377878__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_377878__.d(__nested_webpack_exports__, { +/* harmony export */ alloc: function() { return /* binding */ alloc; }, +/* harmony export */ caret: function() { return /* binding */ caret; }, +/* harmony export */ char: function() { return /* binding */ char; }, +/* harmony export */ character: function() { return /* binding */ character; }, +/* harmony export */ characters: function() { return /* binding */ characters; }, +/* harmony export */ column: function() { return /* binding */ column; }, +/* harmony export */ commenter: function() { return /* binding */ commenter; }, +/* harmony export */ copy: function() { return /* binding */ copy; }, +/* harmony export */ dealloc: function() { return /* binding */ dealloc; }, +/* harmony export */ delimit: function() { return /* binding */ delimit; }, +/* harmony export */ delimiter: function() { return /* binding */ delimiter; }, +/* harmony export */ escaping: function() { return /* binding */ escaping; }, +/* harmony export */ identifier: function() { return /* binding */ identifier; }, +/* harmony export */ length: function() { return /* binding */ length; }, +/* harmony export */ line: function() { return /* binding */ line; }, +/* harmony export */ next: function() { return /* binding */ next; }, +/* harmony export */ node: function() { return /* binding */ node; }, +/* harmony export */ peek: function() { return /* binding */ peek; }, +/* harmony export */ position: function() { return /* binding */ position; }, +/* harmony export */ prev: function() { return /* binding */ prev; }, +/* harmony export */ slice: function() { return /* binding */ slice; }, +/* harmony export */ token: function() { return /* binding */ token; }, +/* harmony export */ tokenize: function() { return /* binding */ tokenize; }, +/* harmony export */ tokenizer: function() { return /* binding */ tokenizer; }, +/* harmony export */ whitespace: function() { return /* binding */ whitespace; } +/* harmony export */ }); +/* harmony import */ var _Utility_js__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_377878__(/*! ./Utility.js */ "./node_modules/stylis/src/Utility.js"); + + +var line = 1 +var column = 1 +var length = 0 +var position = 0 +var character = 0 +var characters = '' + +/** + * @param {string} value + * @param {object | null} root + * @param {object | null} parent + * @param {string} type + * @param {string[] | string} props + * @param {object[] | string} children + * @param {number} length + */ +function node (value, root, parent, type, props, children, length) { + return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''} +} + +/** + * @param {object} root + * @param {object} props + * @return {object} + */ +function copy (root, props) { + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.assign)(node('', null, null, '', null, null, 0), root, {length: -root.length}, props) +} + +/** + * @return {number} + */ +function char () { + return character +} + +/** + * @return {number} + */ +function prev () { + character = position > 0 ? (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(characters, --position) : 0 + + if (column--, character === 10) + column = 1, line-- + + return character +} + +/** + * @return {number} + */ +function next () { + character = position < length ? (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(characters, position++) : 0 + + if (column++, character === 10) + column = 1, line++ + + return character +} + +/** + * @return {number} + */ +function peek () { + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.charat)(characters, position) +} + +/** + * @return {number} + */ +function caret () { + return position +} + +/** + * @param {number} begin + * @param {number} end + * @return {string} + */ +function slice (begin, end) { + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.substr)(characters, begin, end) +} + +/** + * @param {number} type + * @return {number} + */ +function token (type) { + switch (type) { + // \0 \t \n \r \s whitespace token + case 0: case 9: case 10: case 13: case 32: + return 5 + // ! + , / > @ ~ isolate token + case 33: case 43: case 44: case 47: case 62: case 64: case 126: + // ; { } breakpoint token + case 59: case 123: case 125: + return 4 + // : accompanied token + case 58: + return 3 + // " ' ( [ opening delimit token + case 34: case 39: case 40: case 91: + return 2 + // ) ] closing delimit token + case 41: case 93: + return 1 + } + + return 0 +} + +/** + * @param {string} value + * @return {any[]} + */ +function alloc (value) { + return line = column = 1, length = (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.strlen)(characters = value), position = 0, [] +} + +/** + * @param {any} value + * @return {any} + */ +function dealloc (value) { + return characters = '', value +} + +/** + * @param {number} type + * @return {string} + */ +function delimit (type) { + return (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.trim)(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) +} + +/** + * @param {string} value + * @return {string[]} + */ +function tokenize (value) { + return dealloc(tokenizer(alloc(value))) +} + +/** + * @param {number} type + * @return {string} + */ +function whitespace (type) { + while (character = peek()) + if (character < 33) + next() + else + break + + return token(type) > 2 || token(character) > 3 ? '' : ' ' +} + +/** + * @param {string[]} children + * @return {string[]} + */ +function tokenizer (children) { + while (next()) + switch (token(character)) { + case 0: (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.append)(identifier(position - 1), children) + break + case 2: ;(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.append)(delimit(character), children) + break + default: ;(0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.append)((0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.from)(character), children) + } + + return children +} + +/** + * @param {number} index + * @param {number} count + * @return {string} + */ +function escaping (index, count) { + while (--count && next()) + // not 0-9 A-F a-f + if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97)) + break + + return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) +} + +/** + * @param {number} type + * @return {number} + */ +function delimiter (type) { + while (next()) + switch (character) { + // ] ) " ' + case type: + return position + // " ' + case 34: case 39: + if (type !== 34 && type !== 39) + delimiter(character) + break + // ( + case 40: + if (type === 41) + delimiter(type) + break + // \ + case 92: + next() + break + } + + return position +} + +/** + * @param {number} type + * @param {number} index + * @return {number} + */ +function commenter (type, index) { + while (next()) + // // + if (type + character === 47 + 10) + break + // /* + else if (type + character === 42 + 42 && peek() === 47) + break + + return '/*' + slice(index, position - 1) + '*' + (0,_Utility_js__WEBPACK_IMPORTED_MODULE_0__.from)(type === 47 ? type : next()) +} + +/** + * @param {number} index + * @return {string} + */ +function identifier (index) { + while (!token(peek())) + next() + + return slice(index, position) +} + + +/***/ }), + +/***/ "./node_modules/stylis/src/Utility.js": +/*!********************************************!*\ + !*** ./node_modules/stylis/src/Utility.js ***! + \********************************************/ +/***/ (function(__unused_webpack___webpack_module__, __nested_webpack_exports__, __nested_webpack_require_385420__) { + +"use strict"; +__nested_webpack_require_385420__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_385420__.d(__nested_webpack_exports__, { +/* harmony export */ abs: function() { return /* binding */ abs; }, +/* harmony export */ append: function() { return /* binding */ append; }, +/* harmony export */ assign: function() { return /* binding */ assign; }, +/* harmony export */ charat: function() { return /* binding */ charat; }, +/* harmony export */ combine: function() { return /* binding */ combine; }, +/* harmony export */ from: function() { return /* binding */ from; }, +/* harmony export */ hash: function() { return /* binding */ hash; }, +/* harmony export */ indexof: function() { return /* binding */ indexof; }, +/* harmony export */ match: function() { return /* binding */ match; }, +/* harmony export */ replace: function() { return /* binding */ replace; }, +/* harmony export */ sizeof: function() { return /* binding */ sizeof; }, +/* harmony export */ strlen: function() { return /* binding */ strlen; }, +/* harmony export */ substr: function() { return /* binding */ substr; }, +/* harmony export */ trim: function() { return /* binding */ trim; } +/* harmony export */ }); +/** + * @param {number} + * @return {number} + */ +var abs = Math.abs + +/** + * @param {number} + * @return {string} + */ +var from = String.fromCharCode + +/** + * @param {object} + * @return {object} + */ +var assign = Object.assign + +/** + * @param {string} value + * @param {number} length + * @return {number} + */ +function hash (value, length) { + return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0 +} + +/** + * @param {string} value + * @return {string} + */ +function trim (value) { + return value.trim() +} + +/** + * @param {string} value + * @param {RegExp} pattern + * @return {string?} + */ +function match (value, pattern) { + return (value = pattern.exec(value)) ? value[0] : value +} + +/** + * @param {string} value + * @param {(string|RegExp)} pattern + * @param {string} replacement + * @return {string} + */ +function replace (value, pattern, replacement) { + return value.replace(pattern, replacement) +} + +/** + * @param {string} value + * @param {string} search + * @return {number} + */ +function indexof (value, search) { + return value.indexOf(search) +} + +/** + * @param {string} value + * @param {number} index + * @return {number} + */ +function charat (value, index) { + return value.charCodeAt(index) | 0 +} + +/** + * @param {string} value + * @param {number} begin + * @param {number} end + * @return {string} + */ +function substr (value, begin, end) { + return value.slice(begin, end) +} + +/** + * @param {string} value + * @return {number} + */ +function strlen (value) { + return value.length +} + +/** + * @param {any[]} value + * @return {number} + */ +function sizeof (value) { + return value.length +} + +/** + * @param {any} value + * @param {any[]} array + * @return {any} + */ +function append (value, array) { + return array.push(value), value +} + +/** + * @param {string[]} array + * @param {function} callback + * @return {string} + */ +function combine (array, callback) { + return array.map(callback).join('') +} + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_388830__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_388830__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_388830__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __nested_webpack_require_388830__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __nested_webpack_require_388830__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__nested_webpack_require_388830__.o(definition, key) && !__nested_webpack_require_388830__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __nested_webpack_require_388830__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __nested_webpack_require_388830__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __nested_webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +!function() { +"use strict"; +/*!******************!*\ + !*** ./index.ts ***! + \******************/ +__nested_webpack_require_388830__.r(__nested_webpack_exports__); +/* harmony export */ __nested_webpack_require_388830__.d(__nested_webpack_exports__, { +/* harmony export */ AbstractRepeater: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.AbstractRepeater; }, +/* harmony export */ CircularProgressBar: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.CircularProgressBar; }, +/* harmony export */ ClipboardButton: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.ClipboardButton; }, +/* harmony export */ ColorSetting: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.ColorSetting; }, +/* harmony export */ ContentPicker: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.ContentPicker; }, +/* harmony export */ ContentSearch: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.ContentSearch; }, +/* harmony export */ Counter: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Counter; }, +/* harmony export */ CustomBlockAppender: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.CustomBlockAppender; }, +/* harmony export */ DragHandle: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.DragHandle; }, +/* harmony export */ Icon: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Icon; }, +/* harmony export */ IconPicker: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.IconPicker; }, +/* harmony export */ IconPickerToolbarButton: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.IconPickerToolbarButton; }, +/* harmony export */ Image: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Image; }, +/* harmony export */ InlineIconPicker: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.InlineIconPicker; }, +/* harmony export */ InnerBlockSlider: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.InnerBlockSlider; }, +/* harmony export */ IsAdmin: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.IsAdmin; }, +/* harmony export */ Link: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Link; }, +/* harmony export */ MediaToolbar: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.MediaToolbar; }, +/* harmony export */ Optional: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Optional; }, +/* harmony export */ PostAuthor: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostAuthor; }, +/* harmony export */ PostCategoryList: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostCategoryList; }, +/* harmony export */ PostContext: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostContext; }, +/* harmony export */ PostDate: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostDate; }, +/* harmony export */ PostDatePicker: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostDatePicker; }, +/* harmony export */ PostExcerpt: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostExcerpt; }, +/* harmony export */ PostFeaturedImage: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostFeaturedImage; }, +/* harmony export */ PostMeta: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostMeta; }, +/* harmony export */ PostPrimaryCategory: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostPrimaryCategory; }, +/* harmony export */ PostPrimaryTerm: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostPrimaryTerm; }, +/* harmony export */ PostTermList: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostTermList; }, +/* harmony export */ PostTitle: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.PostTitle; }, +/* harmony export */ Repeater: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.Repeater; }, +/* harmony export */ RichTextCharacterLimit: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.RichTextCharacterLimit; }, +/* harmony export */ getCharacterCount: function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_3__.getCharacterCount; }, +/* harmony export */ iconStore: function() { return /* reexport safe */ _stores__WEBPACK_IMPORTED_MODULE_1__.iconStore; }, +/* harmony export */ registerBlockExtension: function() { return /* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.registerBlockExtension; }, +/* harmony export */ registerBlockExtention: function() { return /* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.registerBlockExtention; }, +/* harmony export */ registerIcons: function() { return /* reexport safe */ _api__WEBPACK_IMPORTED_MODULE_0__.registerIcons; }, +/* harmony export */ useAllTerms: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useAllTerms; }, +/* harmony export */ useBlockParentAttributes: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useBlockParentAttributes; }, +/* harmony export */ useFilteredList: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useFilteredList; }, +/* harmony export */ useFlatInnerBlocks: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useFlatInnerBlocks; }, +/* harmony export */ useHasSelectedInnerBlock: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useHasSelectedInnerBlock; }, +/* harmony export */ useIcon: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useIcon; }, +/* harmony export */ useIcons: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useIcons; }, +/* harmony export */ useIsPluginActive: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useIsPluginActive; }, +/* harmony export */ useIsSupportedMetaField: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useIsSupportedMetaField; }, +/* harmony export */ useIsSupportedTaxonomy: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useIsSupportedTaxonomy; }, +/* harmony export */ useMedia: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useMedia; }, +/* harmony export */ usePopover: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.usePopover; }, +/* harmony export */ usePost: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.usePost; }, +/* harmony export */ usePostMetaValue: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.usePostMetaValue; }, +/* harmony export */ usePrimaryTerm: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.usePrimaryTerm; }, +/* harmony export */ useRequestData: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useRequestData; }, +/* harmony export */ useScript: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useScript; }, +/* harmony export */ useSelectedTermIds: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useSelectedTermIds; }, +/* harmony export */ useSelectedTerms: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useSelectedTerms; }, +/* harmony export */ useSelectedTermsOfSavedPost: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useSelectedTermsOfSavedPost; }, +/* harmony export */ useTaxonomy: function() { return /* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_2__.useTaxonomy; } +/* harmony export */ }); +/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_388830__(/*! ./api */ "./api/index.ts"); +/* harmony import */ var _stores__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_388830__(/*! ./stores */ "./stores/index.ts"); +/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_388830__(/*! ./hooks */ "./hooks/index.ts"); +/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_388830__(/*! ./components */ "./components/index.ts"); + + + + +}(); +module.exports = __nested_webpack_exports__; +/******/ })() +; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/index.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/index.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "NIL", ({ + enumerable: true, + get: function get() { + return _nil.default; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function get() { + return _parse.default; + } +})); +Object.defineProperty(exports, "stringify", ({ + enumerable: true, + get: function get() { + return _stringify.default; + } +})); +Object.defineProperty(exports, "v1", ({ + enumerable: true, + get: function get() { + return _v.default; + } +})); +Object.defineProperty(exports, "v3", ({ + enumerable: true, + get: function get() { + return _v2.default; + } +})); +Object.defineProperty(exports, "v4", ({ + enumerable: true, + get: function get() { + return _v3.default; + } +})); +Object.defineProperty(exports, "v5", ({ + enumerable: true, + get: function get() { + return _v4.default; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function get() { + return _validate.default; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function get() { + return _version.default; + } +})); + +var _v = _interopRequireDefault(__webpack_require__(/*! ./v1.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v1.js")); + +var _v2 = _interopRequireDefault(__webpack_require__(/*! ./v3.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v3.js")); + +var _v3 = _interopRequireDefault(__webpack_require__(/*! ./v4.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v4.js")); + +var _v4 = _interopRequireDefault(__webpack_require__(/*! ./v5.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v5.js")); + +var _nil = _interopRequireDefault(__webpack_require__(/*! ./nil.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/nil.js")); + +var _version = _interopRequireDefault(__webpack_require__(/*! ./version.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/version.js")); + +var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js")); + +var _stringify = _interopRequireDefault(__webpack_require__(/*! ./stringify.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js")); + +var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/md5.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/md5.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (let i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + const output = []; + const length32 = input.length * 32; + const hexTab = '0123456789abcdef'; + + for (let i = 0; i < length32; i += 8) { + const x = input[i >> 5] >>> i % 32 & 0xff; + const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + const length8 = input.length * 8; + const output = new Uint32Array(getOutputLength(length8)); + + for (let i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/native.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/native.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +var _default = { + randomUUID +}; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/nil.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/nil.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/parse.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/parse.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/regex.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/regex.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/rng.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/rng.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +let getRandomValues; +const rnds8 = new Uint8Array(16); + +function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/sha1.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/sha1.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (let i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + + for (let j = 0; j < 16; ++j) { + arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; + } + + M[i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +var _default = sha1; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +exports.unsafeStringify = unsafeStringify; + +var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} + +function unsafeStringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; +} + +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v1.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v1.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/rng.js")); + +var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.unsafeStringify)(b); +} + +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v3.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v3.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v35.js")); + +var _md = _interopRequireDefault(__webpack_require__(/*! ./md5.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/md5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v35.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v35.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.URL = exports.DNS = void 0; +exports["default"] = v35; + +var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js"); + +var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function v35(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + var _namespace; + + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.unsafeStringify)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v4.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v4.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _native = _interopRequireDefault(__webpack_require__(/*! ./native.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/native.js")); + +var _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/rng.js")); + +var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/stringify.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + if (_native.default.randomUUID && !buf && !options) { + return _native.default.randomUUID(); + } + + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.unsafeStringify)(rnds); +} + +var _default = v4; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v5.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v5.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/v35.js")); + +var _sha = _interopRequireDefault(__webpack_require__(/*! ./sha1.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/sha1.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js ***! + \*************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _regex = _interopRequireDefault(__webpack_require__(/*! ./regex.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/regex.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/version.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/version.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/@10up/block-components/node_modules/uuid/dist/commonjs-browser/validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.slice(14, 15), 16); +} + +var _default = version; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _assertThisInitialized) +/* harmony export */ }); +function _assertThisInitialized(e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e; +} + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": +/*!************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! + \************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _extends) +/* harmony export */ }); +function _extends() { + return _extends = Object.assign ? Object.assign.bind() : function (n) { + for (var e = 1; e < arguments.length; e++) { + var t = arguments[e]; + for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); + } + return n; + }, _extends.apply(null, arguments); +} + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _inheritsLoose) +/* harmony export */ }); +/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); + +function _inheritsLoose(t, o) { + t.prototype = Object.create(o.prototype), t.prototype.constructor = t, (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t, o); +} + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _objectWithoutPropertiesLoose) +/* harmony export */ }); +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (e.includes(n)) continue; + t[n] = r[n]; + } + return t; +} + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _setPrototypeOf) +/* harmony export */ }); +function _setPrototypeOf(t, e) { + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { + return t.__proto__ = e, t; + }, _setPrototypeOf(t, e); +} + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ HiddenText: () => (/* binding */ HiddenText), +/* harmony export */ LiveRegion: () => (/* binding */ LiveRegion), +/* harmony export */ useAnnouncement: () => (/* binding */ useAnnouncement) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +const hiddenStyles = { + display: 'none' +}; +function HiddenText(_ref) { + let { + id, + value + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: hiddenStyles + }, value); +} + +function LiveRegion(_ref) { + let { + id, + announcement, + ariaLiveType = "assertive" + } = _ref; + // Hide element visually but keep it readable by screen readers + const visuallyHidden = { + position: 'fixed', + top: 0, + left: 0, + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + clipPath: 'inset(100%)', + whiteSpace: 'nowrap' + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { + id: id, + style: visuallyHidden, + role: "status", + "aria-live": ariaLiveType, + "aria-atomic": true + }, announcement); +} + +function useAnnouncement() { + const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''); + const announce = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => { + if (value != null) { + setAnnouncement(value); + } + }, []); + return { + announce, + announcement + }; +} + + +//# sourceMappingURL=accessibility.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/core/dist/core.esm.js": +/*!*****************************************************!*\ + !*** ./node_modules/@dnd-kit/core/dist/core.esm.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AutoScrollActivator: () => (/* binding */ AutoScrollActivator), +/* harmony export */ DndContext: () => (/* binding */ DndContext), +/* harmony export */ DragOverlay: () => (/* binding */ DragOverlay), +/* harmony export */ KeyboardCode: () => (/* binding */ KeyboardCode), +/* harmony export */ KeyboardSensor: () => (/* binding */ KeyboardSensor), +/* harmony export */ MeasuringFrequency: () => (/* binding */ MeasuringFrequency), +/* harmony export */ MeasuringStrategy: () => (/* binding */ MeasuringStrategy), +/* harmony export */ MouseSensor: () => (/* binding */ MouseSensor), +/* harmony export */ PointerSensor: () => (/* binding */ PointerSensor), +/* harmony export */ TouchSensor: () => (/* binding */ TouchSensor), +/* harmony export */ TraversalOrder: () => (/* binding */ TraversalOrder), +/* harmony export */ applyModifiers: () => (/* binding */ applyModifiers), +/* harmony export */ closestCenter: () => (/* binding */ closestCenter), +/* harmony export */ closestCorners: () => (/* binding */ closestCorners), +/* harmony export */ defaultAnnouncements: () => (/* binding */ defaultAnnouncements), +/* harmony export */ defaultCoordinates: () => (/* binding */ defaultCoordinates), +/* harmony export */ defaultDropAnimation: () => (/* binding */ defaultDropAnimationConfiguration), +/* harmony export */ defaultDropAnimationSideEffects: () => (/* binding */ defaultDropAnimationSideEffects), +/* harmony export */ defaultKeyboardCoordinateGetter: () => (/* binding */ defaultKeyboardCoordinateGetter), +/* harmony export */ defaultScreenReaderInstructions: () => (/* binding */ defaultScreenReaderInstructions), +/* harmony export */ getClientRect: () => (/* binding */ getClientRect), +/* harmony export */ getFirstCollision: () => (/* binding */ getFirstCollision), +/* harmony export */ getScrollableAncestors: () => (/* binding */ getScrollableAncestors), +/* harmony export */ pointerWithin: () => (/* binding */ pointerWithin), +/* harmony export */ rectIntersection: () => (/* binding */ rectIntersection), +/* harmony export */ useDndContext: () => (/* binding */ useDndContext), +/* harmony export */ useDndMonitor: () => (/* binding */ useDndMonitor), +/* harmony export */ useDraggable: () => (/* binding */ useDraggable), +/* harmony export */ useDroppable: () => (/* binding */ useDroppable), +/* harmony export */ useSensor: () => (/* binding */ useSensor), +/* harmony export */ useSensors: () => (/* binding */ useSensors) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom"); +/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); +/* harmony import */ var _dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dnd-kit/accessibility */ "./node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js"); + + + + + +const DndMonitorContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); + +function useDndMonitor(listener) { + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(DndMonitorContext); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!registerListener) { + throw new Error('useDndMonitor must be used within a children of '); + } + + const unsubscribe = registerListener(listener); + return unsubscribe; + }, [listener, registerListener]); +} + +function useDndMonitorProvider() { + const [listeners] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => new Set()); + const registerListener = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(listener => { + listeners.add(listener); + return () => listeners.delete(listener); + }, [listeners]); + const dispatch = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(_ref => { + let { + type, + event + } = _ref; + listeners.forEach(listener => { + var _listener$type; + + return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); + }); + }, [listeners]); + return [dispatch, registerListener]; +} + +const defaultScreenReaderInstructions = { + draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " +}; +const defaultAnnouncements = { + onDragStart(_ref) { + let { + active + } = _ref; + return "Picked up draggable item " + active.id + "."; + }, + + onDragOver(_ref2) { + let { + active, + over + } = _ref2; + + if (over) { + return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; + } + + return "Draggable item " + active.id + " is no longer over a droppable area."; + }, + + onDragEnd(_ref3) { + let { + active, + over + } = _ref3; + + if (over) { + return "Draggable item " + active.id + " was dropped over droppable area " + over.id; + } + + return "Draggable item " + active.id + " was dropped."; + }, + + onDragCancel(_ref4) { + let { + active + } = _ref4; + return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; + } + +}; + +function Accessibility(_ref) { + let { + announcements = defaultAnnouncements, + container, + hiddenTextDescribedById, + screenReaderInstructions = defaultScreenReaderInstructions + } = _ref; + const { + announce, + announcement + } = (0,_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.useAnnouncement)(); + const liveRegionId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndLiveRegion"); + const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + setMounted(true); + }, []); + useDndMonitor((0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + onDragStart(_ref2) { + let { + active + } = _ref2; + announce(announcements.onDragStart({ + active + })); + }, + + onDragMove(_ref3) { + let { + active, + over + } = _ref3; + + if (announcements.onDragMove) { + announce(announcements.onDragMove({ + active, + over + })); + } + }, + + onDragOver(_ref4) { + let { + active, + over + } = _ref4; + announce(announcements.onDragOver({ + active, + over + })); + }, + + onDragEnd(_ref5) { + let { + active, + over + } = _ref5; + announce(announcements.onDragEnd({ + active, + over + })); + }, + + onDragCancel(_ref6) { + let { + active, + over + } = _ref6; + announce(announcements.onDragCancel({ + active, + over + })); + } + + }), [announce, announcements])); + + if (!mounted) { + return null; + } + + const markup = react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.HiddenText, { + id: hiddenTextDescribedById, + value: screenReaderInstructions.draggable + }), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd_kit_accessibility__WEBPACK_IMPORTED_MODULE_3__.LiveRegion, { + id: liveRegionId, + announcement: announcement + })); + return container ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(markup, container) : markup; +} + +var Action; + +(function (Action) { + Action["DragStart"] = "dragStart"; + Action["DragMove"] = "dragMove"; + Action["DragEnd"] = "dragEnd"; + Action["DragCancel"] = "dragCancel"; + Action["DragOver"] = "dragOver"; + Action["RegisterDroppable"] = "registerDroppable"; + Action["SetDroppableDisabled"] = "setDroppableDisabled"; + Action["UnregisterDroppable"] = "unregisterDroppable"; +})(Action || (Action = {})); + +function noop() {} + +function useSensor(sensor, options) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + sensor, + options: options != null ? options : {} + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [sensor, options]); +} + +function useSensors() { + for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { + sensors[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps + [...sensors]); +} + +const defaultCoordinates = /*#__PURE__*/Object.freeze({ + x: 0, + y: 0 +}); + +/** + * Returns the distance between two points + */ +function distanceBetween(p1, p2) { + return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); +} + +function getRelativeTransformOrigin(event, rect) { + const eventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event); + + if (!eventCoordinates) { + return '0 0'; + } + + const transformOrigin = { + x: (eventCoordinates.x - rect.left) / rect.width * 100, + y: (eventCoordinates.y - rect.top) / rect.height * 100 + }; + return transformOrigin.x + "% " + transformOrigin.y + "%"; +} + +/** + * Sort collisions from smallest to greatest value + */ +function sortCollisionsAsc(_ref, _ref2) { + let { + data: { + value: a + } + } = _ref; + let { + data: { + value: b + } + } = _ref2; + return a - b; +} +/** + * Sort collisions from greatest to smallest value + */ + +function sortCollisionsDesc(_ref3, _ref4) { + let { + data: { + value: a + } + } = _ref3; + let { + data: { + value: b + } + } = _ref4; + return b - a; +} +/** + * Returns the coordinates of the corners of a given rectangle: + * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] + */ + +function cornersOfRectangle(_ref5) { + let { + left, + top, + height, + width + } = _ref5; + return [{ + x: left, + y: top + }, { + x: left + width, + y: top + }, { + x: left, + y: top + height + }, { + x: left + width, + y: top + height + }]; +} +function getFirstCollision(collisions, property) { + if (!collisions || collisions.length === 0) { + return null; + } + + const [firstCollision] = collisions; + return property ? firstCollision[property] : firstCollision; +} + +/** + * Returns the coordinates of the center of a given ClientRect + */ + +function centerOfRectangle(rect, left, top) { + if (left === void 0) { + left = rect.left; + } + + if (top === void 0) { + top = rect.top; + } + + return { + x: left + rect.width * 0.5, + y: top + rect.height * 0.5 + }; +} +/** + * Returns the closest rectangles from an array of rectangles to the center of a given + * rectangle. + */ + + +const closestCenter = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); + collisions.push({ + id, + data: { + droppableContainer, + value: distBetween + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the closest rectangles from an array of rectangles to the corners of + * another rectangle. + */ + +const closestCorners = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const corners = cornersOfRectangle(collisionRect); + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const rectCorners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner, index) => { + return accumulator + distanceBetween(rectCorners[index], corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +/** + * Returns the intersecting rectangle area between two rectangles + */ + +function getIntersectionRatio(entry, target) { + const top = Math.max(target.top, entry.top); + const left = Math.max(target.left, entry.left); + const right = Math.min(target.left + target.width, entry.left + entry.width); + const bottom = Math.min(target.top + target.height, entry.top + entry.height); + const width = right - left; + const height = bottom - top; + + if (left < right && top < bottom) { + const targetArea = target.width * target.height; + const entryArea = entry.width * entry.height; + const intersectionArea = width * height; + const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); + return Number(intersectionRatio.toFixed(4)); + } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) + + + return 0; +} +/** + * Returns the rectangles that has the greatest intersection area with a given + * rectangle in an array of rectangles. + */ + +const rectIntersection = _ref => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect) { + const intersectionRatio = getIntersectionRatio(rect, collisionRect); + + if (intersectionRatio > 0) { + collisions.push({ + id, + data: { + droppableContainer, + value: intersectionRatio + } + }); + } + } + } + + return collisions.sort(sortCollisionsDesc); +}; + +/** + * Check if a given point is contained within a bounding rectangle + */ + +function isPointWithinRect(point, rect) { + const { + top, + left, + bottom, + right + } = rect; + return top <= point.y && point.y <= bottom && left <= point.x && point.x <= right; +} +/** + * Returns the rectangles that the pointer is hovering over + */ + + +const pointerWithin = _ref => { + let { + droppableContainers, + droppableRects, + pointerCoordinates + } = _ref; + + if (!pointerCoordinates) { + return []; + } + + const collisions = []; + + for (const droppableContainer of droppableContainers) { + const { + id + } = droppableContainer; + const rect = droppableRects.get(id); + + if (rect && isPointWithinRect(pointerCoordinates, rect)) { + /* There may be more than a single rectangle intersecting + * with the pointer coordinates. In order to sort the + * colliding rectangles, we measure the distance between + * the pointer and the corners of the intersecting rectangle + */ + const corners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner) => { + return accumulator + distanceBetween(pointerCoordinates, corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + + return collisions.sort(sortCollisionsAsc); +}; + +function adjustScale(transform, rect1, rect2) { + return { ...transform, + scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, + scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 + }; +} + +function getRectDelta(rect1, rect2) { + return rect1 && rect2 ? { + x: rect1.left - rect2.left, + y: rect1.top - rect2.top + } : defaultCoordinates; +} + +function createRectAdjustmentFn(modifier) { + return function adjustClientRect(rect) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((acc, adjustment) => ({ ...acc, + top: acc.top + modifier * adjustment.y, + bottom: acc.bottom + modifier * adjustment.y, + left: acc.left + modifier * adjustment.x, + right: acc.right + modifier * adjustment.x + }), { ...rect + }); + }; +} +const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1); + +function parseTransform(transform) { + if (transform.startsWith('matrix3d(')) { + const transformArray = transform.slice(9, -1).split(/, /); + return { + x: +transformArray[12], + y: +transformArray[13], + scaleX: +transformArray[0], + scaleY: +transformArray[5] + }; + } else if (transform.startsWith('matrix(')) { + const transformArray = transform.slice(7, -1).split(/, /); + return { + x: +transformArray[4], + y: +transformArray[5], + scaleX: +transformArray[0], + scaleY: +transformArray[3] + }; + } + + return null; +} + +function inverseTransform(rect, transform, transformOrigin) { + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return rect; + } + + const { + scaleX, + scaleY, + x: translateX, + y: translateY + } = parsedTransform; + const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); + const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); + const w = scaleX ? rect.width / scaleX : rect.width; + const h = scaleY ? rect.height / scaleY : rect.height; + return { + width: w, + height: h, + top: y, + right: x + w, + bottom: y + h, + left: x + }; +} + +const defaultOptions = { + ignoreTransform: false +}; +/** + * Returns the bounding client rect of an element relative to the viewport. + */ + +function getClientRect(element, options) { + if (options === void 0) { + options = defaultOptions; + } + + let rect = element.getBoundingClientRect(); + + if (options.ignoreTransform) { + const { + transform, + transformOrigin + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + + if (transform) { + rect = inverseTransform(rect, transform, transformOrigin); + } + } + + const { + top, + left, + width, + height, + bottom, + right + } = rect; + return { + top, + left, + width, + height, + bottom, + right + }; +} +/** + * Returns the bounding client rect of an element relative to the viewport. + * + * @remarks + * The ClientRect returned by this method does not take into account transforms + * applied to the element it measures. + * + */ + +function getTransformAgnosticClientRect(element) { + return getClientRect(element, { + ignoreTransform: true + }); +} + +function getWindowClientRect(element) { + const width = element.innerWidth; + const height = element.innerHeight; + return { + top: 0, + left: 0, + right: width, + bottom: height, + width, + height + }; +} + +function isFixed(node, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + } + + return computedStyle.position === 'fixed'; +} + +function isScrollable(element, computedStyle) { + if (computedStyle === void 0) { + computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(element); + } + + const overflowRegex = /(auto|scroll|overlay)/; + const properties = ['overflow', 'overflowX', 'overflowY']; + return properties.some(property => { + const value = computedStyle[property]; + return typeof value === 'string' ? overflowRegex.test(value) : false; + }); +} + +function getScrollableAncestors(element, limit) { + const scrollParents = []; + + function findScrollableAncestors(node) { + if (limit != null && scrollParents.length >= limit) { + return scrollParents; + } + + if (!node) { + return scrollParents; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { + scrollParents.push(node.scrollingElement); + return scrollParents; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(node) || (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isSVGElement)(node)) { + return scrollParents; + } + + if (scrollParents.includes(node)) { + return scrollParents; + } + + const computedStyle = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(element).getComputedStyle(node); + + if (node !== element) { + if (isScrollable(node, computedStyle)) { + scrollParents.push(node); + } + } + + if (isFixed(node, computedStyle)) { + return scrollParents; + } + + return findScrollableAncestors(node.parentNode); + } + + if (!element) { + return scrollParents; + } + + return findScrollableAncestors(element); +} +function getFirstScrollableAncestor(node) { + const [firstScrollableAncestor] = getScrollableAncestors(node, 1); + return firstScrollableAncestor != null ? firstScrollableAncestor : null; +} + +function getScrollableElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element; + } + + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isNode)(element)) { + return null; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isDocument)(element) || element === (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(element).scrollingElement) { + return window; + } + + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(element)) { + return element; + } + + return null; +} + +function getScrollXCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollX; + } + + return element.scrollLeft; +} +function getScrollYCoordinate(element) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isWindow)(element)) { + return element.scrollY; + } + + return element.scrollTop; +} +function getScrollCoordinates(element) { + return { + x: getScrollXCoordinate(element), + y: getScrollYCoordinate(element) + }; +} + +var Direction; + +(function (Direction) { + Direction[Direction["Forward"] = 1] = "Forward"; + Direction[Direction["Backward"] = -1] = "Backward"; +})(Direction || (Direction = {})); + +function isDocumentScrollingElement(element) { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM || !element) { + return false; + } + + return element === document.scrollingElement; +} + +function getScrollPosition(scrollingContainer) { + const minScroll = { + x: 0, + y: 0 + }; + const dimensions = isDocumentScrollingElement(scrollingContainer) ? { + height: window.innerHeight, + width: window.innerWidth + } : { + height: scrollingContainer.clientHeight, + width: scrollingContainer.clientWidth + }; + const maxScroll = { + x: scrollingContainer.scrollWidth - dimensions.width, + y: scrollingContainer.scrollHeight - dimensions.height + }; + const isTop = scrollingContainer.scrollTop <= minScroll.y; + const isLeft = scrollingContainer.scrollLeft <= minScroll.x; + const isBottom = scrollingContainer.scrollTop >= maxScroll.y; + const isRight = scrollingContainer.scrollLeft >= maxScroll.x; + return { + isTop, + isLeft, + isBottom, + isRight, + maxScroll, + minScroll + }; +} + +const defaultThreshold = { + x: 0.2, + y: 0.2 +}; +function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { + let { + top, + left, + right, + bottom + } = _ref; + + if (acceleration === void 0) { + acceleration = 10; + } + + if (thresholdPercentage === void 0) { + thresholdPercentage = defaultThreshold; + } + + const { + isTop, + isBottom, + isLeft, + isRight + } = getScrollPosition(scrollContainer); + const direction = { + x: 0, + y: 0 + }; + const speed = { + x: 0, + y: 0 + }; + const threshold = { + height: scrollContainerRect.height * thresholdPercentage.y, + width: scrollContainerRect.width * thresholdPercentage.x + }; + + if (!isTop && top <= scrollContainerRect.top + threshold.height) { + // Scroll Up + direction.y = Direction.Backward; + speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); + } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { + // Scroll Down + direction.y = Direction.Forward; + speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); + } + + if (!isRight && right >= scrollContainerRect.right - threshold.width) { + // Scroll Right + direction.x = Direction.Forward; + speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); + } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { + // Scroll Left + direction.x = Direction.Backward; + speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); + } + + return { + direction, + speed + }; +} + +function getScrollElementRect(element) { + if (element === document.scrollingElement) { + const { + innerWidth, + innerHeight + } = window; + return { + top: 0, + left: 0, + right: innerWidth, + bottom: innerHeight, + width: innerWidth, + height: innerHeight + }; + } + + const { + top, + left, + right, + bottom + } = element.getBoundingClientRect(); + return { + top, + left, + right, + bottom, + width: element.clientWidth, + height: element.clientHeight + }; +} + +function getScrollOffsets(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, getScrollCoordinates(node)); + }, defaultCoordinates); +} +function getScrollXOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollXCoordinate(node); + }, 0); +} +function getScrollYOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollYCoordinate(node); + }, 0); +} + +function scrollIntoViewIfNeeded(element, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + if (!element) { + return; + } + + const { + top, + left, + bottom, + right + } = measure(element); + const firstScrollableAncestor = getFirstScrollableAncestor(element); + + if (!firstScrollableAncestor) { + return; + } + + if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { + element.scrollIntoView({ + block: 'center', + inline: 'center' + }); + } +} + +const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]]; +class Rect { + constructor(rect, element) { + this.rect = void 0; + this.width = void 0; + this.height = void 0; + this.top = void 0; + this.bottom = void 0; + this.right = void 0; + this.left = void 0; + const scrollableAncestors = getScrollableAncestors(element); + const scrollOffsets = getScrollOffsets(scrollableAncestors); + this.rect = { ...rect + }; + this.width = rect.width; + this.height = rect.height; + + for (const [axis, keys, getScrollOffset] of properties) { + for (const key of keys) { + Object.defineProperty(this, key, { + get: () => { + const currentOffsets = getScrollOffset(scrollableAncestors); + const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; + return this.rect[key] + scrollOffsetsDeltla; + }, + enumerable: true + }); + } + } + + Object.defineProperty(this, 'rect', { + enumerable: false + }); + } + +} + +class Listeners { + constructor(target) { + this.target = void 0; + this.listeners = []; + + this.removeAll = () => { + this.listeners.forEach(listener => { + var _this$target; + + return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); + }); + }; + + this.target = target; + } + + add(eventName, handler, options) { + var _this$target2; + + (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); + this.listeners.push([eventName, handler, options]); + } + +} + +function getEventListenerTarget(target) { + // If the `event.target` element is removed from the document events will still be targeted + // at it, and hence won't always bubble up to the window or document anymore. + // If there is any risk of an element being removed while it is being dragged, + // the best practice is to attach the event listeners directly to the target. + // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget + const { + EventTarget + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target); + return target instanceof EventTarget ? target : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); +} + +function hasExceededDistance(delta, measurement) { + const dx = Math.abs(delta.x); + const dy = Math.abs(delta.y); + + if (typeof measurement === 'number') { + return Math.sqrt(dx ** 2 + dy ** 2) > measurement; + } + + if ('x' in measurement && 'y' in measurement) { + return dx > measurement.x && dy > measurement.y; + } + + if ('x' in measurement) { + return dx > measurement.x; + } + + if ('y' in measurement) { + return dy > measurement.y; + } + + return false; +} + +var EventName; + +(function (EventName) { + EventName["Click"] = "click"; + EventName["DragStart"] = "dragstart"; + EventName["Keydown"] = "keydown"; + EventName["ContextMenu"] = "contextmenu"; + EventName["Resize"] = "resize"; + EventName["SelectionChange"] = "selectionchange"; + EventName["VisibilityChange"] = "visibilitychange"; +})(EventName || (EventName = {})); + +function preventDefault(event) { + event.preventDefault(); +} +function stopPropagation(event) { + event.stopPropagation(); +} + +var KeyboardCode; + +(function (KeyboardCode) { + KeyboardCode["Space"] = "Space"; + KeyboardCode["Down"] = "ArrowDown"; + KeyboardCode["Right"] = "ArrowRight"; + KeyboardCode["Left"] = "ArrowLeft"; + KeyboardCode["Up"] = "ArrowUp"; + KeyboardCode["Esc"] = "Escape"; + KeyboardCode["Enter"] = "Enter"; + KeyboardCode["Tab"] = "Tab"; +})(KeyboardCode || (KeyboardCode = {})); + +const defaultKeyboardCodes = { + start: [KeyboardCode.Space, KeyboardCode.Enter], + cancel: [KeyboardCode.Esc], + end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab] +}; +const defaultKeyboardCoordinateGetter = (event, _ref) => { + let { + currentCoordinates + } = _ref; + + switch (event.code) { + case KeyboardCode.Right: + return { ...currentCoordinates, + x: currentCoordinates.x + 25 + }; + + case KeyboardCode.Left: + return { ...currentCoordinates, + x: currentCoordinates.x - 25 + }; + + case KeyboardCode.Down: + return { ...currentCoordinates, + y: currentCoordinates.y + 25 + }; + + case KeyboardCode.Up: + return { ...currentCoordinates, + y: currentCoordinates.y - 25 + }; + } + + return undefined; +}; + +class KeyboardSensor { + constructor(props) { + this.props = void 0; + this.autoScrollEnabled = false; + this.referenceCoordinates = void 0; + this.listeners = void 0; + this.windowListeners = void 0; + this.props = props; + const { + event: { + target + } + } = props; + this.props = props; + this.listeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target)); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.attach(); + } + + attach() { + this.handleStart(); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); + } + + handleStart() { + const { + activeNode, + onStart + } = this.props; + const node = activeNode.node.current; + + if (node) { + scrollIntoViewIfNeeded(node); + } + + onStart(defaultCoordinates); + } + + handleKeyDown(event) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(event)) { + const { + active, + context, + options + } = this.props; + const { + keyboardCodes = defaultKeyboardCodes, + coordinateGetter = defaultKeyboardCoordinateGetter, + scrollBehavior = 'smooth' + } = options; + const { + code + } = event; + + if (keyboardCodes.end.includes(code)) { + this.handleEnd(event); + return; + } + + if (keyboardCodes.cancel.includes(code)) { + this.handleCancel(event); + return; + } + + const { + collisionRect + } = context.current; + const currentCoordinates = collisionRect ? { + x: collisionRect.left, + y: collisionRect.top + } : defaultCoordinates; + + if (!this.referenceCoordinates) { + this.referenceCoordinates = currentCoordinates; + } + + const newCoordinates = coordinateGetter(event, { + active, + context: context.current, + currentCoordinates + }); + + if (newCoordinates) { + const coordinatesDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, currentCoordinates); + const scrollDelta = { + x: 0, + y: 0 + }; + const { + scrollableAncestors + } = context.current; + + for (const scrollContainer of scrollableAncestors) { + const direction = event.code; + const { + isTop, + isRight, + isLeft, + isBottom, + maxScroll, + minScroll + } = getScrollPosition(scrollContainer); + const scrollElementRect = getScrollElementRect(scrollContainer); + const clampedCoordinates = { + x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), + y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) + }; + const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; + const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; + + if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { + const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; + const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; + + if (canScrollToNewCoordinates && !coordinatesDelta.y) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + left: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; + } else { + scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; + } + + if (scrollDelta.x) { + scrollContainer.scrollBy({ + left: -scrollDelta.x, + behavior: scrollBehavior + }); + } + + break; + } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { + const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; + const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; + + if (canScrollToNewCoordinates && !coordinatesDelta.x) { + // We don't need to update coordinates, the scroll adjustment alone will trigger + // logic to auto-detect the new container we are over + scrollContainer.scrollTo({ + top: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + + if (canScrollToNewCoordinates) { + scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; + } else { + scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; + } + + if (scrollDelta.y) { + scrollContainer.scrollBy({ + top: -scrollDelta.y, + behavior: scrollBehavior + }); + } + + break; + } + } + + this.handleMove(event, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(newCoordinates, this.referenceCoordinates), scrollDelta)); + } + } + } + + handleMove(event, coordinates) { + const { + onMove + } = this.props; + event.preventDefault(); + onMove(coordinates); + } + + handleEnd(event) { + const { + onEnd + } = this.props; + event.preventDefault(); + this.detach(); + onEnd(); + } + + handleCancel(event) { + const { + onCancel + } = this.props; + event.preventDefault(); + this.detach(); + onCancel(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + } + +} +KeyboardSensor.activators = [{ + eventName: 'onKeyDown', + handler: (event, _ref, _ref2) => { + let { + keyboardCodes = defaultKeyboardCodes, + onActivation + } = _ref; + let { + active + } = _ref2; + const { + code + } = event.nativeEvent; + + if (keyboardCodes.start.includes(code)) { + const activator = active.activatorNode.current; + + if (activator && event.target !== activator) { + return false; + } + + event.preventDefault(); + onActivation == null ? void 0 : onActivation({ + event: event.nativeEvent + }); + return true; + } + + return false; + } +}]; + +function isDistanceConstraint(constraint) { + return Boolean(constraint && 'distance' in constraint); +} + +function isDelayConstraint(constraint) { + return Boolean(constraint && 'delay' in constraint); +} + +class AbstractPointerSensor { + constructor(props, events, listenerTarget) { + var _getEventCoordinates; + + if (listenerTarget === void 0) { + listenerTarget = getEventListenerTarget(props.event.target); + } + + this.props = void 0; + this.events = void 0; + this.autoScrollEnabled = true; + this.document = void 0; + this.activated = false; + this.initialCoordinates = void 0; + this.timeoutId = null; + this.listeners = void 0; + this.documentListeners = void 0; + this.windowListeners = void 0; + this.props = props; + this.events = events; + const { + event + } = props; + const { + target + } = event; + this.props = props; + this.events = events; + this.document = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(target); + this.documentListeners = new Listeners(this.document); + this.listeners = new Listeners(listenerTarget); + this.windowListeners = new Listeners((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(target)); + this.initialCoordinates = (_getEventCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates : defaultCoordinates; + this.handleStart = this.handleStart.bind(this); + this.handleMove = this.handleMove.bind(this); + this.handleEnd = this.handleEnd.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.handleKeydown = this.handleKeydown.bind(this); + this.removeTextSelection = this.removeTextSelection.bind(this); + this.attach(); + } + + attach() { + const { + events, + props: { + options: { + activationConstraint, + bypassActivationConstraint + } + } + } = this; + this.listeners.add(events.move.name, this.handleMove, { + passive: false + }); + this.listeners.add(events.end.name, this.handleEnd); + + if (events.cancel) { + this.listeners.add(events.cancel.name, this.handleCancel); + } + + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.DragStart, preventDefault); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + this.windowListeners.add(EventName.ContextMenu, preventDefault); + this.documentListeners.add(EventName.Keydown, this.handleKeydown); + + if (activationConstraint) { + if (bypassActivationConstraint != null && bypassActivationConstraint({ + event: this.props.event, + activeNode: this.props.activeNode, + options: this.props.options + })) { + return this.handleStart(); + } + + if (isDelayConstraint(activationConstraint)) { + this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); + this.handlePending(activationConstraint); + return; + } + + if (isDistanceConstraint(activationConstraint)) { + this.handlePending(activationConstraint); + return; + } + } + + this.handleStart(); + } + + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners + // This is necessary because we listen for `click` and `selection` events on the document + + setTimeout(this.documentListeners.removeAll, 50); + + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + this.timeoutId = null; + } + } + + handlePending(constraint, offset) { + const { + active, + onPending + } = this.props; + onPending(active, constraint, this.initialCoordinates, offset); + } + + handleStart() { + const { + initialCoordinates + } = this; + const { + onStart + } = this.props; + + if (initialCoordinates) { + this.activated = true; // Stop propagation of click events once activation constraints are met + + this.documentListeners.add(EventName.Click, stopPropagation, { + capture: true + }); // Remove any text selection from the document + + this.removeTextSelection(); // Prevent further text selection while dragging + + this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); + onStart(initialCoordinates); + } + } + + handleMove(event) { + var _getEventCoordinates2; + + const { + activated, + initialCoordinates, + props + } = this; + const { + onMove, + options: { + activationConstraint + } + } = props; + + if (!initialCoordinates) { + return; + } + + const coordinates = (_getEventCoordinates2 = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(event)) != null ? _getEventCoordinates2 : defaultCoordinates; + const delta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(initialCoordinates, coordinates); // Constraint validation + + if (!activated && activationConstraint) { + if (isDistanceConstraint(activationConstraint)) { + if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + + if (hasExceededDistance(delta, activationConstraint.distance)) { + return this.handleStart(); + } + } + + if (isDelayConstraint(activationConstraint)) { + if (hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + } + + this.handlePending(activationConstraint, delta); + return; + } + + if (event.cancelable) { + event.preventDefault(); + } + + onMove(coordinates); + } + + handleEnd() { + const { + onAbort, + onEnd + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onEnd(); + } + + handleCancel() { + const { + onAbort, + onCancel + } = this.props; + this.detach(); + + if (!this.activated) { + onAbort(this.props.active); + } + + onCancel(); + } + + handleKeydown(event) { + if (event.code === KeyboardCode.Esc) { + this.handleCancel(); + } + } + + removeTextSelection() { + var _this$document$getSel; + + (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); + } + +} + +const events = { + cancel: { + name: 'pointercancel' + }, + move: { + name: 'pointermove' + }, + end: { + name: 'pointerup' + } +}; +class PointerSensor extends AbstractPointerSensor { + constructor(props) { + const { + event + } = props; // Pointer events stop firing if the target is unmounted while dragging + // Therefore we attach listeners to the owner document instead + + const listenerTarget = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(event.target); + super(props, events, listenerTarget); + } + +} +PointerSensor.activators = [{ + eventName: 'onPointerDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (!event.isPrimary || event.button !== 0) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$1 = { + move: { + name: 'mousemove' + }, + end: { + name: 'mouseup' + } +}; +var MouseButton; + +(function (MouseButton) { + MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; +})(MouseButton || (MouseButton = {})); + +class MouseSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$1, (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getOwnerDocument)(props.event.target)); + } + +} +MouseSensor.activators = [{ + eventName: 'onMouseDown', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + + if (event.button === MouseButton.RightClick) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +const events$2 = { + cancel: { + name: 'touchcancel' + }, + move: { + name: 'touchmove' + }, + end: { + name: 'touchend' + } +}; +class TouchSensor extends AbstractPointerSensor { + constructor(props) { + super(props, events$2); + } + + static setup() { + // Adding a non-capture and non-passive `touchmove` listener in order + // to force `event.preventDefault()` calls to work in dynamically added + // touchmove event handlers. This is required for iOS Safari. + window.addEventListener(events$2.move.name, noop, { + capture: false, + passive: false + }); + return function teardown() { + window.removeEventListener(events$2.move.name, noop); + }; // We create a new handler because the teardown function of another sensor + // could remove our event listener if we use a referentially equal listener. + + function noop() {} + } + +} +TouchSensor.activators = [{ + eventName: 'onTouchStart', + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + const { + touches + } = event; + + if (touches.length > 1) { + return false; + } + + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; + +var AutoScrollActivator; + +(function (AutoScrollActivator) { + AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; + AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; +})(AutoScrollActivator || (AutoScrollActivator = {})); + +var TraversalOrder; + +(function (TraversalOrder) { + TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; + TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; +})(TraversalOrder || (TraversalOrder = {})); + +function useAutoScroller(_ref) { + let { + acceleration, + activator = AutoScrollActivator.Pointer, + canScroll, + draggingRect, + enabled, + interval = 5, + order = TraversalOrder.TreeOrder, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects, + delta, + threshold + } = _ref; + const scrollIntent = useScrollIntent({ + delta, + disabled: !enabled + }); + const [setAutoScrollInterval, clearAutoScrollInterval] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useInterval)(); + const scrollSpeed = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const scrollDirection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + x: 0, + y: 0 + }); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + switch (activator) { + case AutoScrollActivator.Pointer: + return pointerCoordinates ? { + top: pointerCoordinates.y, + bottom: pointerCoordinates.y, + left: pointerCoordinates.x, + right: pointerCoordinates.x + } : null; + + case AutoScrollActivator.DraggableRect: + return draggingRect; + } + }, [activator, draggingRect, pointerCoordinates]); + const scrollContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const autoScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + const scrollContainer = scrollContainerRef.current; + + if (!scrollContainer) { + return; + } + + const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; + const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; + scrollContainer.scrollBy(scrollLeft, scrollTop); + }, []); + const sortedScrollableAncestors = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!enabled || !scrollableAncestors.length || !rect) { + clearAutoScrollInterval(); + return; + } + + for (const scrollContainer of sortedScrollableAncestors) { + if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { + continue; + } + + const index = scrollableAncestors.indexOf(scrollContainer); + const scrollContainerRect = scrollableAncestorRects[index]; + + if (!scrollContainerRect) { + continue; + } + + const { + direction, + speed + } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); + + for (const axis of ['x', 'y']) { + if (!scrollIntent[axis][direction[axis]]) { + speed[axis] = 0; + direction[axis] = 0; + } + } + + if (speed.x > 0 || speed.y > 0) { + clearAutoScrollInterval(); + scrollContainerRef.current = scrollContainer; + setAutoScrollInterval(autoScroll, interval); + scrollSpeed.current = speed; + scrollDirection.current = direction; + return; + } + } + + scrollSpeed.current = { + x: 0, + y: 0 + }; + scrollDirection.current = { + x: 0, + y: 0 + }; + clearAutoScrollInterval(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps + JSON.stringify(threshold)]); +} +const defaultScrollIntent = { + x: { + [Direction.Backward]: false, + [Direction.Forward]: false + }, + y: { + [Direction.Backward]: false, + [Direction.Forward]: false + } +}; + +function useScrollIntent(_ref2) { + let { + delta, + disabled + } = _ref2; + const previousDelta = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(delta); + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousIntent => { + if (disabled || !previousDelta || !previousIntent) { + // Reset scroll intent tracking when auto-scrolling is disabled + return defaultScrollIntent; + } + + const direction = { + x: Math.sign(delta.x - previousDelta.x), + y: Math.sign(delta.y - previousDelta.y) + }; // Keep track of the user intent to scroll in each direction for both axis + + return { + x: { + [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, + [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 + }, + y: { + [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, + [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 + } + }; + }, [disabled, delta, previousDelta]); +} + +function useCachedNode(draggableNodes, id) { + const draggableNode = id != null ? draggableNodes.get(id) : undefined; + const node = draggableNode ? draggableNode.node.current : null; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(cachedNode => { + var _ref; + + if (id == null) { + return null; + } // In some cases, the draggable node can unmount while dragging + // This is the case for virtualized lists. In those situations, + // we fall back to the last known value for that node. + + + return (_ref = node != null ? node : cachedNode) != null ? _ref : null; + }, [node, id]); +} + +function useCombineActivators(sensors, getSyntheticHandler) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => sensors.reduce((accumulator, sensor) => { + const { + sensor: Sensor + } = sensor; + const sensorActivators = Sensor.activators.map(activator => ({ + eventName: activator.eventName, + handler: getSyntheticHandler(activator.handler, sensor) + })); + return [...accumulator, ...sensorActivators]; + }, []), [sensors, getSyntheticHandler]); +} + +var MeasuringStrategy; + +(function (MeasuringStrategy) { + MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; + MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; + MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; +})(MeasuringStrategy || (MeasuringStrategy = {})); + +var MeasuringFrequency; + +(function (MeasuringFrequency) { + MeasuringFrequency["Optimized"] = "optimized"; +})(MeasuringFrequency || (MeasuringFrequency = {})); + +const defaultValue = /*#__PURE__*/new Map(); +function useDroppableMeasuring(containers, _ref) { + let { + dragging, + dependencies, + config + } = _ref; + const [queue, setQueue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const { + frequency, + measure, + strategy + } = config; + const containersRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(containers); + const disabled = isDisabled(); + const disabledRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(disabled); + const measureDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (ids) { + if (ids === void 0) { + ids = []; + } + + if (disabledRef.current) { + return; + } + + setQueue(value => { + if (value === null) { + return ids; + } + + return value.concat(ids.filter(id => !value.includes(id))); + }); + }, [disabledRef]); + const timeoutId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const droppableRects = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (disabled && !dragging) { + return defaultValue; + } + + if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { + const map = new Map(); + + for (let container of containers) { + if (!container) { + continue; + } + + if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { + // This container does not need to be re-measured + map.set(container.id, container.rect.current); + continue; + } + + const node = container.node.current; + const rect = node ? new Rect(measure(node), node) : null; + container.rect.current = rect; + + if (rect) { + map.set(container.id, rect); + } + } + + return map; + } + + return previousValue; + }, [containers, queue, dragging, disabled, measure]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + containersRef.current = containers; + }, [containers]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + measureDroppableContainers(); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [dragging, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (queue && queue.length > 0) { + setQueue(null); + } + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [JSON.stringify(queue)]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { + return; + } + + timeoutId.current = setTimeout(() => { + measureDroppableContainers(); + timeoutId.current = null; + }, frequency); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [frequency, disabled, measureDroppableContainers, ...dependencies]); + return { + droppableRects, + measureDroppableContainers, + measuringScheduled: queue != null + }; + + function isDisabled() { + switch (strategy) { + case MeasuringStrategy.Always: + return false; + + case MeasuringStrategy.BeforeDragging: + return dragging; + + default: + return !dragging; + } + } +} + +function useInitialValue(value, computeFn) { + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!value) { + return null; + } + + if (previousValue) { + return previousValue; + } + + return typeof computeFn === 'function' ? computeFn(value) : value; + }, [computeFn, value]); +} + +function useInitialRect(node, measure) { + return useInitialValue(node, measure); +} + +/** + * Returns a new MutationObserver instance. + * If `MutationObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useMutationObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleMutations = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const mutationObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { + return undefined; + } + + const { + MutationObserver + } = window; + return new MutationObserver(handleMutations); + }, [handleMutations, disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); + }, [mutationObserver]); + return mutationObserver; +} + +/** + * Returns a new ResizeObserver instance bound to the `onResize` callback. + * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. + */ + +function useResizeObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleResize = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)(callback); + const resizeObserver = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { + return undefined; + } + + const { + ResizeObserver + } = window; + return new ResizeObserver(handleResize); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [disabled]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); + }, [resizeObserver]); + return resizeObserver; +} + +function defaultMeasure(element) { + return new Rect(getClientRect(element), element); +} + +function useRect(element, measure, fallbackRect) { + if (measure === void 0) { + measure = defaultMeasure; + } + + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + + function measureRect() { + setRect(currentRect => { + if (!element) { + return null; + } + + if (element.isConnected === false) { + var _ref; + + // Fall back to last rect we measured if the element is + // no longer connected to the DOM. + return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; + } + + const newRect = measure(element); + + if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { + return currentRect; + } + + return newRect; + }); + } + + const mutationObserver = useMutationObserver({ + callback(records) { + if (!element) { + return; + } + + for (const record of records) { + const { + type, + target + } = record; + + if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { + measureRect(); + break; + } + } + } + + }); + const resizeObserver = useResizeObserver({ + callback: measureRect + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + measureRect(); + + if (element) { + resizeObserver == null ? void 0 : resizeObserver.observe(element); + mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { + childList: true, + subtree: true + }); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + mutationObserver == null ? void 0 : mutationObserver.disconnect(); + } + }, [element]); + return rect; +} + +function useRectDelta(rect) { + const initialRect = useInitialValue(rect); + return getRectDelta(rect, initialRect); +} + +const defaultValue$1 = []; +function useScrollableAncestors(node) { + const previousNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(node); + const ancestors = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLazyMemo)(previousValue => { + if (!node) { + return defaultValue$1; + } + + if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { + return previousValue; + } + + return getScrollableAncestors(node); + }, [node]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + previousNode.current = node; + }, [node]); + return ancestors; +} + +function useScrollOffsets(elements) { + const [scrollCoordinates, setScrollCoordinates] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const prevElements = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(elements); // To-do: Throttle the handleScroll callback + + const handleScroll = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => { + const scrollingElement = getScrollableElement(event.target); + + if (!scrollingElement) { + return; + } + + setScrollCoordinates(scrollCoordinates => { + if (!scrollCoordinates) { + return null; + } + + scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); + return new Map(scrollCoordinates); + }); + }, []); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const previousElements = prevElements.current; + + if (elements !== previousElements) { + cleanup(previousElements); + const entries = elements.map(element => { + const scrollableElement = getScrollableElement(element); + + if (scrollableElement) { + scrollableElement.addEventListener('scroll', handleScroll, { + passive: true + }); + return [scrollableElement, getScrollCoordinates(scrollableElement)]; + } + + return null; + }).filter(entry => entry != null); + setScrollCoordinates(entries.length ? new Map(entries) : null); + prevElements.current = elements; + } + + return () => { + cleanup(elements); + cleanup(previousElements); + }; + + function cleanup(elements) { + elements.forEach(element => { + const scrollableElement = getScrollableElement(element); + scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); + }); + } + }, [handleScroll, elements]); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (elements.length) { + return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); + } + + return defaultCoordinates; + }, [elements, scrollCoordinates]); +} + +function useScrollOffsetsDelta(scrollOffsets, dependencies) { + if (dependencies === void 0) { + dependencies = []; + } + + const initialScrollOffsets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + initialScrollOffsets.current = null; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + dependencies); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const hasScrollOffsets = scrollOffsets !== defaultCoordinates; + + if (hasScrollOffsets && !initialScrollOffsets.current) { + initialScrollOffsets.current = scrollOffsets; + } + + if (!hasScrollOffsets && initialScrollOffsets.current) { + initialScrollOffsets.current = null; + } + }, [scrollOffsets]); + return initialScrollOffsets.current ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; +} + +function useSensorSetup(sensors) { + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.canUseDOM) { + return; + } + + const teardownFns = sensors.map(_ref => { + let { + sensor + } = _ref; + return sensor.setup == null ? void 0 : sensor.setup(); + }); + return () => { + for (const teardown of teardownFns) { + teardown == null ? void 0 : teardown(); + } + }; + }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency + // eslint-disable-next-line react-hooks/exhaustive-deps + sensors.map(_ref2 => { + let { + sensor + } = _ref2; + return sensor; + })); +} + +function useSyntheticListeners(listeners, id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + return listeners.reduce((acc, _ref) => { + let { + eventName, + handler + } = _ref; + + acc[eventName] = event => { + handler(event, id); + }; + + return acc; + }, {}); + }, [listeners, id]); +} + +function useWindowRect(element) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => element ? getWindowClientRect(element) : null, [element]); +} + +const defaultValue$2 = []; +function useRects(elements, measure) { + if (measure === void 0) { + measure = getClientRect; + } + + const [firstElement] = elements; + const windowRect = useWindowRect(firstElement ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(firstElement) : null); + const [rects, setRects] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue$2); + + function measureRects() { + setRects(() => { + if (!elements.length) { + return defaultValue$2; + } + + return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); + }); + } + + const resizeObserver = useResizeObserver({ + callback: measureRects + }); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + measureRects(); + elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element)); + }, [elements]); + return rects; +} + +function getMeasurableNode(node) { + if (!node) { + return null; + } + + if (node.children.length > 1) { + return node; + } + + const firstChild = node.children[0]; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(firstChild) ? firstChild : node; +} + +function useDragOverlayMeasuring(_ref) { + let { + measure + } = _ref; + const [rect, setRect] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(entries => { + for (const { + target + } of entries) { + if ((0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(target)) { + setRect(rect => { + const newRect = measure(target); + return rect ? { ...rect, + width: newRect.width, + height: newRect.height + } : newRect; + }); + break; + } + } + }, [measure]); + const resizeObserver = useResizeObserver({ + callback: handleResize + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + const node = getMeasurableNode(element); + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + + if (node) { + resizeObserver == null ? void 0 : resizeObserver.observe(node); + } + + setRect(node ? measure(node) : null); + }, [measure, resizeObserver]); + const [nodeRef, setRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + nodeRef, + rect, + setRef + }), [rect, nodeRef, setRef]); +} + +const defaultSensors = [{ + sensor: PointerSensor, + options: {} +}, { + sensor: KeyboardSensor, + options: {} +}]; +const defaultData = { + current: {} +}; +const defaultMeasuringConfiguration = { + draggable: { + measure: getTransformAgnosticClientRect + }, + droppable: { + measure: getTransformAgnosticClientRect, + strategy: MeasuringStrategy.WhileDragging, + frequency: MeasuringFrequency.Optimized + }, + dragOverlay: { + measure: getClientRect + } +}; + +class DroppableContainersMap extends Map { + get(id) { + var _super$get; + + return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; + } + + toArray() { + return Array.from(this.values()); + } + + getEnabled() { + return this.toArray().filter(_ref => { + let { + disabled + } = _ref; + return !disabled; + }); + } + + getNodeFor(id) { + var _this$get$node$curren, _this$get; + + return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; + } + +} + +const defaultPublicContext = { + activatorEvent: null, + active: null, + activeNode: null, + activeNodeRect: null, + collisions: null, + containerNodeRect: null, + draggableNodes: /*#__PURE__*/new Map(), + droppableRects: /*#__PURE__*/new Map(), + droppableContainers: /*#__PURE__*/new DroppableContainersMap(), + over: null, + dragOverlay: { + nodeRef: { + current: null + }, + rect: null, + setRef: noop + }, + scrollableAncestors: [], + scrollableAncestorRects: [], + measuringConfiguration: defaultMeasuringConfiguration, + measureDroppableContainers: noop, + windowRect: null, + measuringScheduled: false +}; +const defaultInternalContext = { + activatorEvent: null, + activators: [], + active: null, + activeNodeRect: null, + ariaDescribedById: { + draggable: '' + }, + dispatch: noop, + draggableNodes: /*#__PURE__*/new Map(), + over: null, + measureDroppableContainers: noop +}; +const InternalContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultInternalContext); +const PublicContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(defaultPublicContext); + +function getInitialState() { + return { + draggable: { + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + nodes: new Map(), + translate: { + x: 0, + y: 0 + } + }, + droppable: { + containers: new DroppableContainersMap() + } + }; +} +function reducer(state, action) { + switch (action.type) { + case Action.DragStart: + return { ...state, + draggable: { ...state.draggable, + initialCoordinates: action.initialCoordinates, + active: action.active + } + }; + + case Action.DragMove: + if (state.draggable.active == null) { + return state; + } + + return { ...state, + draggable: { ...state.draggable, + translate: { + x: action.coordinates.x - state.draggable.initialCoordinates.x, + y: action.coordinates.y - state.draggable.initialCoordinates.y + } + } + }; + + case Action.DragEnd: + case Action.DragCancel: + return { ...state, + draggable: { ...state.draggable, + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + translate: { + x: 0, + y: 0 + } + } + }; + + case Action.RegisterDroppable: + { + const { + element + } = action; + const { + id + } = element; + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, element); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.SetDroppableDisabled: + { + const { + id, + key, + disabled + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id, { ...element, + disabled + }); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + case Action.UnregisterDroppable: + { + const { + id, + key + } = action; + const element = state.droppable.containers.get(id); + + if (!element || key !== element.key) { + return state; + } + + const containers = new DroppableContainersMap(state.droppable.containers); + containers.delete(id); + return { ...state, + droppable: { ...state.droppable, + containers + } + }; + } + + default: + { + return state; + } + } +} + +function RestoreFocus(_ref) { + let { + disabled + } = _ref; + const { + active, + activatorEvent, + draggableNodes + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previousActivatorEvent = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(activatorEvent); + const previousActiveId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node + + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled) { + return; + } + + if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { + if (!(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(previousActivatorEvent)) { + return; + } + + if (document.activeElement === previousActivatorEvent.target) { + // No need to restore focus + return; + } + + const draggableNode = draggableNodes.get(previousActiveId); + + if (!draggableNode) { + return; + } + + const { + activatorNode, + node + } = draggableNode; + + if (!activatorNode.current && !node.current) { + return; + } + + requestAnimationFrame(() => { + for (const element of [activatorNode.current, node.current]) { + if (!element) { + continue; + } + + const focusableNode = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.findFirstFocusableNode)(element); + + if (focusableNode) { + focusableNode.focus(); + break; + } + } + }); + } + }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); + return null; +} + +function applyModifiers(modifiers, _ref) { + let { + transform, + ...args + } = _ref; + return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { + return modifier({ + transform: accumulator, + ...args + }); + }, transform) : transform; +} + +function useMeasuringConfiguration(config) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + draggable: { ...defaultMeasuringConfiguration.draggable, + ...(config == null ? void 0 : config.draggable) + }, + droppable: { ...defaultMeasuringConfiguration.droppable, + ...(config == null ? void 0 : config.droppable) + }, + dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay, + ...(config == null ? void 0 : config.dragOverlay) + } + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]); +} + +function useLayoutShiftScrollCompensation(_ref) { + let { + activeNode, + measure, + initialRect, + config = true + } = _ref; + const initialized = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const { + x, + y + } = typeof config === 'boolean' ? { + x: config, + y: config + } : config; + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + const disabled = !x && !y; + + if (disabled || !activeNode) { + initialized.current = false; + return; + } + + if (initialized.current || !initialRect) { + // Return early if layout shift scroll compensation was already attempted + // or if there is no initialRect to compare to. + return; + } // Get the most up to date node ref for the active draggable + + + const node = activeNode == null ? void 0 : activeNode.node.current; + + if (!node || node.isConnected === false) { + // Return early if there is no attached node ref or if the node is + // disconnected from the document. + return; + } + + const rect = measure(node); + const rectDelta = getRectDelta(rect, initialRect); + + if (!x) { + rectDelta.x = 0; + } + + if (!y) { + rectDelta.y = 0; + } // Only perform layout shift scroll compensation once + + + initialized.current = true; + + if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { + const firstScrollableAncestor = getFirstScrollableAncestor(node); + + if (firstScrollableAncestor) { + firstScrollableAncestor.scrollBy({ + top: rectDelta.y, + left: rectDelta.x + }); + } + } + }, [activeNode, x, y, initialRect, measure]); +} + +const ActiveDraggableContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ ...defaultCoordinates, + scaleX: 1, + scaleY: 1 +}); +var Status; + +(function (Status) { + Status[Status["Uninitialized"] = 0] = "Uninitialized"; + Status[Status["Initializing"] = 1] = "Initializing"; + Status[Status["Initialized"] = 2] = "Initialized"; +})(Status || (Status = {})); + +const DndContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function DndContext(_ref) { + var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; + + let { + id, + accessibility, + autoScroll = true, + children, + sensors = defaultSensors, + collisionDetection = rectIntersection, + measuring, + modifiers, + ...props + } = _ref; + const store = (0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(reducer, undefined, getInitialState); + const [state, dispatch] = store; + const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); + const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Status.Uninitialized); + const isInitialized = status === Status.Initialized; + const { + draggable: { + active: activeId, + nodes: draggableNodes, + translate + }, + droppable: { + containers: droppableContainers + } + } = state; + const node = activeId != null ? draggableNodes.get(activeId) : null; + const activeRects = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + initial: null, + translated: null + }); + const active = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + var _node$data; + + return activeId != null ? { + id: activeId, + // It's possible for the active node to unmount while dragging + data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, + rect: activeRects + } : null; + }, [activeId, node]); + const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const [activeSensor, setActiveSensor] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [activatorEvent, setActivatorEvent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const latestProps = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(props, Object.values(props)); + const draggableDescribedById = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)("DndDescribedBy", id); + const enabledDroppableContainers = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => droppableContainers.getEnabled(), [droppableContainers]); + const measuringConfiguration = useMeasuringConfiguration(measuring); + const { + droppableRects, + measureDroppableContainers, + measuringScheduled + } = useDroppableMeasuring(enabledDroppableContainers, { + dragging: isInitialized, + dependencies: [translate.x, translate.y], + config: measuringConfiguration.droppable + }); + const activeNode = useCachedNode(draggableNodes, activeId); + const activationCoordinates = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => activatorEvent ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getEventCoordinates)(activatorEvent) : null, [activatorEvent]); + const autoScrollOptions = getAutoScrollerOptions(); + const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); + useLayoutShiftScrollCompensation({ + activeNode: activeId != null ? draggableNodes.get(activeId) : null, + config: autoScrollOptions.layoutShiftCompensation, + initialRect: initialActiveNodeRect, + measure: measuringConfiguration.draggable.measure + }); + const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); + const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); + const sensorContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + activatorEvent: null, + active: null, + activeNode, + collisionRect: null, + collisions: null, + droppableRects, + draggableNodes, + draggingNode: null, + draggingNodeRect: null, + droppableContainers, + over: null, + scrollableAncestors: [], + scrollAdjustedTranslate: null + }); + const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); + const dragOverlay = useDragOverlayMeasuring({ + measure: measuringConfiguration.dragOverlay.measure + }); // Use the rect of the drag overlay if it is mounted + + const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; + const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; + const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node + // is only relevant when there is no drag overlay + + const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node + + const windowRect = useWindowRect(draggingNode ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(draggingNode) : null); // Get scrollable ancestors of the dragging node + + const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); + const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers + + const modifiedTranslate = applyModifiers(modifiers, { + transform: { + x: translate.x - nodeRectDelta.x, + y: translate.y - nodeRectDelta.y, + scaleX: 1, + scaleY: 1 + }, + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect, + over: sensorContext.current.over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + windowRect + }); + const pointerCoordinates = activationCoordinates ? (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(activationCoordinates, translate) : null; + const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated + + const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured + + const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); + const scrollAdjustedTranslate = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, scrollAdjustment); + const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; + const collisions = active && collisionRect ? collisionDetection({ + active, + collisionRect, + droppableRects, + droppableContainers: enabledDroppableContainers, + pointerCoordinates + }) : null; + const overId = getFirstCollision(collisions, 'id'); + const [over, setOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); // When there is no drag overlay used, we need to account for the + // window scroll delta + + const appliedTranslate = usesDragOverlay ? modifiedTranslate : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.add)(modifiedTranslate, activeNodeScrollDelta); + const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); + const activeSensorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const instantiateSensor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((event, _ref2) => { + let { + sensor: Sensor, + options + } = _ref2; + + if (activeRef.current == null) { + return; + } + + const activeNode = draggableNodes.get(activeRef.current); + + if (!activeNode) { + return; + } + + const activatorEvent = event.nativeEvent; + const sensorInstance = new Sensor({ + active: activeRef.current, + activeNode, + event: activatorEvent, + options, + // Sensors need to be instantiated with refs for arguments that change over time + // otherwise they are frozen in time with the stale arguments + context: sensorContext, + + onAbort(id) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragAbort + } = latestProps.current; + const event = { + id + }; + onDragAbort == null ? void 0 : onDragAbort(event); + dispatchMonitorEvent({ + type: 'onDragAbort', + event + }); + }, + + onPending(id, constraint, initialCoordinates, offset) { + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragPending + } = latestProps.current; + const event = { + id, + constraint, + initialCoordinates, + offset + }; + onDragPending == null ? void 0 : onDragPending(event); + dispatchMonitorEvent({ + type: 'onDragPending', + event + }); + }, + + onStart(initialCoordinates) { + const id = activeRef.current; + + if (id == null) { + return; + } + + const draggableNode = draggableNodes.get(id); + + if (!draggableNode) { + return; + } + + const { + onDragStart + } = latestProps.current; + const event = { + activatorEvent, + active: { + id, + data: draggableNode.data, + rect: activeRects + } + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragStart == null ? void 0 : onDragStart(event); + setStatus(Status.Initializing); + dispatch({ + type: Action.DragStart, + initialCoordinates, + active: id + }); + dispatchMonitorEvent({ + type: 'onDragStart', + event + }); + setActiveSensor(activeSensorRef.current); + setActivatorEvent(activatorEvent); + }); + }, + + onMove(coordinates) { + dispatch({ + type: Action.DragMove, + coordinates + }); + }, + + onEnd: createHandler(Action.DragEnd), + onCancel: createHandler(Action.DragCancel) + }); + activeSensorRef.current = sensorInstance; + + function createHandler(type) { + return async function handler() { + const { + active, + collisions, + over, + scrollAdjustedTranslate + } = sensorContext.current; + let event = null; + + if (active && scrollAdjustedTranslate) { + const { + cancelDrop + } = latestProps.current; + event = { + activatorEvent, + active: active, + collisions, + delta: scrollAdjustedTranslate, + over + }; + + if (type === Action.DragEnd && typeof cancelDrop === 'function') { + const shouldCancel = await Promise.resolve(cancelDrop(event)); + + if (shouldCancel) { + type = Action.DragCancel; + } + } + } + + activeRef.current = null; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + dispatch({ + type + }); + setStatus(Status.Uninitialized); + setOver(null); + setActiveSensor(null); + setActivatorEvent(null); + activeSensorRef.current = null; + const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; + + if (event) { + const handler = latestProps.current[eventName]; + handler == null ? void 0 : handler(event); + dispatchMonitorEvent({ + type: eventName, + event + }); + } + }); + }; + } + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes]); + const bindActivatorToSensorInstantiator = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((handler, sensor) => { + return (event, active) => { + const nativeEvent = event.nativeEvent; + const activeDraggableNode = draggableNodes.get(active); + + if ( // Another sensor is already instantiating + activeRef.current !== null || // No active draggable + !activeDraggableNode || // Event has already been captured + nativeEvent.dndKit || nativeEvent.defaultPrevented) { + return; + } + + const activationContext = { + active: activeDraggableNode + }; + const shouldActivate = handler(event, sensor.options, activationContext); + + if (shouldActivate === true) { + nativeEvent.dndKit = { + capturedBy: sensor.sensor + }; + activeRef.current = active; + instantiateSensor(event, sensor); + } + }; + }, [draggableNodes, instantiateSensor]); + const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); + useSensorSetup(sensors); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (activeNodeRect && status === Status.Initializing) { + setStatus(Status.Initialized); + } + }, [activeNodeRect, status]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + onDragMove + } = latestProps.current; + const { + active, + activatorEvent, + collisions, + over + } = sensorContext.current; + + if (!active || !activatorEvent) { + return; + } + + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + onDragMove == null ? void 0 : onDragMove(event); + dispatchMonitorEvent({ + type: 'onDragMove', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + const { + active, + activatorEvent, + collisions, + droppableContainers, + scrollAdjustedTranslate + } = sensorContext.current; + + if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { + return; + } + + const { + onDragOver + } = latestProps.current; + const overContainer = droppableContainers.get(overId); + const over = overContainer && overContainer.rect.current ? { + id: overContainer.id, + rect: overContainer.rect.current, + data: overContainer.data, + disabled: overContainer.disabled + } : null; + const event = { + active, + activatorEvent, + collisions, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over + }; + (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.unstable_batchedUpdates)(() => { + setOver(over); + onDragOver == null ? void 0 : onDragOver(event); + dispatchMonitorEvent({ + type: 'onDragOver', + event + }); + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [overId]); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + sensorContext.current = { + activatorEvent, + active, + activeNode, + collisionRect, + collisions, + droppableRects, + draggableNodes, + draggingNode, + draggingNodeRect, + droppableContainers, + over, + scrollableAncestors, + scrollAdjustedTranslate + }; + activeRects.current = { + initial: draggingNodeRect, + translated: collisionRect + }; + }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); + useAutoScroller({ ...autoScrollOptions, + delta: translate, + draggingRect: collisionRect, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects + }); + const publicContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + active, + activeNode, + activeNodeRect, + activatorEvent, + collisions, + containerNodeRect, + dragOverlay, + draggableNodes, + droppableContainers, + droppableRects, + over, + measureDroppableContainers, + scrollableAncestors, + scrollableAncestorRects, + measuringConfiguration, + measuringScheduled, + windowRect + }; + return context; + }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); + const internalContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const context = { + activatorEvent, + activators, + active, + activeNodeRect, + ariaDescribedById: { + draggable: draggableDescribedById + }, + dispatch, + draggableNodes, + over, + measureDroppableContainers + }; + return context; + }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DndMonitorContext.Provider, { + value: registerMonitorListener + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: internalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PublicContext.Provider, { + value: publicContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: transform + }, children)), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RestoreFocus, { + disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false + })), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Accessibility, { ...accessibility, + hiddenTextDescribedById: draggableDescribedById + })); + + function getAutoScrollerOptions() { + const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; + const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; + const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; + + if (typeof autoScroll === 'object') { + return { ...autoScroll, + enabled + }; + } + + return { + enabled + }; + } +}); + +const NullContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); +const defaultRole = 'button'; +const ID_PREFIX = 'Draggable'; +function useDraggable(_ref) { + let { + id, + data, + disabled = false, + attributes + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX); + const { + activators, + activatorEvent, + active, + activeNodeRect, + ariaDescribedById, + draggableNodes, + over + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const { + role = defaultRole, + roleDescription = 'draggable', + tabIndex = 0 + } = attributes != null ? attributes : {}; + const isDragging = (active == null ? void 0 : active.id) === id; + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(isDragging ? ActiveDraggableContext : NullContext); + const [node, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const [activatorNode, setActivatorNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(); + const listeners = useSyntheticListeners(activators, id); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + draggableNodes.set(id, { + id, + key, + node, + activatorNode, + data: dataRef + }); + return () => { + const node = draggableNodes.get(id); + + if (node && node.key === key) { + draggableNodes.delete(id); + } + }; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [draggableNodes, id]); + const memoizedAttributes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + role, + tabIndex, + 'aria-disabled': disabled, + 'aria-pressed': isDragging && role === defaultRole ? true : undefined, + 'aria-roledescription': roleDescription, + 'aria-describedby': ariaDescribedById.draggable + }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); + return { + active, + activatorEvent, + activeNodeRect, + attributes: memoizedAttributes, + isDragging, + listeners: disabled ? undefined : listeners, + node, + over, + setNodeRef, + setActivatorNodeRef, + transform + }; +} + +function useDndContext() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PublicContext); +} + +const ID_PREFIX$1 = 'Droppable'; +const defaultResizeObserverConfig = { + timeout: 25 +}; +function useDroppable(_ref) { + let { + data, + disabled = false, + id, + resizeObserverConfig + } = _ref; + const key = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX$1); + const { + active, + dispatch, + over, + measureDroppableContainers + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(InternalContext); + const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + disabled + }); + const resizeObserverConnected = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false); + const rect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const callbackId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const { + disabled: resizeObserverDisabled, + updateMeasurementsFor, + timeout: resizeObserverTimeout + } = { ...defaultResizeObserverConfig, + ...resizeObserverConfig + }; + const ids = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(updateMeasurementsFor != null ? updateMeasurementsFor : id); + const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (!resizeObserverConnected.current) { + // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, + // assuming the element is rendered and displayed. + resizeObserverConnected.current = true; + return; + } + + if (callbackId.current != null) { + clearTimeout(callbackId.current); + } + + callbackId.current = setTimeout(() => { + measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]); + callbackId.current = null; + }, resizeObserverTimeout); + }, //eslint-disable-next-line react-hooks/exhaustive-deps + [resizeObserverTimeout]); + const resizeObserver = useResizeObserver({ + callback: handleResize, + disabled: resizeObserverDisabled || !active + }); + const handleNodeChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((newElement, previousElement) => { + if (!resizeObserver) { + return; + } + + if (previousElement) { + resizeObserver.unobserve(previousElement); + resizeObserverConnected.current = false; + } + + if (newElement) { + resizeObserver.observe(newElement); + } + }, [resizeObserver]); + const [nodeRef, setNodeRef] = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useNodeRef)(handleNodeChange); + const dataRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useLatestValue)(data); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (!resizeObserver || !nodeRef.current) { + return; + } + + resizeObserver.disconnect(); + resizeObserverConnected.current = false; + resizeObserver.observe(nodeRef.current); + }, [nodeRef, resizeObserver]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + dispatch({ + type: Action.RegisterDroppable, + element: { + id, + key, + disabled, + node: nodeRef, + rect, + data: dataRef + } + }); + return () => dispatch({ + type: Action.UnregisterDroppable, + key, + id + }); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [id]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (disabled !== previous.current.disabled) { + dispatch({ + type: Action.SetDroppableDisabled, + id, + key, + disabled + }); + previous.current.disabled = disabled; + } + }, [id, key, disabled, dispatch]); + return { + active, + rect, + isOver: (over == null ? void 0 : over.id) === id, + node: nodeRef, + over, + setNodeRef + }; +} + +function AnimationManager(_ref) { + let { + animation, + children + } = _ref; + const [clonedChildren, setClonedChildren] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const [element, setElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const previousChildren = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.usePrevious)(children); + + if (!children && !clonedChildren && previousChildren) { + setClonedChildren(previousChildren); + } + + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (!element) { + return; + } + + const key = clonedChildren == null ? void 0 : clonedChildren.key; + const id = clonedChildren == null ? void 0 : clonedChildren.props.id; + + if (key == null || id == null) { + setClonedChildren(null); + return; + } + + Promise.resolve(animation(id, element)).then(() => { + setClonedChildren(null); + }); + }, [animation, clonedChildren, element]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, children, clonedChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(clonedChildren, { + ref: setElement + }) : null); +} + +const defaultTransform = { + x: 0, + y: 0, + scaleX: 1, + scaleY: 1 +}; +function NullifiedContextProvider(_ref) { + let { + children + } = _ref; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InternalContext.Provider, { + value: defaultInternalContext + }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ActiveDraggableContext.Provider, { + value: defaultTransform + }, children)); +} + +const baseStyles = { + position: 'fixed', + touchAction: 'none' +}; + +const defaultTransition = activatorEvent => { + const isKeyboardActivator = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent); + return isKeyboardActivator ? 'transform 250ms ease' : undefined; +}; + +const PositionedOverlay = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => { + let { + as, + activatorEvent, + adjustScale, + children, + className, + rect, + style, + transform, + transition = defaultTransition + } = _ref; + + if (!rect) { + return null; + } + + const scaleAdjustedTransform = adjustScale ? transform : { ...transform, + scaleX: 1, + scaleY: 1 + }; + const styles = { ...baseStyles, + width: rect.width, + height: rect.height, + top: rect.top, + left: rect.left, + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(scaleAdjustedTransform), + transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, + transition: typeof transition === 'function' ? transition(activatorEvent) : transition, + ...style + }; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(as, { + className, + style: styles, + ref + }, children); +}); + +const defaultDropAnimationSideEffects = options => _ref => { + let { + active, + dragOverlay + } = _ref; + const originalStyles = {}; + const { + styles, + className + } = options; + + if (styles != null && styles.active) { + for (const [key, value] of Object.entries(styles.active)) { + if (value === undefined) { + continue; + } + + originalStyles[key] = active.node.style.getPropertyValue(key); + active.node.style.setProperty(key, value); + } + } + + if (styles != null && styles.dragOverlay) { + for (const [key, value] of Object.entries(styles.dragOverlay)) { + if (value === undefined) { + continue; + } + + dragOverlay.node.style.setProperty(key, value); + } + } + + if (className != null && className.active) { + active.node.classList.add(className.active); + } + + if (className != null && className.dragOverlay) { + dragOverlay.node.classList.add(className.dragOverlay); + } + + return function cleanup() { + for (const [key, value] of Object.entries(originalStyles)) { + active.node.style.setProperty(key, value); + } + + if (className != null && className.active) { + active.node.classList.remove(className.active); + } + }; +}; + +const defaultKeyframeResolver = _ref2 => { + let { + transform: { + initial, + final + } + } = _ref2; + return [{ + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(initial) + }, { + transform: _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transform.toString(final) + }]; +}; + +const defaultDropAnimationConfiguration = { + duration: 250, + easing: 'ease', + keyframes: defaultKeyframeResolver, + sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({ + styles: { + active: { + opacity: '0' + } + } + }) +}; +function useDropAnimation(_ref3) { + let { + config, + draggableNodes, + droppableContainers, + measuringConfiguration + } = _ref3; + return (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useEvent)((id, node) => { + if (config === null) { + return; + } + + const activeDraggable = draggableNodes.get(id); + + if (!activeDraggable) { + return; + } + + const activeNode = activeDraggable.node.current; + + if (!activeNode) { + return; + } + + const measurableNode = getMeasurableNode(node); + + if (!measurableNode) { + return; + } + + const { + transform + } = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.getWindow)(node).getComputedStyle(node); + const parsedTransform = parseTransform(transform); + + if (!parsedTransform) { + return; + } + + const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); + scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); + return animation({ + active: { + id, + data: activeDraggable.data, + node: activeNode, + rect: measuringConfiguration.draggable.measure(activeNode) + }, + draggableNodes, + dragOverlay: { + node, + rect: measuringConfiguration.dragOverlay.measure(measurableNode) + }, + droppableContainers, + measuringConfiguration, + transform: parsedTransform + }); + }); +} + +function createDefaultDropAnimation(options) { + const { + duration, + easing, + sideEffects, + keyframes + } = { ...defaultDropAnimationConfiguration, + ...options + }; + return _ref4 => { + let { + active, + dragOverlay, + transform, + ...rest + } = _ref4; + + if (!duration) { + // Do not animate if animation duration is zero. + return; + } + + const delta = { + x: dragOverlay.rect.left - active.rect.left, + y: dragOverlay.rect.top - active.rect.top + }; + const scale = { + scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, + scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 + }; + const finalTransform = { + x: transform.x - delta.x, + y: transform.y - delta.y, + ...scale + }; + const animationKeyframes = keyframes({ ...rest, + active, + dragOverlay, + transform: { + initial: transform, + final: finalTransform + } + }); + const [firstKeyframe] = animationKeyframes; + const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; + + if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { + // The start and end keyframes are the same, infer that there is no animation needed. + return; + } + + const cleanup = sideEffects == null ? void 0 : sideEffects({ + active, + dragOverlay, + ...rest + }); + const animation = dragOverlay.node.animate(animationKeyframes, { + duration, + easing, + fill: 'forwards' + }); + return new Promise(resolve => { + animation.onfinish = () => { + cleanup == null ? void 0 : cleanup(); + resolve(); + }; + }); + }; +} + +let key = 0; +function useKey(id) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (id == null) { + return; + } + + key++; + return key; + }, [id]); +} + +const DragOverlay = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(_ref => { + let { + adjustScale = false, + children, + dropAnimation: dropAnimationConfig, + style, + transition, + modifiers, + wrapperElement = 'div', + className, + zIndex = 999 + } = _ref; + const { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggableNodes, + droppableContainers, + dragOverlay, + over, + measuringConfiguration, + scrollableAncestors, + scrollableAncestorRects, + windowRect + } = useDndContext(); + const transform = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ActiveDraggableContext); + const key = useKey(active == null ? void 0 : active.id); + const modifiedTransform = applyModifiers(modifiers, { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect: dragOverlay.rect, + over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + transform, + windowRect + }); + const initialRect = useInitialValue(activeNodeRect); + const dropAnimation = useDropAnimation({ + config: dropAnimationConfig, + draggableNodes, + droppableContainers, + measuringConfiguration + }); // We need to wait for the active node to be measured before connecting the drag overlay ref + // otherwise collisions can be computed against a mispositioned drag overlay + + const ref = initialRect ? dragOverlay.setRef : undefined; + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(NullifiedContextProvider, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AnimationManager, { + animation: dropAnimation + }, active && key ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PositionedOverlay, { + key: key, + id: active.id, + ref: ref, + as: wrapperElement, + activatorEvent: activatorEvent, + adjustScale: adjustScale, + className: className, + transition: transition, + rect: initialRect, + style: { + zIndex, + ...style + }, + transform: modifiedTransform + }, children) : null)); +}); + + +//# sourceMappingURL=core.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createSnapModifier: () => (/* binding */ createSnapModifier), +/* harmony export */ restrictToFirstScrollableAncestor: () => (/* binding */ restrictToFirstScrollableAncestor), +/* harmony export */ restrictToHorizontalAxis: () => (/* binding */ restrictToHorizontalAxis), +/* harmony export */ restrictToParentElement: () => (/* binding */ restrictToParentElement), +/* harmony export */ restrictToVerticalAxis: () => (/* binding */ restrictToVerticalAxis), +/* harmony export */ restrictToWindowEdges: () => (/* binding */ restrictToWindowEdges), +/* harmony export */ snapCenterToCursor: () => (/* binding */ snapCenterToCursor) +/* harmony export */ }); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + + +function createSnapModifier(gridSize) { + return _ref => { + let { + transform + } = _ref; + return { ...transform, + x: Math.ceil(transform.x / gridSize) * gridSize, + y: Math.ceil(transform.y / gridSize) * gridSize + }; + }; +} + +const restrictToHorizontalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + y: 0 + }; +}; + +function restrictToBoundingRect(transform, rect, boundingRect) { + const value = { ...transform + }; + + if (rect.top + transform.y <= boundingRect.top) { + value.y = boundingRect.top - rect.top; + } else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) { + value.y = boundingRect.top + boundingRect.height - rect.bottom; + } + + if (rect.left + transform.x <= boundingRect.left) { + value.x = boundingRect.left - rect.left; + } else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) { + value.x = boundingRect.left + boundingRect.width - rect.right; + } + + return value; +} + +const restrictToParentElement = _ref => { + let { + containerNodeRect, + draggingNodeRect, + transform + } = _ref; + + if (!draggingNodeRect || !containerNodeRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect); +}; + +const restrictToFirstScrollableAncestor = _ref => { + let { + draggingNodeRect, + transform, + scrollableAncestorRects + } = _ref; + const firstScrollableAncestorRect = scrollableAncestorRects[0]; + + if (!draggingNodeRect || !firstScrollableAncestorRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, firstScrollableAncestorRect); +}; + +const restrictToVerticalAxis = _ref => { + let { + transform + } = _ref; + return { ...transform, + x: 0 + }; +}; + +const restrictToWindowEdges = _ref => { + let { + transform, + draggingNodeRect, + windowRect + } = _ref; + + if (!draggingNodeRect || !windowRect) { + return transform; + } + + return restrictToBoundingRect(transform, draggingNodeRect, windowRect); +}; + +const snapCenterToCursor = _ref => { + let { + activatorEvent, + draggingNodeRect, + transform + } = _ref; + + if (draggingNodeRect && activatorEvent) { + const activatorCoordinates = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_0__.getEventCoordinates)(activatorEvent); + + if (!activatorCoordinates) { + return transform; + } + + const offsetX = activatorCoordinates.x - draggingNodeRect.left; + const offsetY = activatorCoordinates.y - draggingNodeRect.top; + return { ...transform, + x: transform.x + offsetX - draggingNodeRect.width / 2, + y: transform.y + offsetY - draggingNodeRect.height / 2 + }; + } + + return transform; +}; + + +//# sourceMappingURL=modifiers.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/sortable/dist/sortable.esm.js": +/*!*************************************************************!*\ + !*** ./node_modules/@dnd-kit/sortable/dist/sortable.esm.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ SortableContext: () => (/* binding */ SortableContext), +/* harmony export */ arrayMove: () => (/* binding */ arrayMove), +/* harmony export */ arraySwap: () => (/* binding */ arraySwap), +/* harmony export */ defaultAnimateLayoutChanges: () => (/* binding */ defaultAnimateLayoutChanges), +/* harmony export */ defaultNewIndexGetter: () => (/* binding */ defaultNewIndexGetter), +/* harmony export */ hasSortableData: () => (/* binding */ hasSortableData), +/* harmony export */ horizontalListSortingStrategy: () => (/* binding */ horizontalListSortingStrategy), +/* harmony export */ rectSortingStrategy: () => (/* binding */ rectSortingStrategy), +/* harmony export */ rectSwappingStrategy: () => (/* binding */ rectSwappingStrategy), +/* harmony export */ sortableKeyboardCoordinates: () => (/* binding */ sortableKeyboardCoordinates), +/* harmony export */ useSortable: () => (/* binding */ useSortable), +/* harmony export */ verticalListSortingStrategy: () => (/* binding */ verticalListSortingStrategy) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dnd-kit/core */ "./node_modules/@dnd-kit/core/dist/core.esm.js"); +/* harmony import */ var _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dnd-kit/utilities */ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js"); + + + + +/** + * Move an array item to a different position. Returns a new array with the item moved to the new position. + */ +function arrayMove(array, from, to) { + const newArray = array.slice(); + newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); + return newArray; +} + +/** + * Swap an array item to a different position. Returns a new array with the item swapped to the new position. + */ +function arraySwap(array, from, to) { + const newArray = array.slice(); + newArray[from] = array[to]; + newArray[to] = array[from]; + return newArray; +} + +function getSortedRects(items, rects) { + return items.reduce((accumulator, id, index) => { + const rect = rects.get(id); + + if (rect) { + accumulator[index] = rect; + } + + return accumulator; + }, Array(items.length)); +} + +function isValidIndex(index) { + return index !== null && index >= 0; +} + +function itemsEqual(a, b) { + if (a === b) { + return true; + } + + if (a.length !== b.length) { + return false; + } + + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { + return false; + } + } + + return true; +} + +function normalizeDisabled(disabled) { + if (typeof disabled === 'boolean') { + return { + draggable: disabled, + droppable: disabled + }; + } + + return disabled; +} + +// To-do: We should be calculating scale transformation +const defaultScale = { + scaleX: 1, + scaleY: 1 +}; +const horizontalListSortingStrategy = _ref => { + var _rects$activeIndex; + + let { + rects, + activeNodeRect: fallbackActiveRect, + activeIndex, + overIndex, + index + } = _ref; + const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; + + if (!activeNodeRect) { + return null; + } + + const itemGap = getItemGap(rects, index, activeIndex); + + if (index === activeIndex) { + const newIndexRect = rects[overIndex]; + + if (!newIndexRect) { + return null; + } + + return { + x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left, + y: 0, + ...defaultScale + }; + } + + if (index > activeIndex && index <= overIndex) { + return { + x: -activeNodeRect.width - itemGap, + y: 0, + ...defaultScale + }; + } + + if (index < activeIndex && index >= overIndex) { + return { + x: activeNodeRect.width + itemGap, + y: 0, + ...defaultScale + }; + } + + return { + x: 0, + y: 0, + ...defaultScale + }; +}; + +function getItemGap(rects, index, activeIndex) { + const currentRect = rects[index]; + const previousRect = rects[index - 1]; + const nextRect = rects[index + 1]; + + if (!currentRect || !previousRect && !nextRect) { + return 0; + } + + if (activeIndex < index) { + return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width); + } + + return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width); +} + +const rectSortingStrategy = _ref => { + let { + rects, + activeIndex, + overIndex, + index + } = _ref; + const newRects = arrayMove(rects, overIndex, activeIndex); + const oldRect = rects[index]; + const newRect = newRects[index]; + + if (!newRect || !oldRect) { + return null; + } + + return { + x: newRect.left - oldRect.left, + y: newRect.top - oldRect.top, + scaleX: newRect.width / oldRect.width, + scaleY: newRect.height / oldRect.height + }; +}; + +const rectSwappingStrategy = _ref => { + let { + activeIndex, + index, + rects, + overIndex + } = _ref; + let oldRect; + let newRect; + + if (index === activeIndex) { + oldRect = rects[index]; + newRect = rects[overIndex]; + } + + if (index === overIndex) { + oldRect = rects[index]; + newRect = rects[activeIndex]; + } + + if (!newRect || !oldRect) { + return null; + } + + return { + x: newRect.left - oldRect.left, + y: newRect.top - oldRect.top, + scaleX: newRect.width / oldRect.width, + scaleY: newRect.height / oldRect.height + }; +}; + +// To-do: We should be calculating scale transformation +const defaultScale$1 = { + scaleX: 1, + scaleY: 1 +}; +const verticalListSortingStrategy = _ref => { + var _rects$activeIndex; + + let { + activeIndex, + activeNodeRect: fallbackActiveRect, + index, + rects, + overIndex + } = _ref; + const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; + + if (!activeNodeRect) { + return null; + } + + if (index === activeIndex) { + const overIndexRect = rects[overIndex]; + + if (!overIndexRect) { + return null; + } + + return { + x: 0, + y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, + ...defaultScale$1 + }; + } + + const itemGap = getItemGap$1(rects, index, activeIndex); + + if (index > activeIndex && index <= overIndex) { + return { + x: 0, + y: -activeNodeRect.height - itemGap, + ...defaultScale$1 + }; + } + + if (index < activeIndex && index >= overIndex) { + return { + x: 0, + y: activeNodeRect.height + itemGap, + ...defaultScale$1 + }; + } + + return { + x: 0, + y: 0, + ...defaultScale$1 + }; +}; + +function getItemGap$1(clientRects, index, activeIndex) { + const currentRect = clientRects[index]; + const previousRect = clientRects[index - 1]; + const nextRect = clientRects[index + 1]; + + if (!currentRect) { + return 0; + } + + if (activeIndex < index) { + return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; + } + + return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; +} + +const ID_PREFIX = 'Sortable'; +const Context = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({ + activeIndex: -1, + containerId: ID_PREFIX, + disableTransforms: false, + items: [], + overIndex: -1, + useDragOverlay: false, + sortedRects: [], + strategy: rectSortingStrategy, + disabled: { + draggable: false, + droppable: false + } +}); +function SortableContext(_ref) { + let { + children, + id, + items: userDefinedItems, + strategy = rectSortingStrategy, + disabled: disabledProp = false + } = _ref; + const { + active, + dragOverlay, + droppableRects, + over, + measureDroppableContainers + } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDndContext)(); + const containerId = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useUniqueId)(ID_PREFIX, id); + const useDragOverlay = Boolean(dragOverlay.rect !== null); + const items = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]); + const isDragging = active != null; + const activeIndex = active ? items.indexOf(active.id) : -1; + const overIndex = over ? items.indexOf(over.id) : -1; + const previousItemsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(items); + const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); + const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; + const disabled = normalizeDisabled(disabledProp); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (itemsHaveChanged && isDragging) { + measureDroppableContainers(items); + } + }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + previousItemsRef.current = items; + }, [items]); + const contextValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + activeIndex, + containerId, + disabled, + disableTransforms, + items, + overIndex, + useDragOverlay, + sortedRects: getSortedRects(items, droppableRects), + strategy + }), // eslint-disable-next-line react-hooks/exhaustive-deps + [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]); + return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Context.Provider, { + value: contextValue + }, children); +} + +const defaultNewIndexGetter = _ref => { + let { + id, + items, + activeIndex, + overIndex + } = _ref; + return arrayMove(items, activeIndex, overIndex).indexOf(id); +}; +const defaultAnimateLayoutChanges = _ref2 => { + let { + containerId, + isSorting, + wasDragging, + index, + items, + newIndex, + previousItems, + previousContainerId, + transition + } = _ref2; + + if (!transition || !wasDragging) { + return false; + } + + if (previousItems !== items && index === newIndex) { + return false; + } + + if (isSorting) { + return true; + } + + return newIndex !== index && containerId === previousContainerId; +}; +const defaultTransition = { + duration: 200, + easing: 'ease' +}; +const transitionProperty = 'transform'; +const disabledTransition = /*#__PURE__*/_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transition.toString({ + property: transitionProperty, + duration: 0, + easing: 'linear' +}); +const defaultAttributes = { + roleDescription: 'sortable' +}; + +/* + * When the index of an item changes while sorting, + * we need to temporarily disable the transforms + */ + +function useDerivedTransform(_ref) { + let { + disabled, + index, + node, + rect + } = _ref; + const [derivedTransform, setDerivedtransform] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null); + const previousIndex = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(index); + (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useIsomorphicLayoutEffect)(() => { + if (!disabled && index !== previousIndex.current && node.current) { + const initial = rect.current; + + if (initial) { + const current = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getClientRect)(node.current, { + ignoreTransform: true + }); + const delta = { + x: initial.left - current.left, + y: initial.top - current.top, + scaleX: initial.width / current.width, + scaleY: initial.height / current.height + }; + + if (delta.x || delta.y) { + setDerivedtransform(delta); + } + } + } + + if (index !== previousIndex.current) { + previousIndex.current = index; + } + }, [disabled, index, node, rect]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (derivedTransform) { + setDerivedtransform(null); + } + }, [derivedTransform]); + return derivedTransform; +} + +function useSortable(_ref) { + let { + animateLayoutChanges = defaultAnimateLayoutChanges, + attributes: userDefinedAttributes, + disabled: localDisabled, + data: customData, + getNewIndex = defaultNewIndexGetter, + id, + strategy: localStrategy, + resizeObserverConfig, + transition = defaultTransition + } = _ref; + const { + items, + containerId, + activeIndex, + disabled: globalDisabled, + disableTransforms, + sortedRects, + overIndex, + useDragOverlay, + strategy: globalStrategy + } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Context); + const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); + const index = items.indexOf(id); + const data = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({ + sortable: { + containerId, + index, + items + }, + ...customData + }), [containerId, customData, index, items]); + const itemsAfterCurrentSortable = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => items.slice(items.indexOf(id)), [items, id]); + const { + rect, + node, + isOver, + setNodeRef: setDroppableNodeRef + } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDroppable)({ + id, + data, + disabled: disabled.droppable, + resizeObserverConfig: { + updateMeasurementsFor: itemsAfterCurrentSortable, + ...resizeObserverConfig + } + }); + const { + active, + activatorEvent, + activeNodeRect, + attributes, + setNodeRef: setDraggableNodeRef, + listeners, + isDragging, + over, + setActivatorNodeRef, + transform + } = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.useDraggable)({ + id, + data, + attributes: { ...defaultAttributes, + ...userDefinedAttributes + }, + disabled: disabled.draggable + }); + const setNodeRef = (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.useCombinedRefs)(setDroppableNodeRef, setDraggableNodeRef); + const isSorting = Boolean(active); + const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); + const shouldDisplaceDragSource = !useDragOverlay && isDragging; + const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; + const strategy = localStrategy != null ? localStrategy : globalStrategy; + const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ + rects: sortedRects, + activeNodeRect, + activeIndex, + overIndex, + index + }) : null; + const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ + id, + items, + activeIndex, + overIndex + }) : index; + const activeId = active == null ? void 0 : active.id; + const previous = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({ + activeId, + items, + newIndex, + containerId + }); + const itemsHaveChanged = items !== previous.current.items; + const shouldAnimateLayoutChanges = animateLayoutChanges({ + active, + containerId, + isDragging, + isSorting, + id, + index, + items, + newIndex: previous.current.newIndex, + previousItems: previous.current.items, + previousContainerId: previous.current.containerId, + transition, + wasDragging: previous.current.activeId != null + }); + const derivedTransform = useDerivedTransform({ + disabled: !shouldAnimateLayoutChanges, + index, + node, + rect + }); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (isSorting && previous.current.newIndex !== newIndex) { + previous.current.newIndex = newIndex; + } + + if (containerId !== previous.current.containerId) { + previous.current.containerId = containerId; + } + + if (items !== previous.current.items) { + previous.current.items = items; + } + }, [isSorting, newIndex, containerId, items]); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + if (activeId === previous.current.activeId) { + return; + } + + if (activeId && !previous.current.activeId) { + previous.current.activeId = activeId; + return; + } + + const timeoutId = setTimeout(() => { + previous.current.activeId = activeId; + }, 50); + return () => clearTimeout(timeoutId); + }, [activeId]); + return { + active, + activeIndex, + attributes, + data, + rect, + index, + newIndex, + items, + isOver, + isSorting, + isDragging, + listeners, + node, + overIndex, + over, + setNodeRef, + setActivatorNodeRef, + setDroppableNodeRef, + setDraggableNodeRef, + transform: derivedTransform != null ? derivedTransform : finalTransform, + transition: getTransition() + }; + + function getTransition() { + if ( // Temporarily disable transitions for a single frame to set up derived transforms + derivedTransform || // Or to prevent items jumping to back to their "new" position when items change + itemsHaveChanged && previous.current.newIndex === index) { + return disabledTransition; + } + + if (shouldDisplaceDragSource && !(0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.isKeyboardEvent)(activatorEvent) || !transition) { + return undefined; + } + + if (isSorting || shouldAnimateLayoutChanges) { + return _dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.CSS.Transition.toString({ ...transition, + property: transitionProperty + }); + } + + return undefined; + } +} + +function normalizeLocalDisabled(localDisabled, globalDisabled) { + var _localDisabled$dragga, _localDisabled$droppa; + + if (typeof localDisabled === 'boolean') { + return { + draggable: localDisabled, + // Backwards compatibility + droppable: false + }; + } + + return { + draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, + droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable + }; +} + +function hasSortableData(entry) { + if (!entry) { + return false; + } + + const data = entry.data.current; + + if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) { + return true; + } + + return false; +} + +const directions = [_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Down, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Right, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Up, _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Left]; +const sortableKeyboardCoordinates = (event, _ref) => { + let { + context: { + active, + collisionRect, + droppableRects, + droppableContainers, + over, + scrollableAncestors + } + } = _ref; + + if (directions.includes(event.code)) { + event.preventDefault(); + + if (!active || !collisionRect) { + return; + } + + const filteredContainers = []; + droppableContainers.getEnabled().forEach(entry => { + if (!entry || entry != null && entry.disabled) { + return; + } + + const rect = droppableRects.get(entry.id); + + if (!rect) { + return; + } + + switch (event.code) { + case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Down: + if (collisionRect.top < rect.top) { + filteredContainers.push(entry); + } + + break; + + case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Up: + if (collisionRect.top > rect.top) { + filteredContainers.push(entry); + } + + break; + + case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Left: + if (collisionRect.left > rect.left) { + filteredContainers.push(entry); + } + + break; + + case _dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.KeyboardCode.Right: + if (collisionRect.left < rect.left) { + filteredContainers.push(entry); + } + + break; + } + }); + const collisions = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.closestCorners)({ + active, + collisionRect: collisionRect, + droppableRects, + droppableContainers: filteredContainers, + pointerCoordinates: null + }); + let closestId = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getFirstCollision)(collisions, 'id'); + + if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { + closestId = collisions[1].id; + } + + if (closestId != null) { + const activeDroppable = droppableContainers.get(active.id); + const newDroppable = droppableContainers.get(closestId); + const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; + const newNode = newDroppable == null ? void 0 : newDroppable.node.current; + + if (newNode && newRect && activeDroppable && newDroppable) { + const newScrollAncestors = (0,_dnd_kit_core__WEBPACK_IMPORTED_MODULE_1__.getScrollableAncestors)(newNode); + const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); + const hasSameContainer = isSameContainer(activeDroppable, newDroppable); + const isAfterActive = isAfter(activeDroppable, newDroppable); + const offset = hasDifferentScrollAncestors || !hasSameContainer ? { + x: 0, + y: 0 + } : { + x: isAfterActive ? collisionRect.width - newRect.width : 0, + y: isAfterActive ? collisionRect.height - newRect.height : 0 + }; + const rectCoordinates = { + x: newRect.left, + y: newRect.top + }; + const newCoordinates = offset.x && offset.y ? rectCoordinates : (0,_dnd_kit_utilities__WEBPACK_IMPORTED_MODULE_2__.subtract)(rectCoordinates, offset); + return newCoordinates; + } + } + } + + return undefined; +}; + +function isSameContainer(a, b) { + if (!hasSortableData(a) || !hasSortableData(b)) { + return false; + } + + return a.data.current.sortable.containerId === b.data.current.sortable.containerId; +} + +function isAfter(a, b) { + if (!hasSortableData(a) || !hasSortableData(b)) { + return false; + } + + if (!isSameContainer(a, b)) { + return false; + } + + return a.data.current.sortable.index < b.data.current.sortable.index; +} + + +//# sourceMappingURL=sortable.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@dnd-kit/utilities/dist/utilities.esm.js": +/*!***************************************************************!*\ + !*** ./node_modules/@dnd-kit/utilities/dist/utilities.esm.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CSS: () => (/* binding */ CSS), +/* harmony export */ add: () => (/* binding */ add), +/* harmony export */ canUseDOM: () => (/* binding */ canUseDOM), +/* harmony export */ findFirstFocusableNode: () => (/* binding */ findFirstFocusableNode), +/* harmony export */ getEventCoordinates: () => (/* binding */ getEventCoordinates), +/* harmony export */ getOwnerDocument: () => (/* binding */ getOwnerDocument), +/* harmony export */ getWindow: () => (/* binding */ getWindow), +/* harmony export */ hasViewportRelativeCoordinates: () => (/* binding */ hasViewportRelativeCoordinates), +/* harmony export */ isDocument: () => (/* binding */ isDocument), +/* harmony export */ isHTMLElement: () => (/* binding */ isHTMLElement), +/* harmony export */ isKeyboardEvent: () => (/* binding */ isKeyboardEvent), +/* harmony export */ isNode: () => (/* binding */ isNode), +/* harmony export */ isSVGElement: () => (/* binding */ isSVGElement), +/* harmony export */ isTouchEvent: () => (/* binding */ isTouchEvent), +/* harmony export */ isWindow: () => (/* binding */ isWindow), +/* harmony export */ subtract: () => (/* binding */ subtract), +/* harmony export */ useCombinedRefs: () => (/* binding */ useCombinedRefs), +/* harmony export */ useEvent: () => (/* binding */ useEvent), +/* harmony export */ useInterval: () => (/* binding */ useInterval), +/* harmony export */ useIsomorphicLayoutEffect: () => (/* binding */ useIsomorphicLayoutEffect), +/* harmony export */ useLatestValue: () => (/* binding */ useLatestValue), +/* harmony export */ useLazyMemo: () => (/* binding */ useLazyMemo), +/* harmony export */ useNodeRef: () => (/* binding */ useNodeRef), +/* harmony export */ usePrevious: () => (/* binding */ usePrevious), +/* harmony export */ useUniqueId: () => (/* binding */ useUniqueId) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +function useCombinedRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => node => { + refs.forEach(ref => ref(node)); + }, // eslint-disable-next-line react-hooks/exhaustive-deps + refs); +} + +// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js +const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; + +function isWindow(element) { + const elementString = Object.prototype.toString.call(element); + return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] + elementString === '[object global]'; +} + +function isNode(node) { + return 'nodeType' in node; +} + +function getWindow(target) { + var _target$ownerDocument, _target$ownerDocument2; + + if (!target) { + return window; + } + + if (isWindow(target)) { + return target; + } + + if (!isNode(target)) { + return window; + } + + return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; +} + +function isDocument(node) { + const { + Document + } = getWindow(node); + return node instanceof Document; +} + +function isHTMLElement(node) { + if (isWindow(node)) { + return false; + } + + return node instanceof getWindow(node).HTMLElement; +} + +function isSVGElement(node) { + return node instanceof getWindow(node).SVGElement; +} + +function getOwnerDocument(target) { + if (!target) { + return document; + } + + if (isWindow(target)) { + return target.document; + } + + if (!isNode(target)) { + return document; + } + + if (isDocument(target)) { + return target; + } + + if (isHTMLElement(target) || isSVGElement(target)) { + return target.ownerDocument; + } + + return document; +} + +/** + * A hook that resolves to useEffect on the server and useLayoutEffect on the client + * @param callback {function} Callback function that is invoked when the dependencies of the hook change + */ + +const useIsomorphicLayoutEffect = canUseDOM ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; + +function useEvent(handler) { + const handlerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handler); + useIsomorphicLayoutEffect(() => { + handlerRef.current = handler; + }); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return handlerRef.current == null ? void 0 : handlerRef.current(...args); + }, []); +} + +function useInterval() { + const intervalRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const set = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((listener, duration) => { + intervalRef.current = setInterval(listener, duration); + }, []); + const clear = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => { + if (intervalRef.current !== null) { + clearInterval(intervalRef.current); + intervalRef.current = null; + } + }, []); + return [set, clear]; +} + +function useLatestValue(value, dependencies) { + if (dependencies === void 0) { + dependencies = [value]; + } + + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value); + useIsomorphicLayoutEffect(() => { + if (valueRef.current !== value) { + valueRef.current = value; + } + }, dependencies); + return valueRef; +} + +function useLazyMemo(callback, dependencies) { + const valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + const newValue = callback(valueRef.current); + valueRef.current = newValue; + return newValue; + }, // eslint-disable-next-line react-hooks/exhaustive-deps + [...dependencies]); +} + +function useNodeRef(onChange) { + const onChangeHandler = useEvent(onChange); + const node = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); + const setNodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(element => { + if (element !== node.current) { + onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); + } + + node.current = element; + }, //eslint-disable-next-line + []); + return [node, setNodeRef]; +} + +function usePrevious(value) { + const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); + (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + ref.current = value; + }, [value]); + return ref.current; +} + +let ids = {}; +function useUniqueId(prefix, value) { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => { + if (value) { + return value; + } + + const id = ids[prefix] == null ? 0 : ids[prefix] + 1; + ids[prefix] = id; + return prefix + "-" + id; + }, [prefix, value]); +} + +function createAdjustmentFn(modifier) { + return function (object) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + + return adjustments.reduce((accumulator, adjustment) => { + const entries = Object.entries(adjustment); + + for (const [key, valueAdjustment] of entries) { + const value = accumulator[key]; + + if (value != null) { + accumulator[key] = value + modifier * valueAdjustment; + } + } + + return accumulator; + }, { ...object + }); + }; +} + +const add = /*#__PURE__*/createAdjustmentFn(1); +const subtract = /*#__PURE__*/createAdjustmentFn(-1); + +function hasViewportRelativeCoordinates(event) { + return 'clientX' in event && 'clientY' in event; +} + +function isKeyboardEvent(event) { + if (!event) { + return false; + } + + const { + KeyboardEvent + } = getWindow(event.target); + return KeyboardEvent && event instanceof KeyboardEvent; +} + +function isTouchEvent(event) { + if (!event) { + return false; + } + + const { + TouchEvent + } = getWindow(event.target); + return TouchEvent && event instanceof TouchEvent; +} + +/** + * Returns the normalized x and y coordinates for mouse and touch events. + */ + +function getEventCoordinates(event) { + if (isTouchEvent(event)) { + if (event.touches && event.touches.length) { + const { + clientX: x, + clientY: y + } = event.touches[0]; + return { + x, + y + }; + } else if (event.changedTouches && event.changedTouches.length) { + const { + clientX: x, + clientY: y + } = event.changedTouches[0]; + return { + x, + y + }; + } + } + + if (hasViewportRelativeCoordinates(event)) { + return { + x: event.clientX, + y: event.clientY + }; + } + + return null; +} + +const CSS = /*#__PURE__*/Object.freeze({ + Translate: { + toString(transform) { + if (!transform) { + return; + } + + const { + x, + y + } = transform; + return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; + } + + }, + Scale: { + toString(transform) { + if (!transform) { + return; + } + + const { + scaleX, + scaleY + } = transform; + return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; + } + + }, + Transform: { + toString(transform) { + if (!transform) { + return; + } + + return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' '); + } + + }, + Transition: { + toString(_ref) { + let { + property, + duration, + easing + } = _ref; + return property + " " + duration + "ms " + easing; + } + + } +}); + +const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; +function findFirstFocusableNode(element) { + if (element.matches(SELECTOR)) { + return element; + } + + return element.querySelector(SELECTOR); +} + + +//# sourceMappingURL=utilities.esm.js.map + + +/***/ }), + +/***/ "./node_modules/@emotion/cache/dist/emotion-cache.browser.development.esm.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@emotion/cache/dist/emotion-cache.browser.development.esm.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ createCache) +/* harmony export */ }); +/* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/emotion-sheet.development.esm.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Tokenizer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Utility.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Enum.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Serializer.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Middleware.js"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! stylis */ "./node_modules/stylis/src/Parser.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + + + + +var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { + var previous = 0; + var character = 0; + + while (true) { + previous = character; + character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)(); // &\f + + if (previous === 38 && character === 12) { + points[index] = 1; + } + + if ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + break; + } + + (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)(); + } + + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.slice)(begin, stylis__WEBPACK_IMPORTED_MODULE_3__.position); +}; + +var toRules = function toRules(parsed, points) { + // pretend we've started with a comma + var index = -1; + var character = 44; + + do { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_3__.token)(character)) { + case 0: + // &\f + if (character === 38 && (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 12) { + // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings + // stylis inserts \f after & to know when & where it should replace this sequence with the context selector + // and when it should just concatenate the outer and inner selectors + // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here + points[index] = 1; + } + + parsed[index] += identifierWithPointTracking(stylis__WEBPACK_IMPORTED_MODULE_3__.position - 1, points, index); + break; + + case 2: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_3__.delimit)(character); + break; + + case 4: + // comma + if (character === 44) { + // colon + parsed[++index] = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.peek)() === 58 ? '&\f' : ''; + points[index] = parsed[index].length; + break; + } + + // fallthrough + + default: + parsed[index] += (0,stylis__WEBPACK_IMPORTED_MODULE_4__.from)(character); + } + } while (character = (0,stylis__WEBPACK_IMPORTED_MODULE_3__.next)()); + + return parsed; +}; + +var getRules = function getRules(value, points) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_3__.dealloc)(toRules((0,stylis__WEBPACK_IMPORTED_MODULE_3__.alloc)(value), points)); +}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 + + +var fixedElements = /* #__PURE__ */new WeakMap(); +var compat = function compat(element) { + if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo + // negative .length indicates that this rule has been already prefixed + element.length < 1) { + return; + } + + var value = element.value; + var parent = element.parent; + var isImplicitRule = element.column === parent.column && element.line === parent.line; + + while (parent.type !== 'rule') { + parent = parent.parent; + if (!parent) return; + } // short-circuit for the simplest case + + + if (element.props.length === 1 && value.charCodeAt(0) !== 58 + /* colon */ + && !fixedElements.get(parent)) { + return; + } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) + // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" + + + if (isImplicitRule) { + return; + } + + fixedElements.set(element, true); + var points = []; + var rules = getRules(value, points); + var parentRules = parent.props; + + for (var i = 0, k = 0; i < rules.length; i++) { + for (var j = 0; j < parentRules.length; j++, k++) { + element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; + } + } +}; +var removeLabel = function removeLabel(element) { + if (element.type === 'decl') { + var value = element.value; + + if ( // charcode for l + value.charCodeAt(0) === 108 && // charcode for b + value.charCodeAt(2) === 98) { + // this ignores label + element["return"] = ''; + element.value = ''; + } + } +}; +var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; + +var isIgnoringComment = function isIgnoringComment(element) { + return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; +}; + +var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { + return function (element, index, children) { + if (element.type !== 'rule' || cache.compat) return; + var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); + + if (unsafePseudoClasses) { + var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` + // + // considering this input: + // .a { + // .b /* comm */ {} + // color: hotpink; + // } + // we get output corresponding to this: + // .a { + // & { + // /* comm */ + // color: hotpink; + // } + // .b {} + // } + + var commentContainer = isNested ? element.parent.children : // global rule at the root level + children; + + for (var i = commentContainer.length - 1; i >= 0; i--) { + var node = commentContainer[i]; + + if (node.line < element.line) { + break; + } // it is quite weird but comments are *usually* put at `column: element.column - 1` + // so we seek *from the end* for the node that is earlier than the rule's `element` and check that + // this will also match inputs like this: + // .a { + // /* comm */ + // .b {} + // } + // + // but that is fine + // + // it would be the easiest to change the placement of the comment to be the first child of the rule: + // .a { + // .b { /* comm */ } + // } + // with such inputs we wouldn't have to search for the comment at all + // TODO: consider changing this comment placement in the next major version + + + if (node.column < element.column) { + if (isIgnoringComment(node)) { + return; + } + + break; + } + } + + unsafePseudoClasses.forEach(function (unsafePseudoClass) { + console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); + }); + } + }; +}; + +var isImportRule = function isImportRule(element) { + return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; +}; + +var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { + for (var i = index - 1; i >= 0; i--) { + if (!isImportRule(children[i])) { + return true; + } + } + + return false; +}; // use this to remove incorrect elements from further processing +// so they don't get handed to the `sheet` (or anything else) +// as that could potentially lead to additional logs which in turn could be overhelming to the user + + +var nullifyElement = function nullifyElement(element) { + element.type = ''; + element.value = ''; + element["return"] = ''; + element.children = ''; + element.props = ''; +}; + +var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { + if (!isImportRule(element)) { + return; + } + + if (element.parent) { + console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); + nullifyElement(element); + } else if (isPrependedWithRegularRules(index, children)) { + console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); + nullifyElement(element); + } +}; + +/* eslint-disable no-fallthrough */ + +function prefix(value, length) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.hash)(value, length)) { + // color-adjust + case 5103: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'print-' + value + value; + // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) + + case 5737: + case 4201: + case 3177: + case 3433: + case 1641: + case 4457: + case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break + + case 5572: + case 6356: + case 5844: + case 3191: + case 6645: + case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, + + case 6391: + case 5879: + case 5623: + case 6135: + case 4599: + case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) + + case 4215: + case 6389: + case 5109: + case 5365: + case 5621: + case 3829: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // appearance, user-select, transform, hyphens, text-size-adjust + + case 5349: + case 4246: + case 4810: + case 6968: + case 2756: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // flex, flex-direction + + case 6828: + case 4268: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + // order + + case 6165: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-' + value + value; + // align-items + + case 5187: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(\w+).+(:[^]+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-$1$2' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-$1$2') + value; + // align-self + + case 5443: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-item-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /flex-|-self/, '') + value; + // align-content + + case 4675: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-line-pack' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /align-content|flex-|-self/, '') + value; + // flex-shrink + + case 5548: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'shrink', 'negative') + value; + // flex-basis + + case 5292: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'basis', 'preferred-size') + value; + // flex-grow + + case 6060: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-' + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, '-grow', '') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'grow', 'positive') + value; + // transition + + case 4554: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /([^-])(transform)/g, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2') + value; + // cursor + + case 6187: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(zoom-|grab)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), /(image-set)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1'), value, '') + value; + // background, background-image + + case 5495: + case 3959: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(image-set\([^]*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1' + '$`$1'); + // justify-content + + case 4968: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(flex-)?(.*)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'box-pack:$3' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + value; + // (margin|padding)-inline-(start|end) + + case 4095: + case 3583: + case 4068: + case 2532: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+)-inline(.+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$1$2') + value; + // (min|max)?(width|height|inline-size|block-size) + + case 8116: + case 7059: + case 5753: + case 5535: + case 5445: + case 5701: + case 4933: + case 4677: + case 5533: + case 5789: + case 5021: + case 4765: + // stretch, max-content, min-content, fill-available + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 1 - length > 6) switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1)) { + // (m)ax-content, (m)in-content + case 109: + // - + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 4) !== 45) break; + // (f)ill-available, (f)it-content + + case 102: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)(.+)-([^]+)/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2-$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; + // (s)tretch + + case 115: + return ~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, 'stretch') ? prefix((0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, 'stretch', 'fill-available'), length) + value : value; + } + break; + // position: sticky + + case 4949: + // (s)ticky? + if ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 1) !== 115) break; + // display: (flex|inline-flex) + + case 6444: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, (0,stylis__WEBPACK_IMPORTED_MODULE_4__.strlen)(value) - 3 - (~(0,stylis__WEBPACK_IMPORTED_MODULE_4__.indexof)(value, '!important') && 10))) { + // stic(k)y + case 107: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, ':', ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + value; + // (inline-)?fl(e)x + + case 101: + return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + '$2$3' + '$1' + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + '$2box$3') + value; + } + + break; + // writing-mode + + case 5936: + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.charat)(value, length + 11)) { + // vertical-l(r) + case 114: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; + // vertical-r(l) + + case 108: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; + // horizontal(-)tb + + case 45: + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; + } + + return stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + value + stylis__WEBPACK_IMPORTED_MODULE_5__.MS + value + value; + } + + return value; +} + +var prefixer = function prefixer(element, index, children, callback) { + if (element.length > -1) if (!element["return"]) switch (element.type) { + case stylis__WEBPACK_IMPORTED_MODULE_5__.DECLARATION: + element["return"] = prefix(element.value, element.length); + break; + + case stylis__WEBPACK_IMPORTED_MODULE_5__.KEYFRAMES: + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + value: (0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(element.value, '@', '@' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT) + })], callback); + + case stylis__WEBPACK_IMPORTED_MODULE_5__.RULESET: + if (element.length) return (0,stylis__WEBPACK_IMPORTED_MODULE_4__.combine)(element.props, function (value) { + switch ((0,stylis__WEBPACK_IMPORTED_MODULE_4__.match)(value, /(::plac\w+|:read-\w+)/)) { + // :read-(only|write) + case ':read-only': + case ':read-write': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(read-\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + })], callback); + // :placeholder + + case '::placeholder': + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)([(0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.WEBKIT + 'input-$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, ':' + stylis__WEBPACK_IMPORTED_MODULE_5__.MOZ + '$1')] + }), (0,stylis__WEBPACK_IMPORTED_MODULE_3__.copy)(element, { + props: [(0,stylis__WEBPACK_IMPORTED_MODULE_4__.replace)(value, /:(plac\w+)/, stylis__WEBPACK_IMPORTED_MODULE_5__.MS + 'input-$1')] + })], callback); + } + + return ''; + }); + } +}; + +var defaultStylisPlugins = [prefixer]; +var getSourceMap; + +{ + var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; + + getSourceMap = function getSourceMap(styles) { + var matches = styles.match(sourceMapPattern); + if (!matches) return; + return matches[matches.length - 1]; + }; +} + +var createCache = function createCache(options) { + var key = options.key; + + if (!key) { + throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements."); + } + + if (key === 'css') { + var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration + // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) + // note this very very intentionally targets all style elements regardless of the key to ensure + // that creating a cache works inside of render of a React component + + Array.prototype.forEach.call(ssrStyles, function (node) { + // we want to only move elements which have a space in the data-emotion attribute value + // because that indicates that it is an Emotion 11 server-side rendered style elements + // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector + // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) + // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles + // will not result in the Emotion 10 styles being destroyed + var dataEmotionAttribute = node.getAttribute('data-emotion'); + + if (dataEmotionAttribute.indexOf(' ') === -1) { + return; + } + + document.head.appendChild(node); + node.setAttribute('data-s', ''); + }); + } + + var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; + + { + if (/[^a-z-]/.test(key)) { + throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed"); + } + } + + var inserted = {}; + var container; + var nodesToHydrate = []; + + { + container = options.container || document.head; + Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which + // means that the style elements we're looking at are only Emotion 11 server-rendered style elements + document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { + var attrib = node.getAttribute("data-emotion").split(' '); + + for (var i = 1; i < attrib.length; i++) { + inserted[attrib[i]] = true; + } + + nodesToHydrate.push(node); + }); + } + + var _insert; + + var omnipresentPlugins = [compat, removeLabel]; + + { + omnipresentPlugins.push(createUnsafeSelectorsAlarm({ + get compat() { + return cache.compat; + } + + }), incorrectImportAlarm); + } + + { + var currentSheet; + var finalizingPlugins = [stylis__WEBPACK_IMPORTED_MODULE_6__.stringify, function (element) { + if (!element.root) { + if (element["return"]) { + currentSheet.insert(element["return"]); + } else if (element.value && element.type !== stylis__WEBPACK_IMPORTED_MODULE_5__.COMMENT) { + // insert empty rule in non-production environments + // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet + currentSheet.insert(element.value + "{}"); + } + } + } ]; + var serializer = (0,stylis__WEBPACK_IMPORTED_MODULE_7__.middleware)(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); + + var stylis = function stylis(styles) { + return (0,stylis__WEBPACK_IMPORTED_MODULE_6__.serialize)((0,stylis__WEBPACK_IMPORTED_MODULE_8__.compile)(styles), serializer); + }; + + _insert = function insert(selector, serialized, sheet, shouldCache) { + currentSheet = sheet; + + if (getSourceMap) { + var sourceMap = getSourceMap(serialized.styles); + + if (sourceMap) { + currentSheet = { + insert: function insert(rule) { + sheet.insert(rule + sourceMap); + } + }; + } + } + + stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); + + if (shouldCache) { + cache.inserted[serialized.name] = true; + } + }; + } + + var cache = { + key: key, + sheet: new _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__.StyleSheet({ + key: key, + container: container, + nonce: options.nonce, + speedy: options.speedy, + prepend: options.prepend, + insertionPoint: options.insertionPoint + }), + nonce: options.nonce, + inserted: inserted, + registered: {}, + insert: _insert + }; + cache.sheet.hydrate(nodesToHydrate); + return cache; +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/hash/dist/emotion-hash.esm.js": +/*!*************************************************************!*\ + !*** ./node_modules/@emotion/hash/dist/emotion-hash.esm.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ murmur2) +/* harmony export */ }); +/* eslint-disable */ +// Inspired by https://github.com/garycourt/murmurhash-js +// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 +function murmur2(str) { + // 'm' and 'r' are mixing constants generated offline. + // They're not really 'magic', they just happen to work well. + // const m = 0x5bd1e995; + // const r = 24; + // Initialize the hash + var h = 0; // Mix 4 bytes at a time into the hash + + var k, + i = 0, + len = str.length; + + for (; len >= 4; ++i, len -= 4) { + k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; + k = + /* Math.imul(k, m): */ + (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); + k ^= + /* k >>> r: */ + k >>> 24; + h = + /* Math.imul(k, m): */ + (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + } // Handle the last few bytes of the input array + + + switch (len) { + case 3: + h ^= (str.charCodeAt(i + 2) & 0xff) << 16; + + case 2: + h ^= (str.charCodeAt(i + 1) & 0xff) << 8; + + case 1: + h ^= str.charCodeAt(i) & 0xff; + h = + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + } // Do a few final mixes of the hash to ensure the last few + // bytes are well-incorporated. + + + h ^= h >>> 13; + h = + /* Math.imul(h, m): */ + (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); + return ((h ^ h >>> 15) >>> 0).toString(36); +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ isPropValid) +/* harmony export */ }); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + +// eslint-disable-next-line no-undef +var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 + +var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) { + return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 + /* o */ + && prop.charCodeAt(1) === 110 + /* n */ + && prop.charCodeAt(2) < 91; +} +/* Z+1 */ +); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ memoize) +/* harmony export */ }); +function memoize(fn) { + var cache = Object.create(null); + return function (arg) { + if (cache[arg] === undefined) cache[arg] = fn(arg); + return cache[arg]; + }; +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js": +/*!*****************************************************************************************************************!*\ + !*** ./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js ***! + \*****************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ hoistNonReactStatics) +/* harmony export */ }); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0__); + + +// this file isolates this package that is not tree-shakeable +// and if this module doesn't actually contain any logic of its own +// then Rollup just use 'hoist-non-react-statics' directly in other chunks + +var hoistNonReactStatics = (function (targetComponent, sourceComponent) { + return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_0___default()(targetComponent, sourceComponent); +}); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: () => (/* binding */ CacheProvider), +/* harmony export */ E: () => (/* binding */ Emotion$1), +/* harmony export */ T: () => (/* binding */ ThemeContext), +/* harmony export */ _: () => (/* binding */ __unsafe_useEmotionCache), +/* harmony export */ a: () => (/* binding */ ThemeProvider), +/* harmony export */ b: () => (/* binding */ withTheme), +/* harmony export */ c: () => (/* binding */ createEmotionProps), +/* harmony export */ h: () => (/* binding */ hasOwn), +/* harmony export */ u: () => (/* binding */ useTheme), +/* harmony export */ w: () => (/* binding */ withEmotionCache) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/emotion-cache.browser.development.esm.js"); +/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var _isolated_hnrs_dist_emotion_react_isolated_hnrs_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js */ "./node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js"); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); + + + + + + + + + + +var EmotionCacheContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case +// because this module is primarily intended for the browser and node +// but it's also required in react native and similar environments sometimes +// and we could have a special build just for that +// but this is much easier and the native packages +// might use a different theme context in the future anyway +typeof HTMLElement !== 'undefined' ? /* #__PURE__ */(0,_emotion_cache__WEBPACK_IMPORTED_MODULE_1__["default"])({ + key: 'css' +}) : null); + +{ + EmotionCacheContext.displayName = 'EmotionCacheContext'; +} + +var CacheProvider = EmotionCacheContext.Provider; +var __unsafe_useEmotionCache = function useEmotionCache() { + return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext); +}; + +var withEmotionCache = function withEmotionCache(func) { + return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) { + // the cache will never be null in the browser + var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext); + return func(props, cache, ref); + }); +}; + +var ThemeContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.createContext({}); + +{ + ThemeContext.displayName = 'EmotionThemeContext'; +} + +var useTheme = function useTheme() { + return react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); +}; + +var getTheme = function getTheme(outerTheme, theme) { + if (typeof theme === 'function') { + var mergedTheme = theme(outerTheme); + + if ((mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) { + throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!'); + } + + return mergedTheme; + } + + if ((theme == null || typeof theme !== 'object' || Array.isArray(theme))) { + throw new Error('[ThemeProvider] Please make your theme prop a plain object'); + } + + return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__["default"])({}, outerTheme, theme); +}; + +var createCacheWithTheme = /* #__PURE__ */(0,_emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__["default"])(function (outerTheme) { + return (0,_emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_3__["default"])(function (theme) { + return getTheme(outerTheme, theme); + }); +}); +var ThemeProvider = function ThemeProvider(props) { + var theme = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); + + if (props.theme !== theme) { + theme = createCacheWithTheme(theme)(props.theme); + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ThemeContext.Provider, { + value: theme + }, props.children); +}; +function withTheme(Component) { + var componentName = Component.displayName || Component.name || 'Component'; + var WithTheme = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function render(props, ref) { + var theme = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext); + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__["default"])({ + theme: theme, + ref: ref + }, props)); + }); + WithTheme.displayName = "WithTheme(" + componentName + ")"; + return (0,_isolated_hnrs_dist_emotion_react_isolated_hnrs_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_7__["default"])(WithTheme, Component); +} + +var hasOwn = {}.hasOwnProperty; + +var getLastPart = function getLastPart(functionName) { + // The match may be something like 'Object.createEmotionProps' or + // 'Loader.prototype.render' + var parts = functionName.split('.'); + return parts[parts.length - 1]; +}; + +var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { + // V8 + var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); + if (match) return getLastPart(match[1]); // Safari / Firefox + + match = /^([A-Za-z0-9$.]+)@/.exec(line); + if (match) return getLastPart(match[1]); + return undefined; +}; + +var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS +// identifiers, thus we only need to replace what is a valid character for JS, +// but not for CSS. + +var sanitizeIdentifier = function sanitizeIdentifier(identifier) { + return identifier.replace(/\$/g, '-'); +}; + +var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { + if (!stackTrace) return undefined; + var lines = stackTrace.split('\n'); + + for (var i = 0; i < lines.length; i++) { + var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" + + if (!functionName) continue; // If we reach one of these, we have gone too far and should quit + + if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an + // uppercase letter + + if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); + } + + return undefined; +}; + +var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; +var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; +var createEmotionProps = function createEmotionProps(type, props) { + if (typeof props.css === 'string' && // check if there is a css declaration + props.css.indexOf(':') !== -1) { + throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`"); + } + + var newProps = {}; + + for (var _key in props) { + if (hasOwn.call(props, _key)) { + newProps[_key] = props[_key]; + } + } + + newProps[typePropName] = type; // Runtime labeling is an opt-in feature because: + // - It causes hydration warnings when using Safari and SSR + // - It can degrade performance if there are a huge number of elements + // + // Even if the flag is set, we still don't compute the label if it has already + // been determined by the Babel plugin. + + if (typeof globalThis !== 'undefined' && !!globalThis.EMOTION_RUNTIME_AUTO_LABEL && !!props.css && (typeof props.css !== 'object' || !('name' in props.css) || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) { + var label = getLabelFromStackTrace(new Error().stack); + if (label) newProps[labelPropName] = label; + } + + return newProps; +}; + +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serialized = _ref.serialized, + isStringTag = _ref.isStringTag; + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.registerStyles)(cache, serialized, isStringTag); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_6__.useInsertionEffectAlwaysWithSyncFallback)(function () { + return (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.insertStyles)(cache, serialized, isStringTag); + }); + + return null; +}; + +var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) { + var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works + // not passing the registered cache to serializeStyles because it would + // make certain babel optimisations not possible + + if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { + cssProp = cache.registered[cssProp]; + } + + var WrappedComponent = props[typePropName]; + var registeredStyles = [cssProp]; + var className = ''; + + if (typeof props.className === 'string') { + className = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__.getRegisteredStyles)(cache.registered, registeredStyles, props.className); + } else if (props.className != null) { + className = props.className + " "; + } + + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)(registeredStyles, undefined, react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext)); + + if (serialized.name.indexOf('-') === -1) { + var labelFromStack = props[labelPropName]; + + if (labelFromStack) { + serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)([serialized, 'label:' + labelFromStack + ';']); + } + } + + className += cache.key + "-" + serialized.name; + var newProps = {}; + + for (var _key2 in props) { + if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (_key2 !== labelPropName)) { + newProps[_key2] = props[_key2]; + } + } + + newProps.className = className; + + if (ref) { + newProps.ref = ref; + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Insertion, { + cache: cache, + serialized: serialized, + isStringTag: typeof WrappedComponent === 'string' + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(WrappedComponent, newProps)); +}); + +{ + Emotion.displayName = 'EmotionCssPropInternal'; +} + +var Emotion$1 = Emotion; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/react/dist/emotion-react.browser.development.esm.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@emotion/react/dist/emotion-react.browser.development.esm.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CacheProvider: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.C), +/* harmony export */ ClassNames: () => (/* binding */ ClassNames), +/* harmony export */ Global: () => (/* binding */ Global), +/* harmony export */ ThemeContext: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.T), +/* harmony export */ ThemeProvider: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.a), +/* harmony export */ __unsafe_useEmotionCache: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__._), +/* harmony export */ createElement: () => (/* binding */ jsx), +/* harmony export */ css: () => (/* binding */ css), +/* harmony export */ jsx: () => (/* binding */ jsx), +/* harmony export */ keyframes: () => (/* binding */ keyframes), +/* harmony export */ useTheme: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.u), +/* harmony export */ withEmotionCache: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.w), +/* harmony export */ withTheme: () => (/* reexport safe */ _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.b) +/* harmony export */ }); +/* harmony import */ var _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emotion-element-489459f2.browser.development.esm.js */ "./node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js"); +/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/emotion-cache.browser.development.esm.js"); +/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"); +/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_8__); + + + + + + + + + + + + +var isDevelopment = true; + +var pkg = { + name: "@emotion/react", + version: "11.14.0", + main: "dist/emotion-react.cjs.js", + module: "dist/emotion-react.esm.js", + types: "dist/emotion-react.cjs.d.ts", + exports: { + ".": { + types: { + "import": "./dist/emotion-react.cjs.mjs", + "default": "./dist/emotion-react.cjs.js" + }, + development: { + "edge-light": { + module: "./dist/emotion-react.development.edge-light.esm.js", + "import": "./dist/emotion-react.development.edge-light.cjs.mjs", + "default": "./dist/emotion-react.development.edge-light.cjs.js" + }, + worker: { + module: "./dist/emotion-react.development.edge-light.esm.js", + "import": "./dist/emotion-react.development.edge-light.cjs.mjs", + "default": "./dist/emotion-react.development.edge-light.cjs.js" + }, + workerd: { + module: "./dist/emotion-react.development.edge-light.esm.js", + "import": "./dist/emotion-react.development.edge-light.cjs.mjs", + "default": "./dist/emotion-react.development.edge-light.cjs.js" + }, + browser: { + module: "./dist/emotion-react.browser.development.esm.js", + "import": "./dist/emotion-react.browser.development.cjs.mjs", + "default": "./dist/emotion-react.browser.development.cjs.js" + }, + module: "./dist/emotion-react.development.esm.js", + "import": "./dist/emotion-react.development.cjs.mjs", + "default": "./dist/emotion-react.development.cjs.js" + }, + "edge-light": { + module: "./dist/emotion-react.edge-light.esm.js", + "import": "./dist/emotion-react.edge-light.cjs.mjs", + "default": "./dist/emotion-react.edge-light.cjs.js" + }, + worker: { + module: "./dist/emotion-react.edge-light.esm.js", + "import": "./dist/emotion-react.edge-light.cjs.mjs", + "default": "./dist/emotion-react.edge-light.cjs.js" + }, + workerd: { + module: "./dist/emotion-react.edge-light.esm.js", + "import": "./dist/emotion-react.edge-light.cjs.mjs", + "default": "./dist/emotion-react.edge-light.cjs.js" + }, + browser: { + module: "./dist/emotion-react.browser.esm.js", + "import": "./dist/emotion-react.browser.cjs.mjs", + "default": "./dist/emotion-react.browser.cjs.js" + }, + module: "./dist/emotion-react.esm.js", + "import": "./dist/emotion-react.cjs.mjs", + "default": "./dist/emotion-react.cjs.js" + }, + "./jsx-runtime": { + types: { + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" + }, + development: { + "edge-light": { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js" + }, + worker: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js" + }, + workerd: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js" + }, + browser: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.js" + }, + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.js" + }, + "edge-light": { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js" + }, + worker: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js" + }, + workerd: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js" + }, + browser: { + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.js" + }, + module: "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js", + "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", + "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" + }, + "./_isolated-hnrs": { + types: { + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" + }, + development: { + "edge-light": { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js" + }, + worker: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js" + }, + workerd: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js" + }, + browser: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.js" + }, + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.js" + }, + "edge-light": { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js" + }, + worker: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js" + }, + workerd: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js" + }, + browser: { + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js" + }, + module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js", + "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", + "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" + }, + "./jsx-dev-runtime": { + types: { + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" + }, + development: { + "edge-light": { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js" + }, + worker: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js" + }, + workerd: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js" + }, + browser: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.js" + }, + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.js" + }, + "edge-light": { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js" + }, + worker: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js" + }, + workerd: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js" + }, + browser: { + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js" + }, + module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js", + "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", + "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" + }, + "./package.json": "./package.json", + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + }, + imports: { + "#is-development": { + development: "./src/conditions/true.ts", + "default": "./src/conditions/false.ts" + }, + "#is-browser": { + "edge-light": "./src/conditions/false.ts", + workerd: "./src/conditions/false.ts", + worker: "./src/conditions/false.ts", + browser: "./src/conditions/true.ts", + "default": "./src/conditions/is-browser.ts" + } + }, + files: [ + "src", + "dist", + "jsx-runtime", + "jsx-dev-runtime", + "_isolated-hnrs", + "types/css-prop.d.ts", + "macro.*" + ], + sideEffects: false, + author: "Emotion Contributors", + license: "MIT", + scripts: { + "test:typescript": "dtslint types" + }, + dependencies: { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.13.5", + "@emotion/cache": "^11.14.0", + "@emotion/serialize": "^1.3.3", + "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", + "@emotion/utils": "^1.4.2", + "@emotion/weak-memoize": "^0.4.0", + "hoist-non-react-statics": "^3.3.1" + }, + peerDependencies: { + react: ">=16.8.0" + }, + peerDependenciesMeta: { + "@types/react": { + optional: true + } + }, + devDependencies: { + "@definitelytyped/dtslint": "0.0.112", + "@emotion/css": "11.13.5", + "@emotion/css-prettifier": "1.2.0", + "@emotion/server": "11.11.0", + "@emotion/styled": "11.14.0", + "@types/hoist-non-react-statics": "^3.3.5", + "html-tag-names": "^1.1.2", + react: "16.14.0", + "svg-tag-names": "^1.1.1", + typescript: "^5.4.5" + }, + repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", + publishConfig: { + access: "public" + }, + "umd:main": "dist/emotion-react.umd.min.js", + preconstruct: { + entrypoints: [ + "./index.ts", + "./jsx-runtime.ts", + "./jsx-dev-runtime.ts", + "./_isolated-hnrs.ts" + ], + umdName: "emotionReact", + exports: { + extra: { + "./types/css-prop": "./types/css-prop.d.ts", + "./macro": { + types: { + "import": "./macro.d.mts", + "default": "./macro.d.ts" + }, + "default": "./macro.js" + } + } + } + } +}; + +var jsx = function jsx(type, props) { + // eslint-disable-next-line prefer-rest-params + var args = arguments; + + if (props == null || !_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.h.call(props, 'css')) { + return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(undefined, args); + } + + var argsLength = args.length; + var createElementArgArray = new Array(argsLength); + createElementArgArray[0] = _emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.E; + createElementArgArray[1] = (0,_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.c)(type, props); + + for (var i = 2; i < argsLength; i++) { + createElementArgArray[i] = args[i]; + } + + return react__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(null, createElementArgArray); +}; + +(function (_jsx) { + var JSX; + + (function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {}))); +})(jsx || (jsx = {})); + +var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. +// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild +// initial client-side render from SSR, use place of hydrating tag + +var Global = /* #__PURE__ */(0,_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.w)(function (props, cache) { + if (!warnedAboutCssPropForGlobal && ( // check for className as well since the user is + // probably using the custom createElement which + // means it will be turned into a className prop + // I don't really want to add it to the type since it shouldn't be used + 'className' in props && props.className || 'css' in props && props.css)) { + console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"); + warnedAboutCssPropForGlobal = true; + } + + var styles = props.styles; + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)([styles], undefined, react__WEBPACK_IMPORTED_MODULE_1__.useContext(_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.T)); + // but it is based on a constant that will never change at runtime + // it's effectively like having two implementations and switching them out + // so it's not actually breaking anything + + + var sheetRef = react__WEBPACK_IMPORTED_MODULE_1__.useRef(); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectWithLayoutFallback)(function () { + var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 + + var sheet = new cache.sheet.constructor({ + key: key, + nonce: cache.sheet.nonce, + container: cache.sheet.container, + speedy: cache.sheet.isSpeedy + }); + var rehydrating = false; + var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); + + if (cache.sheet.tags.length) { + sheet.before = cache.sheet.tags[0]; + } + + if (node !== null) { + rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s + + node.setAttribute('data-emotion', key); + sheet.hydrate([node]); + } + + sheetRef.current = [sheet, rehydrating]; + return function () { + sheet.flush(); + }; + }, [cache]); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectWithLayoutFallback)(function () { + var sheetRefCurrent = sheetRef.current; + var sheet = sheetRefCurrent[0], + rehydrating = sheetRefCurrent[1]; + + if (rehydrating) { + sheetRefCurrent[1] = false; + return; + } + + if (serialized.next !== undefined) { + // insert keyframes + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.insertStyles)(cache, serialized.next, true); + } + + if (sheet.tags.length) { + // if this doesn't exist then it will be null so the style element will be appended + var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; + sheet.before = element; + sheet.flush(); + } + + cache.insert("", serialized, sheet, false); + }, [cache, serialized.name]); + return null; +}); + +{ + Global.displayName = 'EmotionGlobal'; +} + +function css() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)(args); +} + +function keyframes() { + var insertable = css.apply(void 0, arguments); + var name = "animation-" + insertable.name; + return { + name: name, + styles: "@keyframes " + name + "{" + insertable.styles + "}", + anim: 1, + toString: function toString() { + return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; + } + }; +} + +var classnames = function classnames(args) { + var len = args.length; + var i = 0; + var cls = ''; + + for (; i < len; i++) { + var arg = args[i]; + if (arg == null) continue; + var toAdd = void 0; + + switch (typeof arg) { + case 'boolean': + break; + + case 'object': + { + if (Array.isArray(arg)) { + toAdd = classnames(arg); + } else { + if (arg.styles !== undefined && arg.name !== undefined) { + console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.'); + } + + toAdd = ''; + + for (var k in arg) { + if (arg[k] && k) { + toAdd && (toAdd += ' '); + toAdd += k; + } + } + } + + break; + } + + default: + { + toAdd = arg; + } + } + + if (toAdd) { + cls && (cls += ' '); + cls += toAdd; + } + } + + return cls; +}; + +function merge(registered, css, className) { + var registeredStyles = []; + var rawClassName = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.getRegisteredStyles)(registered, registeredStyles, className); + + if (registeredStyles.length < 2) { + return className; + } + + return rawClassName + css(registeredStyles); +} + +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serializedArr = _ref.serializedArr; + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__.useInsertionEffectAlwaysWithSyncFallback)(function () { + + for (var i = 0; i < serializedArr.length; i++) { + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.insertStyles)(cache, serializedArr[i], false); + } + }); + + return null; +}; + +var ClassNames = /* #__PURE__ */(0,_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.w)(function (props, cache) { + var hasRendered = false; + var serializedArr = []; + + var css = function css() { + if (hasRendered && isDevelopment) { + throw new Error('css can only be used during render'); + } + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__.serializeStyles)(args, cache.registered); + serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` + + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_2__.registerStyles)(cache, serialized, false); + return cache.key + "-" + serialized.name; + }; + + var cx = function cx() { + if (hasRendered && isDevelopment) { + throw new Error('cx can only be used during render'); + } + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return merge(cache.registered, css, classnames(args)); + }; + + var content = { + css: css, + cx: cx, + theme: react__WEBPACK_IMPORTED_MODULE_1__.useContext(_emotion_element_489459f2_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__.T) + }; + var ele = props.children(content); + hasRendered = true; + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Insertion, { + cache: cache, + serializedArr: serializedArr + }), ele); +}); + +{ + ClassNames.displayName = 'EmotionClassNames'; +} + +{ + var isBrowser = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked + + var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined'; + + if (isBrowser && !isTestEnv) { + // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later + var globalContext = typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef + : isBrowser ? window : __webpack_require__.g; + var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__"; + + if (globalContext[globalKey]) { + console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.'); + } + + globalContext[globalKey] = true; + } +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ serializeStyles: () => (/* binding */ serializeStyles) +/* harmony export */ }); +/* harmony import */ var _emotion_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/hash */ "./node_modules/@emotion/hash/dist/emotion-hash.esm.js"); +/* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js"); +/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); + + + + +var isDevelopment = true; + +var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; +var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; +var hyphenateRegex = /[A-Z]|^ms/g; +var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; + +var isCustomProperty = function isCustomProperty(property) { + return property.charCodeAt(1) === 45; +}; + +var isProcessableValue = function isProcessableValue(value) { + return value != null && typeof value !== 'boolean'; +}; + +var processStyleName = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_2__["default"])(function (styleName) { + return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); +}); + +var processStyleValue = function processStyleValue(key, value) { + switch (key) { + case 'animation': + case 'animationName': + { + if (typeof value === 'string') { + return value.replace(animationRegex, function (match, p1, p2) { + cursor = { + name: p1, + styles: p2, + next: cursor + }; + return p1; + }); + } + } + } + + if (_emotion_unitless__WEBPACK_IMPORTED_MODULE_1__["default"][key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { + return value + 'px'; + } + + return value; +}; + +{ + var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/; + var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset']; + var oldProcessStyleValue = processStyleValue; + var msPattern = /^-ms-/; + var hyphenPattern = /-(.)/g; + var hyphenatedCache = {}; + + processStyleValue = function processStyleValue(key, value) { + if (key === 'content') { + if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) { + throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`"); + } + } + + var processed = oldProcessStyleValue(key, value); + + if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) { + hyphenatedCache[key] = true; + console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { + return _char.toUpperCase(); + }) + "?"); + } + + return processed; + }; +} + +var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'; + +function handleInterpolation(mergedProps, registered, interpolation) { + if (interpolation == null) { + return ''; + } + + var componentSelector = interpolation; + + if (componentSelector.__emotion_styles !== undefined) { + if (String(componentSelector) === 'NO_COMPONENT_SELECTOR') { + throw new Error(noComponentSelectorMessage); + } + + return componentSelector; + } + + switch (typeof interpolation) { + case 'boolean': + { + return ''; + } + + case 'object': + { + var keyframes = interpolation; + + if (keyframes.anim === 1) { + cursor = { + name: keyframes.name, + styles: keyframes.styles, + next: cursor + }; + return keyframes.name; + } + + var serializedStyles = interpolation; + + if (serializedStyles.styles !== undefined) { + var next = serializedStyles.next; + + if (next !== undefined) { + // not the most efficient thing ever but this is a pretty rare case + // and there will be very few iterations of this generally + while (next !== undefined) { + cursor = { + name: next.name, + styles: next.styles, + next: cursor + }; + next = next.next; + } + } + + var styles = serializedStyles.styles + ";"; + return styles; + } + + return createStringFromObject(mergedProps, registered, interpolation); + } + + case 'function': + { + if (mergedProps !== undefined) { + var previousCursor = cursor; + var result = interpolation(mergedProps); + cursor = previousCursor; + return handleInterpolation(mergedProps, registered, result); + } else { + console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`"); + } + + break; + } + + case 'string': + { + var matched = []; + var replaced = interpolation.replace(animationRegex, function (_match, _p1, p2) { + var fakeVarName = "animation" + matched.length; + matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`"); + return "${" + fakeVarName + "}"; + }); + + if (matched.length) { + console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join('\n') + "\n\nYou should wrap it with `css` like this:\n\ncss`" + replaced + "`"); + } + } + + break; + } // finalize string values (regular strings and functions interpolated into css calls) + + + var asString = interpolation; + + if (registered == null) { + return asString; + } + + var cached = registered[asString]; + return cached !== undefined ? cached : asString; +} + +function createStringFromObject(mergedProps, registered, obj) { + var string = ''; + + if (Array.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; + } + } else { + for (var key in obj) { + var value = obj[key]; + + if (typeof value !== 'object') { + var asString = value; + + if (registered != null && registered[asString] !== undefined) { + string += key + "{" + registered[asString] + "}"; + } else if (isProcessableValue(asString)) { + string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";"; + } + } else { + if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) { + throw new Error(noComponentSelectorMessage); + } + + if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { + for (var _i = 0; _i < value.length; _i++) { + if (isProcessableValue(value[_i])) { + string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";"; + } + } + } else { + var interpolated = handleInterpolation(mergedProps, registered, value); + + switch (key) { + case 'animation': + case 'animationName': + { + string += processStyleName(key) + ":" + interpolated + ";"; + break; + } + + default: + { + if (key === 'undefined') { + console.error(UNDEFINED_AS_OBJECT_KEY_ERROR); + } + + string += key + "{" + interpolated + "}"; + } + } + } + } + } + } + + return string; +} + +var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes +// keyframes are stored on the SerializedStyles object as a linked list + +var cursor; +function serializeStyles(args, registered, mergedProps) { + if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { + return args[0]; + } + + var stringMode = true; + var styles = ''; + cursor = undefined; + var strings = args[0]; + + if (strings == null || strings.raw === undefined) { + stringMode = false; + styles += handleInterpolation(mergedProps, registered, strings); + } else { + var asTemplateStringsArr = strings; + + if (asTemplateStringsArr[0] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles += asTemplateStringsArr[0]; + } // we start at 1 since we've already handled the first arg + + + for (var i = 1; i < args.length; i++) { + styles += handleInterpolation(mergedProps, registered, args[i]); + + if (stringMode) { + var templateStringsArr = strings; + + if (templateStringsArr[i] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles += templateStringsArr[i]; + } + } // using a global regex with .exec is stateful so lastIndex has to be reset each time + + + labelPattern.lastIndex = 0; + var identifierName = ''; + var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 + + while ((match = labelPattern.exec(styles)) !== null) { + identifierName += '-' + match[1]; + } + + var name = (0,_emotion_hash__WEBPACK_IMPORTED_MODULE_0__["default"])(styles) + identifierName; + + { + var devStyles = { + name: name, + styles: styles, + next: cursor, + toString: function toString() { + return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; + } + }; + return devStyles; + } +} + + + + +/***/ }), + +/***/ "./node_modules/@emotion/sheet/dist/emotion-sheet.development.esm.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@emotion/sheet/dist/emotion-sheet.development.esm.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ StyleSheet: () => (/* binding */ StyleSheet) +/* harmony export */ }); +var isDevelopment = true; + +/* + +Based off glamor's StyleSheet, thanks Sunil ❤️ + +high performance StyleSheet for css-in-js systems + +- uses multiple style tags behind the scenes for millions of rules +- uses `insertRule` for appending in production for *much* faster performance + +// usage + +import { StyleSheet } from '@emotion/sheet' + +let styleSheet = new StyleSheet({ key: '', container: document.head }) + +styleSheet.insert('#box { border: 1px solid red; }') +- appends a css rule into the stylesheet + +styleSheet.flush() +- empties the stylesheet of all its contents + +*/ + +function sheetForTag(tag) { + if (tag.sheet) { + return tag.sheet; + } // this weirdness brought to you by firefox + + /* istanbul ignore next */ + + + for (var i = 0; i < document.styleSheets.length; i++) { + if (document.styleSheets[i].ownerNode === tag) { + return document.styleSheets[i]; + } + } // this function should always return with a value + // TS can't understand it though so we make it stop complaining here + + + return undefined; +} + +function createStyleElement(options) { + var tag = document.createElement('style'); + tag.setAttribute('data-emotion', options.key); + + if (options.nonce !== undefined) { + tag.setAttribute('nonce', options.nonce); + } + + tag.appendChild(document.createTextNode('')); + tag.setAttribute('data-s', ''); + return tag; +} + +var StyleSheet = /*#__PURE__*/function () { + // Using Node instead of HTMLElement since container may be a ShadowRoot + function StyleSheet(options) { + var _this = this; + + this._insertTag = function (tag) { + var before; + + if (_this.tags.length === 0) { + if (_this.insertionPoint) { + before = _this.insertionPoint.nextSibling; + } else if (_this.prepend) { + before = _this.container.firstChild; + } else { + before = _this.before; + } + } else { + before = _this.tags[_this.tags.length - 1].nextSibling; + } + + _this.container.insertBefore(tag, before); + + _this.tags.push(tag); + }; + + this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy; + this.tags = []; + this.ctr = 0; + this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets + + this.key = options.key; + this.container = options.container; + this.prepend = options.prepend; + this.insertionPoint = options.insertionPoint; + this.before = null; + } + + var _proto = StyleSheet.prototype; + + _proto.hydrate = function hydrate(nodes) { + nodes.forEach(this._insertTag); + }; + + _proto.insert = function insert(rule) { + // the max length is how many rules we have per style tag, it's 65000 in speedy mode + // it's 1 in dev because we insert source maps that map a single rule to a location + // and you can only have one source map per style tag + if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { + this._insertTag(createStyleElement(this)); + } + + var tag = this.tags[this.tags.length - 1]; + + { + var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; + + if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) { + // this would only cause problem in speedy mode + // but we don't want enabling speedy to affect the observable behavior + // so we report this error at all times + console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.'); + } + + this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; + } + + if (this.isSpeedy) { + var sheet = sheetForTag(tag); + + try { + // this is the ultrafast version, works across browsers + // the big drawback is that the css won't be editable in devtools + sheet.insertRule(rule, sheet.cssRules.length); + } catch (e) { + if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { + console.error("There was a problem inserting the following rule: \"" + rule + "\"", e); + } + } + } else { + tag.appendChild(document.createTextNode(rule)); + } + + this.ctr++; + }; + + _proto.flush = function flush() { + this.tags.forEach(function (tag) { + var _tag$parentNode; + + return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); + }); + this.tags = []; + this.ctr = 0; + + { + this._alreadyInsertedOrderInsensitiveRule = false; + } + }; + + return StyleSheet; +}(); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.development.esm.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.development.esm.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ createStyled) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/react */ "./node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js"); + + + + + + + + +var isDevelopment = true; + +var testOmitPropsOnStringTag = _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__["default"]; + +var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { + return key !== 'theme'; +}; + +var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { + return typeof tag === 'string' && // 96 is one less than the char code + // for "a" so this is checking that + // it's a lowercase character + tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; +}; +var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) { + var shouldForwardProp; + + if (options) { + var optionsShouldForwardProp = options.shouldForwardProp; + shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) { + return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName); + } : optionsShouldForwardProp; + } + + if (typeof shouldForwardProp !== 'function' && isReal) { + shouldForwardProp = tag.__emotion_forwardProp; + } + + return shouldForwardProp; +}; + +var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; + +var Insertion = function Insertion(_ref) { + var cache = _ref.cache, + serialized = _ref.serialized, + isStringTag = _ref.isStringTag; + (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_3__.registerStyles)(cache, serialized, isStringTag); + (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_2__.useInsertionEffectAlwaysWithSyncFallback)(function () { + return (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_3__.insertStyles)(cache, serialized, isStringTag); + }); + + return null; +}; + +var createStyled = function createStyled(tag, options) { + { + if (tag === undefined) { + throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.'); + } + } + + var isReal = tag.__emotion_real === tag; + var baseTag = isReal && tag.__emotion_base || tag; + var identifierName; + var targetClassName; + + if (options !== undefined) { + identifierName = options.label; + targetClassName = options.target; + } + + var shouldForwardProp = composeShouldForwardProps(tag, options, isReal); + var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); + var shouldUseAs = !defaultShouldForwardProp('as'); + return function () { + // eslint-disable-next-line prefer-rest-params + var args = arguments; + var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; + + if (identifierName !== undefined) { + styles.push("label:" + identifierName + ";"); + } + + if (args[0] == null || args[0].raw === undefined) { + // eslint-disable-next-line prefer-spread + styles.push.apply(styles, args); + } else { + var templateStringsArr = args[0]; + + if (templateStringsArr[0] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles.push(templateStringsArr[0]); + var len = args.length; + var i = 1; + + for (; i < len; i++) { + if (templateStringsArr[i] === undefined) { + console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); + } + + styles.push(args[i], templateStringsArr[i]); + } + } + + var Styled = (0,_emotion_react__WEBPACK_IMPORTED_MODULE_6__.w)(function (props, cache, ref) { + var FinalTag = shouldUseAs && props.as || baseTag; + var className = ''; + var classInterpolations = []; + var mergedProps = props; + + if (props.theme == null) { + mergedProps = {}; + + for (var key in props) { + mergedProps[key] = props[key]; + } + + mergedProps.theme = react__WEBPACK_IMPORTED_MODULE_4__.useContext(_emotion_react__WEBPACK_IMPORTED_MODULE_6__.T); + } + + if (typeof props.className === 'string') { + className = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_3__.getRegisteredStyles)(cache.registered, classInterpolations, props.className); + } else if (props.className != null) { + className = props.className + " "; + } + + var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_1__.serializeStyles)(styles.concat(classInterpolations), cache.registered, mergedProps); + className += cache.key + "-" + serialized.name; + + if (targetClassName !== undefined) { + className += " " + targetClassName; + } + + var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp; + var newProps = {}; + + for (var _key in props) { + if (shouldUseAs && _key === 'as') continue; + + if (finalShouldForwardProp(_key)) { + newProps[_key] = props[_key]; + } + } + + newProps.className = className; + + if (ref) { + newProps.ref = ref; + } + + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(react__WEBPACK_IMPORTED_MODULE_4__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(Insertion, { + cache: cache, + serialized: serialized, + isStringTag: typeof FinalTag === 'string' + }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(FinalTag, newProps)); + }); + Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; + Styled.defaultProps = tag.defaultProps; + Styled.__emotion_real = Styled; + Styled.__emotion_base = baseTag; + Styled.__emotion_styles = styles; + Styled.__emotion_forwardProp = shouldForwardProp; + Object.defineProperty(Styled, 'toString', { + value: function value() { + if (targetClassName === undefined && isDevelopment) { + return 'NO_COMPONENT_SELECTOR'; + } + + return "." + targetClassName; + } + }); + + Styled.withComponent = function (nextTag, nextOptions) { + var newStyled = createStyled(nextTag, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, nextOptions, { + shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) + })); + return newStyled.apply(void 0, styles); + }; + + return Styled; + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/styled/dist/emotion-styled.browser.development.esm.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@emotion/styled/dist/emotion-styled.browser.development.esm.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ newStyled) +/* harmony export */ }); +/* harmony import */ var _base_dist_emotion_styled_base_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/dist/emotion-styled-base.browser.development.esm.js */ "./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.development.esm.js"); +/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); +/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js"); +/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/use-insertion-effect-with-fallbacks */ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js"); +/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js"); + + + + + + + + + +var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG +'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; + +// bind it to avoid mutating the original function +var newStyled = _base_dist_emotion_styled_base_browser_development_esm_js__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null); +tags.forEach(function (tagName) { + newStyled[tagName] = newStyled(tagName); +}); + + + + +/***/ }), + +/***/ "./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ unitlessKeys) +/* harmony export */ }); +var unitlessKeys = { + animationIterationCount: 1, + aspectRatio: 1, + borderImageOutset: 1, + borderImageSlice: 1, + borderImageWidth: 1, + boxFlex: 1, + boxFlexGroup: 1, + boxOrdinalGroup: 1, + columnCount: 1, + columns: 1, + flex: 1, + flexGrow: 1, + flexPositive: 1, + flexShrink: 1, + flexNegative: 1, + flexOrder: 1, + gridRow: 1, + gridRowEnd: 1, + gridRowSpan: 1, + gridRowStart: 1, + gridColumn: 1, + gridColumnEnd: 1, + gridColumnSpan: 1, + gridColumnStart: 1, + msGridRow: 1, + msGridRowSpan: 1, + msGridColumn: 1, + msGridColumnSpan: 1, + fontWeight: 1, + lineHeight: 1, + opacity: 1, + order: 1, + orphans: 1, + scale: 1, + tabSize: 1, + widows: 1, + zIndex: 1, + zoom: 1, + WebkitLineClamp: 1, + // SVG-related properties + fillOpacity: 1, + floodOpacity: 1, + stopOpacity: 1, + strokeDasharray: 1, + strokeDashoffset: 1, + strokeMiterlimit: 1, + strokeOpacity: 1, + strokeWidth: 1 +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js": +/*!***********************************************************************************************************************************!*\ + !*** ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js ***! + \***********************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ useInsertionEffectAlwaysWithSyncFallback: () => (/* binding */ useInsertionEffectAlwaysWithSyncFallback), +/* harmony export */ useInsertionEffectWithLayoutFallback: () => (/* binding */ useInsertionEffectWithLayoutFallback) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); + + +var syncFallback = function syncFallback(create) { + return create(); +}; + +var useInsertionEffect = react__WEBPACK_IMPORTED_MODULE_0__['useInsertion' + 'Effect'] ? react__WEBPACK_IMPORTED_MODULE_0__['useInsertion' + 'Effect'] : false; +var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; +var useInsertionEffectWithLayoutFallback = useInsertionEffect || react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ getRegisteredStyles: () => (/* binding */ getRegisteredStyles), +/* harmony export */ insertStyles: () => (/* binding */ insertStyles), +/* harmony export */ registerStyles: () => (/* binding */ registerStyles) +/* harmony export */ }); +var isBrowser = true; + +function getRegisteredStyles(registered, registeredStyles, classNames) { + var rawClassName = ''; + classNames.split(' ').forEach(function (className) { + if (registered[className] !== undefined) { + registeredStyles.push(registered[className] + ";"); + } else if (className) { + rawClassName += className + " "; + } + }); + return rawClassName; +} +var registerStyles = function registerStyles(cache, serialized, isStringTag) { + var className = cache.key + "-" + serialized.name; + + if ( // we only need to add the styles to the registered cache if the + // class name could be used further down + // the tree but if it's a string tag, we know it won't + // so we don't have to add it to registered cache. + // this improves memory usage since we can avoid storing the whole style string + (isStringTag === false || // we need to always store it if we're in compat mode and + // in node since emotion-server relies on whether a style is in + // the registered cache to know whether a style is global or not + // also, note that this check will be dead code eliminated in the browser + isBrowser === false ) && cache.registered[className] === undefined) { + cache.registered[className] = serialized.styles; + } +}; +var insertStyles = function insertStyles(cache, serialized, isStringTag) { + registerStyles(cache, serialized, isStringTag); + var className = cache.key + "-" + serialized.name; + + if (cache.inserted[serialized.name] === undefined) { + var current = serialized; + + do { + cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); + + current = current.next; + } while (current !== undefined); + } +}; + + + + +/***/ }), + +/***/ "./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ weakMemoize) +/* harmony export */ }); +var weakMemoize = function weakMemoize(func) { + var cache = new WeakMap(); + return function (arg) { + if (cache.has(arg)) { + // Use non-null assertion because we just checked that the cache `has` it + // This allows us to remove `undefined` from the return value + return cache.get(arg); + } + + var ret = func(arg); + cache.set(arg, ret); + return ret; + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/@floating-ui/core/dist/floating-ui.core.mjs": +/*!******************************************************************!*\ + !*** ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs ***! + \******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ arrow: () => (/* binding */ arrow), +/* harmony export */ autoPlacement: () => (/* binding */ autoPlacement), +/* harmony export */ computePosition: () => (/* binding */ computePosition), +/* harmony export */ detectOverflow: () => (/* binding */ detectOverflow), +/* harmony export */ flip: () => (/* binding */ flip), +/* harmony export */ hide: () => (/* binding */ hide), +/* harmony export */ inline: () => (/* binding */ inline), +/* harmony export */ limitShift: () => (/* binding */ limitShift), +/* harmony export */ offset: () => (/* binding */ offset), +/* harmony export */ rectToClientRect: () => (/* reexport safe */ _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect), +/* harmony export */ shift: () => (/* binding */ shift), +/* harmony export */ size: () => (/* binding */ size) +/* harmony export */ }); +/* harmony import */ var _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @floating-ui/utils */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"); + + + +function computeCoordsFromPlacement(_ref, placement, rtl) { + let { + reference, + floating + } = _ref; + const sideAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement); + const alignmentAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignmentAxis)(placement); + const alignLength = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAxisLength)(alignmentAxis); + const side = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement); + const isVertical = sideAxis === 'y'; + const commonX = reference.x + reference.width / 2 - floating.width / 2; + const commonY = reference.y + reference.height / 2 - floating.height / 2; + const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; + let coords; + switch (side) { + case 'top': + coords = { + x: commonX, + y: reference.y - floating.height + }; + break; + case 'bottom': + coords = { + x: commonX, + y: reference.y + reference.height + }; + break; + case 'right': + coords = { + x: reference.x + reference.width, + y: commonY + }; + break; + case 'left': + coords = { + x: reference.x - floating.width, + y: commonY + }; + break; + default: + coords = { + x: reference.x, + y: reference.y + }; + } + switch ((0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement)) { + case 'start': + coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); + break; + case 'end': + coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); + break; + } + return coords; +} + +/** + * Computes the `x` and `y` coordinates that will place the floating element + * next to a given reference element. + * + * This export does not have any `platform` interface logic. You will need to + * write one for the platform you are using Floating UI with. + */ +const computePosition = async (reference, floating, config) => { + const { + placement = 'bottom', + strategy = 'absolute', + middleware = [], + platform + } = config; + const validMiddleware = middleware.filter(Boolean); + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); + let rects = await platform.getElementRects({ + reference, + floating, + strategy + }); + let { + x, + y + } = computeCoordsFromPlacement(rects, placement, rtl); + let statefulPlacement = placement; + let middlewareData = {}; + let resetCount = 0; + for (let i = 0; i < validMiddleware.length; i++) { + const { + name, + fn + } = validMiddleware[i]; + const { + x: nextX, + y: nextY, + data, + reset + } = await fn({ + x, + y, + initialPlacement: placement, + placement: statefulPlacement, + strategy, + middlewareData, + rects, + platform, + elements: { + reference, + floating + } + }); + x = nextX != null ? nextX : x; + y = nextY != null ? nextY : y; + middlewareData = { + ...middlewareData, + [name]: { + ...middlewareData[name], + ...data + } + }; + if (reset && resetCount <= 50) { + resetCount++; + if (typeof reset === 'object') { + if (reset.placement) { + statefulPlacement = reset.placement; + } + if (reset.rects) { + rects = reset.rects === true ? await platform.getElementRects({ + reference, + floating, + strategy + }) : reset.rects; + } + ({ + x, + y + } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); + } + i = -1; + } + } + return { + x, + y, + placement: statefulPlacement, + strategy, + middlewareData + }; +}; + +/** + * Resolves with an object of overflow side offsets that determine how much the + * element is overflowing a given clipping boundary on each side. + * - positive = overflowing the boundary by that number of pixels + * - negative = how many pixels left before it will overflow + * - 0 = lies flush with the boundary + * @see https://floating-ui.com/docs/detectOverflow + */ +async function detectOverflow(state, options) { + var _await$platform$isEle; + if (options === void 0) { + options = {}; + } + const { + x, + y, + platform, + rects, + elements, + strategy + } = state; + const { + boundary = 'clippingAncestors', + rootBoundary = 'viewport', + elementContext = 'floating', + altBoundary = false, + padding = 0 + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const paddingObject = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getPaddingObject)(padding); + const altContext = elementContext === 'floating' ? 'reference' : 'floating'; + const element = elements[altBoundary ? altContext : elementContext]; + const clippingClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(await platform.getClippingRect({ + element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), + boundary, + rootBoundary, + strategy + })); + const rect = elementContext === 'floating' ? { + x, + y, + width: rects.floating.width, + height: rects.floating.height + } : rects.reference; + const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); + const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { + x: 1, + y: 1 + } : { + x: 1, + y: 1 + }; + const elementClientRect = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ + elements, + rect, + offsetParent, + strategy + }) : rect); + return { + top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, + bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, + left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, + right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x + }; +} + +/** + * Provides data to position an inner element of the floating element so that it + * appears centered to the reference element. + * @see https://floating-ui.com/docs/arrow + */ +const arrow = options => ({ + name: 'arrow', + options, + async fn(state) { + const { + x, + y, + placement, + rects, + platform, + elements, + middlewareData + } = state; + // Since `element` is required, we don't Partial<> the type. + const { + element, + padding = 0 + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state) || {}; + if (element == null) { + return {}; + } + const paddingObject = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getPaddingObject)(padding); + const coords = { + x, + y + }; + const axis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignmentAxis)(placement); + const length = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAxisLength)(axis); + const arrowDimensions = await platform.getDimensions(element); + const isYAxis = axis === 'y'; + const minProp = isYAxis ? 'top' : 'left'; + const maxProp = isYAxis ? 'bottom' : 'right'; + const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; + const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; + const startDiff = coords[axis] - rects.reference[axis]; + const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); + let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; + + // DOM platform can return `window` as the `offsetParent`. + if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { + clientSize = elements.floating[clientProp] || rects.floating[length]; + } + const centerToReference = endDiff / 2 - startDiff / 2; + + // If the padding is large enough that it causes the arrow to no longer be + // centered, modify the padding so that it is centered. + const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; + const minPadding = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(paddingObject[minProp], largestPossiblePadding); + const maxPadding = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(paddingObject[maxProp], largestPossiblePadding); + + // Make sure the arrow doesn't overflow the floating element if the center + // point is outside the floating element's bounds. + const min$1 = minPadding; + const max = clientSize - arrowDimensions[length] - maxPadding; + const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; + const offset = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.clamp)(min$1, center, max); + + // If the reference is small enough that the arrow's padding causes it to + // to point to nothing for an aligned placement, adjust the offset of the + // floating element itself. To ensure `shift()` continues to take action, + // a single reset is performed when this is true. + const shouldAddOffset = !middlewareData.arrow && (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; + const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; + return { + [axis]: coords[axis] + alignmentOffset, + data: { + [axis]: offset, + centerOffset: center - offset - alignmentOffset, + ...(shouldAddOffset && { + alignmentOffset + }) + }, + reset: shouldAddOffset + }; + } +}); + +function getPlacementList(alignment, autoAlignment, allowedPlacements) { + const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement) === alignment), ...allowedPlacements.filter(placement => (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement) !== alignment)] : allowedPlacements.filter(placement => (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement) === placement); + return allowedPlacementsSortedByAlignment.filter(placement => { + if (alignment) { + return (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement) === alignment || (autoAlignment ? (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAlignmentPlacement)(placement) !== placement : false); + } + return true; + }); +} +/** + * Optimizes the visibility of the floating element by choosing the placement + * that has the most space available automatically, without needing to specify a + * preferred placement. Alternative to `flip`. + * @see https://floating-ui.com/docs/autoPlacement + */ +const autoPlacement = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'autoPlacement', + options, + async fn(state) { + var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; + const { + rects, + middlewareData, + placement, + platform, + elements + } = state; + const { + crossAxis = false, + alignment, + allowedPlacements = _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.placements, + autoAlignment = true, + ...detectOverflowOptions + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const placements$1 = alignment !== undefined || allowedPlacements === _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; + const overflow = await detectOverflow(state, detectOverflowOptions); + const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; + const currentPlacement = placements$1[currentIndex]; + if (currentPlacement == null) { + return {}; + } + const alignmentSides = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignmentSides)(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); + + // Make `computeCoords` start from the right place. + if (placement !== currentPlacement) { + return { + reset: { + placement: placements$1[0] + } + }; + } + const currentOverflows = [overflow[(0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; + const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { + placement: currentPlacement, + overflows: currentOverflows + }]; + const nextPlacement = placements$1[currentIndex + 1]; + + // There are more placements to check. + if (nextPlacement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: nextPlacement + } + }; + } + const placementsSortedByMostSpace = allOverflows.map(d => { + const alignment = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(d.placement); + return [d.placement, alignment && crossAxis ? + // Check along the mainAxis and main crossAxis side. + d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : + // Check only the mainAxis. + d.overflows[0], d.overflows]; + }).sort((a, b) => a[1] - b[1]); + const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, + // Aligned placements should not check their opposite crossAxis + // side. + (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(d[0]) ? 2 : 3).every(v => v <= 0)); + const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; + if (resetPlacement !== placement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: resetPlacement + } + }; + } + return {}; + } + }; +}; + +/** + * Optimizes the visibility of the floating element by flipping the `placement` + * in order to keep it in view when the preferred placement(s) will overflow the + * clipping boundary. Alternative to `autoPlacement`. + * @see https://floating-ui.com/docs/flip + */ +const flip = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'flip', + options, + async fn(state) { + var _middlewareData$arrow, _middlewareData$flip; + const { + placement, + middlewareData, + rects, + initialPlacement, + platform, + elements + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true, + fallbackPlacements: specifiedFallbackPlacements, + fallbackStrategy = 'bestFit', + fallbackAxisSideDirection = 'none', + flipAlignment = true, + ...detectOverflowOptions + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + + // If a reset by the arrow was caused due to an alignment offset being + // added, we should skip any logic now since `flip()` has already done its + // work. + // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 + if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { + return {}; + } + const side = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement); + const initialSideAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(initialPlacement); + const isBasePlacement = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(initialPlacement) === initialPlacement; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [(0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositePlacement)(initialPlacement)] : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getExpandedPlacements)(initialPlacement)); + const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; + if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { + fallbackPlacements.push(...(0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAxisPlacements)(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); + } + const placements = [initialPlacement, ...fallbackPlacements]; + const overflow = await detectOverflow(state, detectOverflowOptions); + const overflows = []; + let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; + if (checkMainAxis) { + overflows.push(overflow[side]); + } + if (checkCrossAxis) { + const sides = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignmentSides)(placement, rects, rtl); + overflows.push(overflow[sides[0]], overflow[sides[1]]); + } + overflowsData = [...overflowsData, { + placement, + overflows + }]; + + // One or more sides is overflowing. + if (!overflows.every(side => side <= 0)) { + var _middlewareData$flip2, _overflowsData$filter; + const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; + const nextPlacement = placements[nextIndex]; + if (nextPlacement) { + // Try next placement and re-run the lifecycle. + return { + data: { + index: nextIndex, + overflows: overflowsData + }, + reset: { + placement: nextPlacement + } + }; + } + + // First, find the candidates that fit on the mainAxis side of overflow, + // then find the placement that fits the best on the main crossAxis side. + let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; + + // Otherwise fallback. + if (!resetPlacement) { + switch (fallbackStrategy) { + case 'bestFit': + { + var _overflowsData$filter2; + const placement = (_overflowsData$filter2 = overflowsData.filter(d => { + if (hasFallbackAxisSideDirection) { + const currentSideAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(d.placement); + return currentSideAxis === initialSideAxis || + // Create a bias to the `y` side axis due to horizontal + // reading directions favoring greater width. + currentSideAxis === 'y'; + } + return true; + }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; + if (placement) { + resetPlacement = placement; + } + break; + } + case 'initialPlacement': + resetPlacement = initialPlacement; + break; + } + } + if (placement !== resetPlacement) { + return { + reset: { + placement: resetPlacement + } + }; + } + } + return {}; + } + }; +}; + +function getSideOffsets(overflow, rect) { + return { + top: overflow.top - rect.height, + right: overflow.right - rect.width, + bottom: overflow.bottom - rect.height, + left: overflow.left - rect.width + }; +} +function isAnySideFullyClipped(overflow) { + return _floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.sides.some(side => overflow[side] >= 0); +} +/** + * Provides data to hide the floating element in applicable situations, such as + * when it is not in the same clipping context as the reference element. + * @see https://floating-ui.com/docs/hide + */ +const hide = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'hide', + options, + async fn(state) { + const { + rects + } = state; + const { + strategy = 'referenceHidden', + ...detectOverflowOptions + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + switch (strategy) { + case 'referenceHidden': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + elementContext: 'reference' + }); + const offsets = getSideOffsets(overflow, rects.reference); + return { + data: { + referenceHiddenOffsets: offsets, + referenceHidden: isAnySideFullyClipped(offsets) + } + }; + } + case 'escaped': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + altBoundary: true + }); + const offsets = getSideOffsets(overflow, rects.floating); + return { + data: { + escapedOffsets: offsets, + escaped: isAnySideFullyClipped(offsets) + } + }; + } + default: + { + return {}; + } + } + } + }; +}; + +function getBoundingRect(rects) { + const minX = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(...rects.map(rect => rect.left)); + const minY = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(...rects.map(rect => rect.top)); + const maxX = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(...rects.map(rect => rect.right)); + const maxY = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(...rects.map(rect => rect.bottom)); + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; +} +function getRectsByLine(rects) { + const sortedRects = rects.slice().sort((a, b) => a.y - b.y); + const groups = []; + let prevRect = null; + for (let i = 0; i < sortedRects.length; i++) { + const rect = sortedRects[i]; + if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { + groups.push([rect]); + } else { + groups[groups.length - 1].push(rect); + } + prevRect = rect; + } + return groups.map(rect => (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(getBoundingRect(rect))); +} +/** + * Provides improved positioning for inline reference elements that can span + * over multiple lines, such as hyperlinks or range selections. + * @see https://floating-ui.com/docs/inline + */ +const inline = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'inline', + options, + async fn(state) { + const { + placement, + elements, + rects, + platform, + strategy + } = state; + // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a + // ClientRect's bounds, despite the event listener being triggered. A + // padding of 2 seems to handle this issue. + const { + padding = 2, + x, + y + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); + const clientRects = getRectsByLine(nativeClientRects); + const fallback = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.rectToClientRect)(getBoundingRect(nativeClientRects)); + const paddingObject = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getPaddingObject)(padding); + function getBoundingClientRect() { + // There are two rects and they are disjoined. + if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { + // Find the first rect in which the point is fully inside. + return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; + } + + // There are 2 or more connected rects. + if (clientRects.length >= 2) { + if ((0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement) === 'y') { + const firstRect = clientRects[0]; + const lastRect = clientRects[clientRects.length - 1]; + const isTop = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement) === 'top'; + const top = firstRect.top; + const bottom = lastRect.bottom; + const left = isTop ? firstRect.left : lastRect.left; + const right = isTop ? firstRect.right : lastRect.right; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + const isLeftSide = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement) === 'left'; + const maxRight = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(...clientRects.map(rect => rect.right)); + const minLeft = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(...clientRects.map(rect => rect.left)); + const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); + const top = measureRects[0].top; + const bottom = measureRects[measureRects.length - 1].bottom; + const left = minLeft; + const right = maxRight; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + return fallback; + } + const resetRects = await platform.getElementRects({ + reference: { + getBoundingClientRect + }, + floating: elements.floating, + strategy + }); + if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { + return { + reset: { + rects: resetRects + } + }; + } + return {}; + } + }; +}; + +// For type backwards-compatibility, the `OffsetOptions` type was also +// Derivable. + +async function convertValueToCoords(state, options) { + const { + placement, + platform, + elements + } = state; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const side = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement); + const alignment = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement); + const isVertical = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement) === 'y'; + const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; + const crossAxisMulti = rtl && isVertical ? -1 : 1; + const rawValue = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + + // eslint-disable-next-line prefer-const + let { + mainAxis, + crossAxis, + alignmentAxis + } = typeof rawValue === 'number' ? { + mainAxis: rawValue, + crossAxis: 0, + alignmentAxis: null + } : { + mainAxis: rawValue.mainAxis || 0, + crossAxis: rawValue.crossAxis || 0, + alignmentAxis: rawValue.alignmentAxis + }; + if (alignment && typeof alignmentAxis === 'number') { + crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; + } + return isVertical ? { + x: crossAxis * crossAxisMulti, + y: mainAxis * mainAxisMulti + } : { + x: mainAxis * mainAxisMulti, + y: crossAxis * crossAxisMulti + }; +} + +/** + * Modifies the placement by translating the floating element along the + * specified axes. + * A number (shorthand for `mainAxis` or distance), or an axes configuration + * object may be passed. + * @see https://floating-ui.com/docs/offset + */ +const offset = function (options) { + if (options === void 0) { + options = 0; + } + return { + name: 'offset', + options, + async fn(state) { + var _middlewareData$offse, _middlewareData$arrow; + const { + x, + y, + placement, + middlewareData + } = state; + const diffCoords = await convertValueToCoords(state, options); + + // If the placement is the same and the arrow caused an alignment offset + // then we don't need to change the positioning coordinates. + if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { + return {}; + } + return { + x: x + diffCoords.x, + y: y + diffCoords.y, + data: { + ...diffCoords, + placement + } + }; + } + }; +}; + +/** + * Optimizes the visibility of the floating element by shifting it in order to + * keep it in view when it will overflow the clipping boundary. + * @see https://floating-ui.com/docs/shift + */ +const shift = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'shift', + options, + async fn(state) { + const { + x, + y, + placement + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = false, + limiter = { + fn: _ref => { + let { + x, + y + } = _ref; + return { + x, + y + }; + } + }, + ...detectOverflowOptions + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const coords = { + x, + y + }; + const overflow = await detectOverflow(state, detectOverflowOptions); + const crossAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)((0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement)); + const mainAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAxis)(crossAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + if (checkMainAxis) { + const minSide = mainAxis === 'y' ? 'top' : 'left'; + const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; + const min = mainAxisCoord + overflow[minSide]; + const max = mainAxisCoord - overflow[maxSide]; + mainAxisCoord = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.clamp)(min, mainAxisCoord, max); + } + if (checkCrossAxis) { + const minSide = crossAxis === 'y' ? 'top' : 'left'; + const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; + const min = crossAxisCoord + overflow[minSide]; + const max = crossAxisCoord - overflow[maxSide]; + crossAxisCoord = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.clamp)(min, crossAxisCoord, max); + } + const limitedCoords = limiter.fn({ + ...state, + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }); + return { + ...limitedCoords, + data: { + x: limitedCoords.x - x, + y: limitedCoords.y - y, + enabled: { + [mainAxis]: checkMainAxis, + [crossAxis]: checkCrossAxis + } + } + }; + } + }; +}; +/** + * Built-in `limiter` that will stop `shift()` at a certain point. + */ +const limitShift = function (options) { + if (options === void 0) { + options = {}; + } + return { + options, + fn(state) { + const { + x, + y, + placement, + rects, + middlewareData + } = state; + const { + offset = 0, + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const coords = { + x, + y + }; + const crossAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement); + const mainAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getOppositeAxis)(crossAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + const rawOffset = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(offset, state); + const computedOffset = typeof rawOffset === 'number' ? { + mainAxis: rawOffset, + crossAxis: 0 + } : { + mainAxis: 0, + crossAxis: 0, + ...rawOffset + }; + if (checkMainAxis) { + const len = mainAxis === 'y' ? 'height' : 'width'; + const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; + const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; + if (mainAxisCoord < limitMin) { + mainAxisCoord = limitMin; + } else if (mainAxisCoord > limitMax) { + mainAxisCoord = limitMax; + } + } + if (checkCrossAxis) { + var _middlewareData$offse, _middlewareData$offse2; + const len = mainAxis === 'y' ? 'width' : 'height'; + const isOriginSide = ['top', 'left'].includes((0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement)); + const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); + const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); + if (crossAxisCoord < limitMin) { + crossAxisCoord = limitMin; + } else if (crossAxisCoord > limitMax) { + crossAxisCoord = limitMax; + } + } + return { + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }; + } + }; +}; + +/** + * Provides data that allows you to change the size of the floating element — + * for instance, prevent it from overflowing the clipping boundary or match the + * width of the reference element. + * @see https://floating-ui.com/docs/size + */ +const size = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'size', + options, + async fn(state) { + var _state$middlewareData, _state$middlewareData2; + const { + placement, + rects, + platform, + elements + } = state; + const { + apply = () => {}, + ...detectOverflowOptions + } = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.evaluate)(options, state); + const overflow = await detectOverflow(state, detectOverflowOptions); + const side = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSide)(placement); + const alignment = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getAlignment)(placement); + const isYAxis = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.getSideAxis)(placement) === 'y'; + const { + width, + height + } = rects.floating; + let heightSide; + let widthSide; + if (side === 'top' || side === 'bottom') { + heightSide = side; + widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; + } else { + widthSide = side; + heightSide = alignment === 'end' ? 'top' : 'bottom'; + } + const maximumClippingHeight = height - overflow.top - overflow.bottom; + const maximumClippingWidth = width - overflow.left - overflow.right; + const overflowAvailableHeight = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(height - overflow[heightSide], maximumClippingHeight); + const overflowAvailableWidth = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.min)(width - overflow[widthSide], maximumClippingWidth); + const noShift = !state.middlewareData.shift; + let availableHeight = overflowAvailableHeight; + let availableWidth = overflowAvailableWidth; + if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { + availableWidth = maximumClippingWidth; + } + if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { + availableHeight = maximumClippingHeight; + } + if (noShift && !alignment) { + const xMin = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.left, 0); + const xMax = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.right, 0); + const yMin = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.top, 0); + const yMax = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.bottom, 0); + if (isYAxis) { + availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.left, overflow.right)); + } else { + availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_0__.max)(overflow.top, overflow.bottom)); + } + } + await apply({ + ...state, + availableWidth, + availableHeight + }); + const nextDimensions = await platform.getDimensions(elements.floating); + if (width !== nextDimensions.width || height !== nextDimensions.height) { + return { + reset: { + rects: true + } + }; + } + return {}; + } + }; +}; + + + + +/***/ }), + +/***/ "./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs": +/*!****************************************************************!*\ + !*** ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ arrow: () => (/* binding */ arrow), +/* harmony export */ autoPlacement: () => (/* binding */ autoPlacement), +/* harmony export */ autoUpdate: () => (/* binding */ autoUpdate), +/* harmony export */ computePosition: () => (/* binding */ computePosition), +/* harmony export */ detectOverflow: () => (/* binding */ detectOverflow), +/* harmony export */ flip: () => (/* binding */ flip), +/* harmony export */ getOverflowAncestors: () => (/* reexport safe */ _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getOverflowAncestors), +/* harmony export */ hide: () => (/* binding */ hide), +/* harmony export */ inline: () => (/* binding */ inline), +/* harmony export */ limitShift: () => (/* binding */ limitShift), +/* harmony export */ offset: () => (/* binding */ offset), +/* harmony export */ platform: () => (/* binding */ platform), +/* harmony export */ shift: () => (/* binding */ shift), +/* harmony export */ size: () => (/* binding */ size) +/* harmony export */ }); +/* harmony import */ var _floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @floating-ui/utils */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"); +/* harmony import */ var _floating_ui_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @floating-ui/core */ "./node_modules/@floating-ui/core/dist/floating-ui.core.mjs"); +/* harmony import */ var _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @floating-ui/utils/dom */ "./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs"); + + + + + +function getCssDimensions(element) { + const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(element); + // In testing environments, the `width` and `height` properties are empty + // strings for SVG elements, returning NaN. Fallback to `0` in this case. + let width = parseFloat(css.width) || 0; + let height = parseFloat(css.height) || 0; + const hasOffset = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element); + const offsetWidth = hasOffset ? element.offsetWidth : width; + const offsetHeight = hasOffset ? element.offsetHeight : height; + const shouldFallback = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.round)(width) !== offsetWidth || (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.round)(height) !== offsetHeight; + if (shouldFallback) { + width = offsetWidth; + height = offsetHeight; + } + return { + width, + height, + $: shouldFallback + }; +} + +function unwrapElement(element) { + return !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? element.contextElement : element; +} + +function getScale(element) { + const domElement = unwrapElement(element); + if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(domElement)) { + return (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1); + } + const rect = domElement.getBoundingClientRect(); + const { + width, + height, + $ + } = getCssDimensions(domElement); + let x = ($ ? (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.round)(rect.width) : rect.width) / width; + let y = ($ ? (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.round)(rect.height) : rect.height) / height; + + // 0, NaN, or Infinity should always fallback to 1. + + if (!x || !Number.isFinite(x)) { + x = 1; + } + if (!y || !Number.isFinite(y)) { + y = 1; + } + return { + x, + y + }; +} + +const noOffsets = /*#__PURE__*/(0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); +function getVisualOffsets(element) { + const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(element); + if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isWebKit)() || !win.visualViewport) { + return noOffsets; + } + return { + x: win.visualViewport.offsetLeft, + y: win.visualViewport.offsetTop + }; +} +function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { + if (isFixed === void 0) { + isFixed = false; + } + if (!floatingOffsetParent || isFixed && floatingOffsetParent !== (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(element)) { + return false; + } + return isFixed; +} + +function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { + if (includeScale === void 0) { + includeScale = false; + } + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + const clientRect = element.getBoundingClientRect(); + const domElement = unwrapElement(element); + let scale = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1); + if (includeScale) { + if (offsetParent) { + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(offsetParent)) { + scale = getScale(offsetParent); + } + } else { + scale = getScale(element); + } + } + const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); + let x = (clientRect.left + visualOffsets.x) / scale.x; + let y = (clientRect.top + visualOffsets.y) / scale.y; + let width = clientRect.width / scale.x; + let height = clientRect.height / scale.y; + if (domElement) { + const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(domElement); + const offsetWin = offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(offsetParent) ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(offsetParent) : offsetParent; + let currentWin = win; + let currentIFrame = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getFrameElement)(currentWin); + while (currentIFrame && offsetParent && offsetWin !== currentWin) { + const iframeScale = getScale(currentIFrame); + const iframeRect = currentIFrame.getBoundingClientRect(); + const css = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(currentIFrame); + const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; + const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; + x *= iframeScale.x; + y *= iframeScale.y; + width *= iframeScale.x; + height *= iframeScale.y; + x += left; + y += top; + currentWin = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(currentIFrame); + currentIFrame = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getFrameElement)(currentWin); + } + } + return (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.rectToClientRect)({ + width, + height, + x, + y + }); +} + +// If has a CSS width greater than the viewport, then this will be +// incorrect for RTL. +function getWindowScrollBarX(element, rect) { + const leftScroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeScroll)(element).scrollLeft; + if (!rect) { + return getBoundingClientRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element)).left + leftScroll; + } + return rect.left + leftScroll; +} + +function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) { + if (ignoreScrollbarX === void 0) { + ignoreScrollbarX = false; + } + const htmlRect = documentElement.getBoundingClientRect(); + const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : + // RTL scrollbar. + getWindowScrollBarX(documentElement, htmlRect)); + const y = htmlRect.top + scroll.scrollTop; + return { + x, + y + }; +} + +function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { + let { + elements, + rect, + offsetParent, + strategy + } = _ref; + const isFixed = strategy === 'fixed'; + const documentElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(offsetParent); + const topLayer = elements ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTopLayer)(elements.floating) : false; + if (offsetParent === documentElement || topLayer && isFixed) { + return rect; + } + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + let scale = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1); + const offsets = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); + const isOffsetParentAnElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(offsetParent); + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeName)(offsetParent) !== 'body' || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isOverflowElement)(documentElement)) { + scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeScroll)(offsetParent); + } + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(offsetParent)) { + const offsetRect = getBoundingClientRect(offsetParent); + scale = getScale(offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } + } + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); + return { + width: rect.width * scale.x, + height: rect.height * scale.y, + x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, + y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y + }; +} + +function getClientRects(element) { + return Array.from(element.getClientRects()); +} + +// Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable. +function getDocumentRect(element) { + const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element); + const scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeScroll)(element); + const body = element.ownerDocument.body; + const width = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); + const height = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); + let x = -scroll.scrollLeft + getWindowScrollBarX(element); + const y = -scroll.scrollTop; + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(body).direction === 'rtl') { + x += (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(html.clientWidth, body.clientWidth) - width; + } + return { + width, + height, + x, + y + }; +} + +function getViewportRect(element, strategy) { + const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(element); + const html = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element); + const visualViewport = win.visualViewport; + let width = html.clientWidth; + let height = html.clientHeight; + let x = 0; + let y = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + const visualViewportBased = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isWebKit)(); + if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + return { + width, + height, + x, + y + }; +} + +// Returns the inner client rect, subtracting scrollbars if present. +function getInnerBoundingClientRect(element, strategy) { + const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); + const top = clientRect.top + element.clientTop; + const left = clientRect.left + element.clientLeft; + const scale = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) ? getScale(element) : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(1); + const width = element.clientWidth * scale.x; + const height = element.clientHeight * scale.y; + const x = left * scale.x; + const y = top * scale.y; + return { + width, + height, + x, + y + }; +} +function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { + let rect; + if (clippingAncestor === 'viewport') { + rect = getViewportRect(element, strategy); + } else if (clippingAncestor === 'document') { + rect = getDocumentRect((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element)); + } else if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(clippingAncestor)) { + rect = getInnerBoundingClientRect(clippingAncestor, strategy); + } else { + const visualOffsets = getVisualOffsets(element); + rect = { + x: clippingAncestor.x - visualOffsets.x, + y: clippingAncestor.y - visualOffsets.y, + width: clippingAncestor.width, + height: clippingAncestor.height + }; + } + return (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.rectToClientRect)(rect); +} +function hasFixedPositionAncestor(element, stopNode) { + const parentNode = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getParentNode)(element); + if (parentNode === stopNode || !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(parentNode) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isLastTraversableNode)(parentNode)) { + return false; + } + return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); +} + +// A "clipping ancestor" is an `overflow` element with the characteristic of +// clipping (or hiding) child elements. This returns all clipping ancestors +// of the given element up the tree. +function getClippingElementAncestors(element, cache) { + const cachedResult = cache.get(element); + if (cachedResult) { + return cachedResult; + } + let result = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getOverflowAncestors)(element, [], false).filter(el => (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(el) && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeName)(el) !== 'body'); + let currentContainingBlockComputedStyle = null; + const elementIsFixed = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(element).position === 'fixed'; + let currentNode = elementIsFixed ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getParentNode)(element) : element; + + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + while ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(currentNode) && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isLastTraversableNode)(currentNode)) { + const computedStyle = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(currentNode); + const currentNodeIsContaining = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isContainingBlock)(currentNode); + if (!currentNodeIsContaining && computedStyle.position === 'fixed') { + currentContainingBlockComputedStyle = null; + } + const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isOverflowElement)(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); + if (shouldDropCurrentNode) { + // Drop non-containing blocks. + result = result.filter(ancestor => ancestor !== currentNode); + } else { + // Record last containing block for next iteration. + currentContainingBlockComputedStyle = computedStyle; + } + currentNode = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getParentNode)(currentNode); + } + cache.set(element, result); + return result; +} + +// Gets the maximum area that the element is visible in due to any number of +// clipping ancestors. +function getClippingRect(_ref) { + let { + element, + boundary, + rootBoundary, + strategy + } = _ref; + const elementClippingAncestors = boundary === 'clippingAncestors' ? (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTopLayer)(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); + const clippingAncestors = [...elementClippingAncestors, rootBoundary]; + const firstClippingAncestor = clippingAncestors[0]; + const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { + const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); + accRect.top = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(rect.top, accRect.top); + accRect.right = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.min)(rect.right, accRect.right); + accRect.bottom = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.min)(rect.bottom, accRect.bottom); + accRect.left = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(rect.left, accRect.left); + return accRect; + }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); + return { + width: clippingRect.right - clippingRect.left, + height: clippingRect.bottom - clippingRect.top, + x: clippingRect.left, + y: clippingRect.top + }; +} + +function getDimensions(element) { + const { + width, + height + } = getCssDimensions(element); + return { + width, + height + }; +} + +function getRectRelativeToOffsetParent(element, offsetParent, strategy) { + const isOffsetParentAnElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(offsetParent); + const documentElement = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(offsetParent); + const isFixed = strategy === 'fixed'; + const rect = getBoundingClientRect(element, true, isFixed, offsetParent); + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + const offsets = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeName)(offsetParent) !== 'body' || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isOverflowElement)(documentElement)) { + scroll = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getNodeScroll)(offsetParent); + } + if (isOffsetParentAnElement) { + const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } else if (documentElement) { + // If the scrollbar appears on the left (e.g. RTL systems). Use + // Firefox with layout.scrollbar.side = 3 in about:config to test this. + offsets.x = getWindowScrollBarX(documentElement); + } + } + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.createCoords)(0); + const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; + const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; + return { + x, + y, + width: rect.width, + height: rect.height + }; +} + +function isStaticPositioned(element) { + return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(element).position === 'static'; +} + +function getTrueOffsetParent(element, polyfill) { + if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(element).position === 'fixed') { + return null; + } + if (polyfill) { + return polyfill(element); + } + let rawOffsetParent = element.offsetParent; + + // Firefox returns the element as the offsetParent if it's non-static, + // while Chrome and Safari return the element. The element must + // be used to perform the correct calculations even if the element is + // non-static. + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element) === rawOffsetParent) { + rawOffsetParent = rawOffsetParent.ownerDocument.body; + } + return rawOffsetParent; +} + +// Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. +function getOffsetParent(element, polyfill) { + const win = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getWindow)(element); + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTopLayer)(element)) { + return win; + } + if (!(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) { + let svgOffsetParent = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getParentNode)(element); + while (svgOffsetParent && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isLastTraversableNode)(svgOffsetParent)) { + if ((0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement)(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { + return svgOffsetParent; + } + svgOffsetParent = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getParentNode)(svgOffsetParent); + } + return win; + } + let offsetParent = getTrueOffsetParent(element, polyfill); + while (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTableElement)(offsetParent) && isStaticPositioned(offsetParent)) { + offsetParent = getTrueOffsetParent(offsetParent, polyfill); + } + if (offsetParent && (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isLastTraversableNode)(offsetParent) && isStaticPositioned(offsetParent) && !(0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isContainingBlock)(offsetParent)) { + return win; + } + return offsetParent || (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getContainingBlock)(element) || win; +} + +const getElementRects = async function (data) { + const getOffsetParentFn = this.getOffsetParent || getOffsetParent; + const getDimensionsFn = this.getDimensions; + const floatingDimensions = await getDimensionsFn(data.floating); + return { + reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), + floating: { + x: 0, + y: 0, + width: floatingDimensions.width, + height: floatingDimensions.height + } + }; +}; + +function isRTL(element) { + return (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getComputedStyle)(element).direction === 'rtl'; +} + +const platform = { + convertOffsetParentRelativeRectToViewportRelativeRect, + getDocumentElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement, + getClippingRect, + getOffsetParent, + getElementRects, + getClientRects, + getDimensions, + getScale, + isElement: _floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isElement, + isRTL +}; + +function rectsAreEqual(a, b) { + return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; +} + +// https://samthor.au/2021/observing-dom/ +function observeMove(element, onMove) { + let io = null; + let timeoutId; + const root = (0,_floating_ui_utils_dom__WEBPACK_IMPORTED_MODULE_0__.getDocumentElement)(element); + function cleanup() { + var _io; + clearTimeout(timeoutId); + (_io = io) == null || _io.disconnect(); + io = null; + } + function refresh(skip, threshold) { + if (skip === void 0) { + skip = false; + } + if (threshold === void 0) { + threshold = 1; + } + cleanup(); + const elementRectForRootMargin = element.getBoundingClientRect(); + const { + left, + top, + width, + height + } = elementRectForRootMargin; + if (!skip) { + onMove(); + } + if (!width || !height) { + return; + } + const insetTop = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.floor)(top); + const insetRight = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientWidth - (left + width)); + const insetBottom = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.floor)(root.clientHeight - (top + height)); + const insetLeft = (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.floor)(left); + const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; + const options = { + rootMargin, + threshold: (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.max)(0, (0,_floating_ui_utils__WEBPACK_IMPORTED_MODULE_1__.min)(1, threshold)) || 1 + }; + let isFirstUpdate = true; + function handleObserve(entries) { + const ratio = entries[0].intersectionRatio; + if (ratio !== threshold) { + if (!isFirstUpdate) { + return refresh(); + } + if (!ratio) { + // If the reference is clipped, the ratio is 0. Throttle the refresh + // to prevent an infinite loop of updates. + timeoutId = setTimeout(() => { + refresh(false, 1e-7); + }, 1000); + } else { + refresh(false, ratio); + } + } + if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { + // It's possible that even though the ratio is reported as 1, the + // element is not actually fully within the IntersectionObserver's root + // area anymore. This can happen under performance constraints. This may + // be a bug in the browser's IntersectionObserver implementation. To + // work around this, we compare the element's bounding rect now with + // what it was at the time we created the IntersectionObserver. If they + // are not equal then the element moved, so we refresh. + refresh(); + } + isFirstUpdate = false; + } + + // Older browsers don't support a `document` as the root and will throw an + // error. + try { + io = new IntersectionObserver(handleObserve, { + ...options, + // Handle