diff --git a/Config/module.xml b/Config/module.xml index 490e310..5fafb52 100755 --- a/Config/module.xml +++ b/Config/module.xml @@ -20,7 +20,7 @@ en_US fr_FR - 1.2.4 + 1.2.5 diff --git a/package-lock.json b/package-lock.json index 487a387..3a24f87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@thelia/blocks-editor": "^1.3.5", - "@thelia/media-library": "^1.1.1" + "@thelia/media-library": "^1.1.2" }, "devDependencies": { "gulp": "^4.0.2", @@ -67,9 +67,9 @@ } }, "node_modules/@thelia/media-library": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.1.2.tgz", - "integrity": "sha512-TIlJFuQoXhMIahwCPmQsQ/gOJcYDPgqH0MHfZWyI1ArNlGIlS8j+JPwVoU/uF70udulf3kjgEV2w+Zf8eGHXnQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.1.3.tgz", + "integrity": "sha512-XOaoCVkpFjdaZAkNJVA27DSvIlt3UHY/idhKIvSAIiSZb+EiE0uFhYf1kVPEONQz1WIllkOWr86AAZXcUewFEw==", "dependencies": { "@thelia/blocks-editor": "*", "@thelia/fetcher": "*", @@ -4524,9 +4524,9 @@ } }, "@thelia/media-library": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.1.2.tgz", - "integrity": "sha512-TIlJFuQoXhMIahwCPmQsQ/gOJcYDPgqH0MHfZWyI1ArNlGIlS8j+JPwVoU/uF70udulf3kjgEV2w+Zf8eGHXnQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.1.3.tgz", + "integrity": "sha512-XOaoCVkpFjdaZAkNJVA27DSvIlt3UHY/idhKIvSAIiSZb+EiE0uFhYf1kVPEONQz1WIllkOWr86AAZXcUewFEw==", "requires": { "@thelia/blocks-editor": "*", "@thelia/fetcher": "*", diff --git a/package.json b/package.json index 1b9791a..1cd5270 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,6 @@ }, "dependencies": { "@thelia/blocks-editor": "^1.3.5", - "@thelia/media-library": "^1.1.2" + "@thelia/media-library": "^1.1.3" } } diff --git a/templates/backOffice/default/tb-plugin/vendor/index.css b/templates/backOffice/default/tb-plugin/vendor/index.css index 3986c9e..eb691a9 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.css +++ b/templates/backOffice/default/tb-plugin/vendor/index.css @@ -1,2 +1,488 @@ -.Input{&__Wrapper{@apply relative;&__Header{@apply flex justify-between;}&__Error{@apply text-error mt-1 text-sm;}}&__Text{@apply relative w-full rounded-md border border-mediumGrey outline-none py-2 px-4;height:40px;&__Wrapper{@apply relative w-full flex flex-wrap items-stretch;}&:hover,&:focus{@apply border-darkCharbon;}&--withIcon{@apply pl-10;}&--withIcons{@apply px-10;}&--emphasize{@apply text-vermillon;}}&__Select{background:url("data:image/svg+xml,") no-repeat;background-color:#fff;background-position:calc(100% - 12px) center;-moz-appearance:none;-webkit-appearance:none;appearance:none;&__Separator{@apply absolute h-6 bg-darkCharbon bottom-2 right-8 z-10;width:1px}}&__Icon{@apply absolute py-1 h-full leading-snug rounded text-base font-normal text-center flex items-center justify-center;&--left{@apply left-0 pr-5 pl-4;}&--right{@apply right-0 pr-4 pl-5;}}}.Modal-Library{position:absolute;inset:0;margin:auto;height:max-content;width:90%;max-height:90%;overflow:auto;border-radius:8px;background-color:#fff;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.35s}.Modal-Upload{position:absolute;inset:0;margin:auto;height:max-content;width:50%;max-height:90%;overflow:auto;border-radius:8px;background-color:#fff;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.35s}.Modal-Tags{position:absolute;inset:0;margin:auto;width:max-content;max-width:700px;height:max-content;max-height:80%;border-radius:8px;background-color:#fff}.Modal__Content__Loader{display:flex;flex-direction:column;gap:12px;width:100%;text-align:center}.Modal__Content__Loader span{display:block}.Library__NoContent{width:100%;text-align:center}.Library{display:flex;flex-direction:column;gap:30px}.Library__Filters{display:flex;gap:15px}.Library__Filters .Input__Wrapper{width:400px}.Library__Content{display:flex;flex-wrap:wrap;gap:16px}.Library__Image{display:flex;flex-direction:column;max-width:160px;height:max-content;border:1px solid #EBEBEB;border-radius:4px;position:relative;justify-content:center;align-items:center;gap:10px;padding-bottom:16px}.Library__Image img{border-radius:4px;object-fit:contain}.Library__Image__Title{text-align:center;overflow:hidden;white-space:nowrap;font-weight:600;text-overflow:ellipsis;max-width:130px}.Library__Image__Action__Title{text-align:center;overflow:hidden;white-space:nowrap;font-weight:600;text-overflow:ellipsis;max-width:120px;color:#fff}.Library__Image__Tags{position:absolute;display:flex;justify-content:flex-end;gap:4px;flex-wrap:wrap;top:7px;right:7px}.Library__Image__Tag{width:50px;height:20px;border-radius:20px;text-align:center;letter-spacing:.05em;font-size:10px;font-weight:600;text-transform:uppercase;background-color:#fff;text-overflow:ellipsis;overflow:hidden;padding:1px 3px}.Library__Image__Actions{display:none;position:absolute;background-color:#000000e6;height:100%;width:100%;top:0;border-radius:4px}.Library__Image__Actions__Wrapper{display:flex;gap:.5rem}.Library__Add__Button{display:flex;align-items:center;justify-content:center;color:#fff;border-radius:100%;background-color:#d21919;cursor:pointer}.Library__Add__Button:disabled{background-color:#ebebeb;color:#fff}.Library__Add__Button:enabled:hover{background-color:#fa533c;color:#fff}.Library__Add__Button:hover{background-color:transparent;color:#222}.Library__Image:hover .Library__Image__Actions{display:flex;flex-direction:column;justify-content:center;align-items:center}.Library__Image__Select__Action{background:transparent;border:1px solid #fff;color:#fff;text-transform:uppercase;padding:6px 15px;letter-spacing:.05em;font-size:12px;font-weight:600;border-radius:4px}.Library__Image__Select__Action:hover{background:#fff;color:#000}.Library__Image__Delete__Action{background-color:#d21919;border-radius:100%;width:30px;height:30px;color:#fff}.Library__Image__Tag__Action{background-color:#008958;border-radius:100%;width:30px;height:30px;color:#fff}.BlockImage__TagSelector{display:flex;align-items:center;position:relative;border-radius:6px;outline:none;border:1px solid #9B9B9B;height:max-content;min-height:40px;padding:5px}.BlockImage__TagSelector__Add{position:absolute;bottom:3px;right:3px;width:32px;height:32px;display:flex;justify-content:center;align-items:center;color:#fff;border-radius:4px;background-color:#444}.BlockImage__TagSelector__Add:hover{background-color:#333}.BlockImage__TagSelector__Tags{display:flex;flex-wrap:wrap;gap:6px}.BlockImage__TagSelector__Tag{max-width:100px;width:max-content;max-height:30px;text-overflow:ellipsis;overflow:hidden;border-radius:90px;display:flex;justify-content:space-between;background-color:#333;color:#fff;align-items:center;padding:4px 4px 4px 14px}.BlockImage__TagSelector__Tag>span{font-weight:600;font-size:14px;margin-right:7px}.BlockImage__TagSelector__Tag__Remove{background-color:#fff;color:#111;border-radius:90px;height:20px;width:20px;display:flex;justify-content:center;align-items:center}.TagList{top:100%;left:0;background-color:#fff;border-radius:6px;overflow:auto;width:100%;position:absolute;z-index:30;max-height:200px;box-shadow:0 0 8px #00000040}.TagList__Item{cursor:pointer;display:flex;flex-direction:column;padding:20px 15px}.Select__Wrapper{position:relative;width:250px}@media screen and (max-width: 768px){.Library__Image__Title{max-width:100px}.Library__Filters{flex-direction:column}.Library__Filters .Input__Wrapper,.Library__Filters .Select__Wrapper{width:auto}.Library__Item{padding:0}}.BlockImage__Upload__Wrapper{display:flex;gap:16px;text-align:center}.BlockImage__FromLibrary{display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:#fff;border-radius:4px;padding:50px 20px;height:200px}.BlockImage__FromLibrary__Icon{background-color:#f5f5f5;padding:10px;border-radius:100%;margin-bottom:10px}.BlockImage__FromLocal{display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:4px;padding:50px 20px;height:200px;border:1px dashed #787878}.BlockImage__FromLocal.BlockImage__FromLocal--active{border:2px dashed #dc3018}input.BlockImage__FromLocal__FileInput{display:none}.BlockImage__Button{display:block;cursor:pointer;color:#dc3018;font-weight:600;font-size:12px;line-height:16px;text-align:center;letter-spacing:.05em;text-transform:uppercase;border:1px solid #dc3018;border-radius:4px;padding:6px 15px}.BlockImage__Button:hover{background-color:#dc3018;color:#fff}.BlockImage__FromLocal__Icon{margin-bottom:10px}.BlockImage__Infos__Form{display:flex;flex-direction:column;justify-content:center;gap:16px;width:100%}.BlockImage__Preview{padding:20px;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:#fff;border-radius:4px;gap:18px;max-width:290px}.BlockImage__Preview__Infos{width:100%}.BlockImage__Preview img{border:1px solid #EBEBEB;padding:5px;border-radius:4px}.BlockImage__Preview__FileName{display:block;font-weight:600;font-size:14px;line-height:19px;color:#333;margin-bottom:10px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.BlockImage__Infos{display:flex;gap:40px}.BlockImage__Upload--light .BlockImage__FromLocal,.BlockImage__Upload--light .BlockImage__FromLibrary{border:none;background-color:inherit;padding:0;width:auto;height:auto}.BlockImage__Upload--light .BlockImage__FromLocal .BlockImage__FromLocal__Icon,.BlockImage__Upload--light .BlockImage__FromLibrary .BlockImage__FromLibrary__Icon{display:none}@media screen and (max-width: 1366px){.BlockImage__Upload__Wrapper{flex-direction:column}.BlockImage__FromLibrary,.BlockImage__FromLocal{width:100%}.BlockImage__Infos{flex-direction:column}} +/* src/Input/Inputs.css */ +.Input { + &__Wrapper { + @apply relative; + &__Header { + @apply flex justify-between; + } + &__Error { + @apply text-error mt-1 text-sm; + } + } + &__Text { + @apply relative w-full rounded-md border border-mediumGrey outline-none py-2 px-4; + height: 40px; + &__Wrapper { + @apply relative w-full flex flex-wrap items-stretch; + } + &:hover, + &:focus { + @apply border-darkCharbon; + } + &--withIcon { + @apply pl-10; + } + &--withIcons { + @apply px-10; + } + &--emphasize { + @apply text-vermillon; + } + } + &__Select { + background: url("data:image/svg+xml,") no-repeat; + background-color: white; + background-position: calc(100% - 12px) center; + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + &__Separator { + @apply absolute h-6 bg-darkCharbon bottom-2 right-8 z-10; + width: 1px; + } + } + &__Icon { + @apply absolute py-1 h-full leading-snug rounded text-base font-normal text-center flex items-center justify-center; + &--left { + @apply left-0 pr-5 pl-4; + } + &--right { + @apply right-0 pr-4 pl-5; + } + } +} + +/* src/Library/Library.css */ +.Modal-Library { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + height: max-content; + width: 90%; + max-height: 90%; + overflow: auto; + border-radius: 8px; + background-color: white; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 350ms; +} +.Modal-Upload { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + height: max-content; + width: 50%; + max-height: 90%; + overflow: auto; + border-radius: 8px; + background-color: white; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 350ms; +} +.Modal-Tags { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: max-content; + max-width: 700px; + height: max-content; + max-height: 80%; + border-radius: 8px; + background-color: white; +} +.Modal__Content__Loader { + display: flex; + flex-direction: column; + gap: 12px; + width: 100%; + text-align: center; +} +.Modal__Content__Loader span { + display: block; +} +.Library__NoContent { + width: 100%; + text-align: center; +} +.Library { + display: flex; + flex-direction: column; + gap: 30px; +} +.Library__Filters { + display: flex; + gap: 15px; +} +.Library__Filters .Input__Wrapper { + width: 400px; +} +.Library__Content { + display: flex; + flex-wrap: wrap; + gap: 16px; +} +.Library__Image { + display: flex; + flex-direction: column; + max-width: 160px; + height: max-content; + border: 1px solid #EBEBEB; + border-radius: 4px; + position: relative; + justify-content: center; + align-items: center; + gap: 10px; + padding-bottom: 16px; +} +.Library__Image img { + border-radius: 4px; + object-fit: contain; +} +.Library__Image__Title { + text-align: center; + overflow: hidden; + white-space: nowrap; + font-weight: 600; + text-overflow: ellipsis; + max-width: 130px; +} +.Library__Image__Action__Title { + text-align: center; + overflow: hidden; + white-space: nowrap; + font-weight: 600; + text-overflow: ellipsis; + max-width: 120px; + color: white; +} +.Library__Image__Tags { + position: absolute; + display: flex; + justify-content: flex-end; + gap: 4px; + flex-wrap: wrap; + top: 7px; + right: 7px; +} +.Library__Image__Tag { + width: 50px; + height: 20px; + border-radius: 20px; + text-align: center; + letter-spacing: 0.05em; + font-size: 10px; + font-weight: 600; + text-transform: uppercase; + background-color: white; + text-overflow: ellipsis; + overflow: hidden; + padding: 1px 3px; +} +.Library__Image__Actions { + display: none; + position: absolute; + background-color: rgba(0, 0, 0, 0.9); + height: 100%; + width: 100%; + top: 0; + border-radius: 4px; +} +.Library__Image__Actions__Wrapper { + display: flex; + gap: 0.5rem; +} +.Library__Add__Button { + display: flex; + align-items: center; + justify-content: center; + color: #fff; + border-radius: 100%; + background-color: #D21919; + cursor: pointer; +} +.Library__Add__Button:disabled { + background-color: #EBEBEB; + color: #fff; +} +.Library__Add__Button:enabled:hover { + background-color: #FA533C; + color: #fff; +} +.Library__Add__Button:hover { + background-color: transparent; + color: #222222; +} +.Library__Image:hover .Library__Image__Actions { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.Library__Image__Select__Action { + background: transparent; + border: 1px solid #fff; + color: #fff; + text-transform: uppercase; + padding: 6px 15px; + letter-spacing: 0.05em; + font-size: 12px; + font-weight: 600; + border-radius: 4px; +} +.Library__Image__Select__Action:hover { + background: #fff; + color: #000; +} +.Library__Image__Delete__Action { + background-color: #D21919; + border-radius: 100%; + width: 30px; + height: 30px; + color: #fff; +} +.Library__Image__Tag__Action { + background-color: #008958; + border-radius: 100%; + width: 30px; + height: 30px; + color: #fff; +} +.BlockImage__TagSelector { + display: flex; + align-items: center; + position: relative; + border-radius: 6px; + outline: none; + border: 1px solid #9B9B9B; + height: max-content; + min-height: 40px; + padding: 5px; +} +.BlockImage__TagSelector__Add { + position: absolute; + bottom: 3px; + right: 3px; + width: 32px; + height: 32px; + display: flex; + justify-content: center; + align-items: center; + color: white; + border-radius: 4px; + background-color: #444444; +} +.BlockImage__TagSelector__Add:hover { + background-color: #333333; +} +.BlockImage__TagSelector__Tags { + display: flex; + flex-wrap: wrap; + gap: 6px; +} +.BlockImage__TagSelector__Tag { + max-width: 100px; + width: max-content; + max-height: 30px; + text-overflow: ellipsis; + overflow: hidden; + border-radius: 90px; + display: flex; + justify-content: space-between; + background-color: #333333; + color: white; + align-items: center; + padding: 4px; + padding-left: 14px; +} +.BlockImage__TagSelector__Tag > span { + font-weight: 600; + font-size: 14px; + margin-right: 7px; +} +.BlockImage__TagSelector__Tag__Remove { + background-color: white; + color: #111; + border-radius: 90px; + height: 20px; + width: 20px; + display: flex; + justify-content: center; + align-items: center; +} +.TagList { + top: 100%; + left: 0; + background-color: white; + border-radius: 6px; + overflow: auto; + width: 100%; + position: absolute; + z-index: 30; + max-height: 200px; + box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.25); +} +.TagList__Item { + cursor: pointer; + display: flex; + flex-direction: column; + padding: 20px 15px; +} +.Select__Wrapper { + position: relative; + width: 250px; +} +@media screen and (max-width: 768px) { + .Library__Image__Title { + max-width: 100px; + } + .Library__Filters { + flex-direction: column; + } + .Library__Filters .Input__Wrapper, + .Library__Filters .Select__Wrapper { + width: auto; + } + .Library__Item { + padding: 0px; + } +} + +/* src/Image/Image.css */ +.BlockImage__Upload__Wrapper { + display: flex; + gap: 16px; + text-align: center; +} +.BlockImage__FromLibrary { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #fff; + border-radius: 4px; + padding: 50px 20px; + height: 200px; +} +.BlockImage__FromLibrary__Icon { + background-color: #f5f5f5; + padding: 10px; + border-radius: 100%; + margin-bottom: 10px; +} +.BlockImage__FromLocal { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + border-radius: 4px; + padding: 50px 20px; + height: 200px; + border: 1px dashed #787878; +} +.BlockImage__FromLocal.BlockImage__FromLocal--active { + border: 2px dashed #dc3018; +} +input.BlockImage__FromLocal__FileInput { + display: none; +} +.BlockImage__Button { + display: block; + cursor: pointer; + color: #dc3018; + font-weight: 600; + font-size: 12px; + line-height: 16px; + text-align: center; + letter-spacing: 0.05em; + text-transform: uppercase; + border: 1px solid #dc3018; + border-radius: 4px; + padding: 6px 15px; +} +.BlockImage__Button:hover { + background-color: #dc3018; + color: #fff; +} +.BlockImage__FromLocal__Icon { + margin-bottom: 10px; +} +.BlockImage__Infos__Form { + display: flex; + flex-direction: column; + justify-content: center; + gap: 16px; + width: 100%; +} +.BlockImage__Preview { + padding: 20px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: #fff; + border-radius: 4px; + gap: 18px; + max-width: 290px; +} +.BlockImage__Preview__Infos { + width: 100%; +} +.BlockImage__Preview img { + border: 1px solid #EBEBEB; + padding: 5px; + border-radius: 4px; +} +.BlockImage__Preview__FileName { + display: block; + font-weight: 600; + font-size: 14px; + line-height: 19px; + color: #333333; + margin-bottom: 10px; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.BlockImage__Infos { + display: flex; + gap: 40px; +} +.BlockImage__Upload--light .BlockImage__FromLocal, +.BlockImage__Upload--light .BlockImage__FromLibrary { + border: none; + background-color: inherit; + padding: 0px; + width: auto; + height: auto; +} +.BlockImage__Upload--light .BlockImage__FromLocal .BlockImage__FromLocal__Icon, +.BlockImage__Upload--light .BlockImage__FromLibrary .BlockImage__FromLibrary__Icon { + display: none; +} +@media screen and (max-width: 1366px) { + .BlockImage__Upload__Wrapper { + flex-direction: column; + } + .BlockImage__FromLibrary { + width: 100%; + } + .BlockImage__FromLocal { + width: 100%; + } + .BlockImage__Infos { + flex-direction: column; + } +} /*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/templates/backOffice/default/tb-plugin/vendor/index.css.map b/templates/backOffice/default/tb-plugin/vendor/index.css.map index b215bce..de70251 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.css.map +++ b/templates/backOffice/default/tb-plugin/vendor/index.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/Input/Inputs.css","../src/Library/Library.css","../src/Image/Image.css"],"sourcesContent":[".Input {\n &__Wrapper {\n @apply relative;\n\n &__Header {\n @apply flex justify-between;\n }\n \n &__Error {\n @apply text-error mt-1 text-sm;\n }\n }\n\n &__Text {\n @apply relative w-full rounded-md border border-mediumGrey outline-none py-2 px-4;\n height: 40px;\n \n &__Wrapper {\n @apply relative w-full flex flex-wrap items-stretch;\n }\n\n &:hover, &:focus {\n @apply border-darkCharbon;\n }\n\n /* &:focus {\n @apply outline-vermillon outline-1 outline-offset-1;\n } */\n \n &--withIcon {\n @apply pl-10;\n }\n \n &--withIcons {\n @apply px-10;\n }\n\n &--emphasize {\n @apply text-vermillon;\n }\n }\n\n &__Select {\n background: url(\"data:image/svg+xml,\") no-repeat;\n background-color: white;\n background-position: calc(100% - 12px) center;\n -moz-appearance:none;\n -webkit-appearance: none; \n appearance: none;\n\n &__Separator {\n @apply absolute h-6 bg-darkCharbon bottom-2 right-8 z-10;\n width: 1px;\n }\n }\n\n &__Icon {\n @apply absolute py-1 h-full leading-snug rounded text-base font-normal text-center flex items-center justify-center;\n\n &--left {\n @apply left-0 pr-5 pl-4;\n }\n\n &--right {\n @apply right-0 pr-4 pl-5;\n }\n }\n}\n",".Modal-Library {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n height: max-content;\n width: 90%;\n max-height: 90%;\n overflow: auto;\n border-radius: 8px;\n background-color: white;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 350ms;\n}\n\n.Modal-Upload {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n height: max-content;\n width: 50%;\n max-height: 90%;\n overflow: auto;\n border-radius: 8px;\n background-color: white;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 350ms;\n}\n\n.Modal-Tags {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n width: max-content;\n max-width: 700px;\n height: max-content;\n max-height: 80%;\n border-radius: 8px;\n background-color: white;\n}\n\n.Modal__Content__Loader {\n display: flex;\n flex-direction: column;\n gap: 12px;\n width: 100%;\n text-align: center;\n}\n\n.Modal__Content__Loader span {\n display: block;\n}\n\n.Library__NoContent {\n width: 100%;\n text-align: center;\n}\n\n.Library {\n display: flex;\n flex-direction: column;\n gap: 30px;\n}\n\n.Library__Filters {\n display: flex;\n gap: 15px;\n}\n\n.Library__Filters .Input__Wrapper {\n width: 400px\n}\n\n.Library__Content {\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n}\n\n.Library__Image {\n display: flex;\n flex-direction: column;\n max-width: 160px;\n height: max-content;\n border: 1px solid #EBEBEB;\n border-radius: 4px;\n position: relative;\n justify-content: center;\n align-items: center;\n gap: 10px;\n padding-bottom: 16px;\n}\n\n.Library__Image img {\n border-radius: 4px;\n object-fit: contain;\n}\n\n.Library__Image__Title {\n text-align: center;\n overflow: hidden;\n white-space: nowrap;\n font-weight: 600;\n text-overflow: ellipsis;\n max-width: 130px;\n}\n\n.Library__Image__Action__Title {\n text-align: center;\n overflow: hidden;\n white-space: nowrap;\n font-weight: 600;\n text-overflow: ellipsis;\n max-width: 120px;\n color: white;\n}\n\n.Library__Image__Tags {\n position: absolute;\n display: flex;\n justify-content: flex-end;\n gap: 4px; \n flex-wrap: wrap;\n top: 7px;\n right: 7px;\n}\n\n.Library__Image__Tag {\n width: 50px;\n height: 20px;\n border-radius: 20px;\n text-align: center;\n letter-spacing: 0.05em;\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n background-color: white;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 1px 3px;\n}\n\n.Library__Image__Actions {\n display: none;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.9);\n height: 100%;\n width: 100%;\n top: 0;\n border-radius: 4px;\n}\n\n.Library__Image__Actions__Wrapper {\n display: flex;\n gap: 0.5rem;\n}\n\n.Library__Add__Button {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n border-radius: 100%;\n background-color: #D21919;\n cursor: pointer;\n}\n\n.Library__Add__Button:disabled {\n background-color: #EBEBEB;\n color: #fff;\n}\n\n.Library__Add__Button:enabled:hover {\n background-color: #FA533C;\n color: #fff;\n}\n\n.Library__Add__Button:hover {\n background-color: transparent;\n color: #222222;\n}\n\n.Library__Image:hover .Library__Image__Actions {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.Library__Image__Select__Action {\n background: transparent;\n border: 1px solid #fff;\n color: #fff;\n text-transform: uppercase;\n padding: 6px 15px;\n letter-spacing: 0.05em;\n font-size: 12px;\n font-weight: 600;\n border-radius: 4px;\n}\n\n.Library__Image__Select__Action:hover {\n background: #fff;\n color: #000;\n}\n\n.Library__Image__Delete__Action {\n background-color: #D21919;\n border-radius: 100%;\n width: 30px;\n height: 30px;\n color: #fff;\n}\n\n.Library__Image__Tag__Action {\n background-color: #008958;\n border-radius: 100%;\n width: 30px;\n height: 30px;\n color: #fff;\n}\n\n.BlockImage__TagSelector {\n display: flex;\n align-items: center;\n position: relative;\n border-radius: 6px;\n outline: none;\n border: 1px solid #9B9B9B;\n height: max-content;\n min-height: 40px;\n padding: 5px;\n}\n\n.BlockImage__TagSelector__Add {\n position: absolute;\n bottom: 3px;\n right: 3px;\n width: 32px;\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n border-radius: 4px;\n background-color: #444444;\n}\n\n.BlockImage__TagSelector__Add:hover {\n background-color: #333333;\n}\n\n.BlockImage__TagSelector__Tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.BlockImage__TagSelector__Tag {\n max-width: 100px;\n width: max-content;\n max-height: 30px;\n text-overflow: ellipsis;\n overflow: hidden;\n border-radius: 90px;\n display: flex;\n justify-content: space-between;\n background-color: #333333;\n color: white;\n align-items: center;\n padding: 4px;\n padding-left: 14px;\n}\n\n.BlockImage__TagSelector__Tag > span {\n font-weight: 600;\n font-size: 14px;\n margin-right: 7px;\n}\n\n.BlockImage__TagSelector__Tag__Remove {\n background-color: white;\n color: #111;\n border-radius: 90px;\n height: 20px;\n width: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.TagList {\n top: 100%;\n left: 0;\n background-color: white;\n border-radius: 6px;\n overflow: auto;\n width: 100%;\n position: absolute;\n z-index: 30;\n max-height: 200px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.25);\n}\n\n.TagList__Item {\n cursor: pointer;\n display: flex;\n flex-direction: column;\n padding: 20px 15px;\n}\n\n.Select__Wrapper {\n position: relative;\n width: 250px;\n}\n\n@media screen and (max-width: 768px) {\n .Library__Image__Title {\n max-width: 100px;\n }\n\n .Library__Filters {\n flex-direction: column;\n }\n\n .Library__Filters .Input__Wrapper, .Library__Filters .Select__Wrapper {\n width: auto;\n }\n\n .Library__Item {\n padding: 0px;\n }\n}\n",".BlockImage__Upload__Wrapper {\n display: flex;\n gap: 16px;\n text-align: center;\n}\n\n.BlockImage__FromLibrary {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: #fff;\n border-radius: 4px;\n padding: 50px 20px;\n height: 200px;\n}\n\n.BlockImage__FromLibrary__Icon {\n background-color: #f5f5f5;\n padding: 10px;\n border-radius: 100%;\n margin-bottom: 10px;\n}\n\n.BlockImage__FromLocal {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 4px;\n padding: 50px 20px;\n height: 200px;\n border: 1px dashed #787878;\n}\n\n.BlockImage__FromLocal.BlockImage__FromLocal--active {\n border: 2px dashed #dc3018;\n}\n\ninput.BlockImage__FromLocal__FileInput {\n display: none;\n}\n\n.BlockImage__Button {\n display: block;\n cursor: pointer;\n color: #dc3018;\n font-weight: 600;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n border: 1px solid #dc3018;\n border-radius: 4px;\n padding: 6px 15px;\n}\n\n.BlockImage__Button:hover {\n background-color: #dc3018;\n color: #fff;\n}\n\n.BlockImage__FromLocal__Icon {\n margin-bottom: 10px;\n}\n\n.BlockImage__Infos__Form {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n width: 100%;\n}\n\n.BlockImage__Preview {\n padding: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: #fff;\n border-radius: 4px;\n gap: 18px;\n max-width: 290px;\n}\n\n.BlockImage__Preview__Infos {\n width: 100%;\n}\n\n.BlockImage__Preview img {\n border: 1px solid #EBEBEB;\n padding: 5px;\n border-radius: 4px;\n}\n\n.BlockImage__Preview__FileName {\n display: block;\n font-weight: 600;\n font-size: 14px;\n line-height: 19px;\n color: #333333;\n margin-bottom: 10px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.BlockImage__Infos {\n display: flex;\n gap: 40px;\n}\n\n.BlockImage__Upload--light .BlockImage__FromLocal, .BlockImage__Upload--light .BlockImage__FromLibrary {\n border: none;\n background-color: inherit;\n padding: 0px;\n width: auto;\n height: auto;\n}\n\n.BlockImage__Upload--light .BlockImage__FromLocal .BlockImage__FromLocal__Icon, .BlockImage__Upload--light .BlockImage__FromLibrary .BlockImage__FromLibrary__Icon {\n display: none;\n}\n\n@media screen and (max-width: 1366px) {\n .BlockImage__Upload__Wrapper {\n flex-direction: column;\n }\n\n .BlockImage__FromLibrary {\n width: 100%;\n }\n\n .BlockImage__FromLocal {\n width: 100%;\n }\n\n .BlockImage__Infos {\n flex-direction: column;\n }\n} "],"mappings":"AAAA,OACE,WACE,gBAEA,UACE,6BAGF,SACE,iCAIJ,QACE,kFACA,YAEA,WACE,qDAGF,gBACE,2BAOF,YACE,cAGF,aACE,cAGF,aACE,wBAIJ,UACE,2RACA,sBACA,6CACA,qBACA,wBACA,gBAEA,aACE,yDACA,WAIJ,QACE,oHAEA,QACE,yBAGF,SACE,4BChEN,eACE,kBADF,oBAOE,mBACA,UACA,eACA,cAVF,kBAYE,sBACA,wBACA,mDACA,yBAGF,cACE,kBAnBF,oBAyBE,mBACA,UACA,eACA,cA5BF,kBA8BE,sBACA,wBACA,mDACA,yBAGF,YACE,kBArCF,oBA2CE,kBACA,gBACA,mBACA,eA9CF,kBAgDE,sBAGF,wBACE,aACA,sBACA,SACA,WACA,kBAGF,6BACE,cAGF,oBACE,WACA,kBAGF,SACE,aACA,sBACA,SAGF,kBACE,aACA,SAGF,kCACE,YAGF,kBACE,aACA,eACA,SAGF,gBACE,aACA,sBACA,gBACA,mBACA,yBA9FF,kBAgGE,kBACA,uBACA,mBACA,SACA,oBAGF,oBAvGA,kBAyGE,mBAGF,uBACE,kBACA,gBACA,mBACA,gBACA,uBACA,gBAGF,+BACE,kBACA,gBACA,mBACA,gBACA,uBACA,gBACA,WAGF,sBACE,kBACA,aACA,yBACA,QACA,eACA,QACA,UAGF,qBACE,WACA,YA3IF,mBA6IE,kBACA,qBACA,eACA,gBACA,yBACA,sBACA,uBACA,gBApJF,gBAwJA,yBACE,aACA,kBACA,2BACA,YACA,WACA,MA9JF,kBAkKA,kCACE,aACA,UAGF,sBACE,aACA,mBACA,uBACA,WA3KF,mBA6KE,yBACA,eAGF,+BACE,yBACA,WAGF,oCACE,yBACA,WAGF,4BACE,6BACA,WAGF,+CACE,aACA,sBACA,uBACA,mBAGF,gCACE,uBACA,sBACA,WACA,yBA3MF,iBA6ME,qBACA,eACA,gBA/MF,kBAmNA,sCACE,gBACA,WAGF,gCACE,yBAzNF,mBA2NE,WACA,YACA,WAGF,6BACE,yBAjOF,mBAmOE,WACA,YACA,WAGF,yBACE,aACA,mBACA,kBA3OF,kBA6OE,aACA,yBACA,mBACA,gBAhPF,YAoPA,8BACE,kBACA,WACA,UACA,WACA,YACA,aACA,uBACA,mBACA,WA7PF,kBA+PE,sBAGF,oCACE,sBAGF,+BACE,aACA,eACA,QAGF,8BACE,gBACA,kBACA,gBACA,uBACA,gBAjRF,mBAmRE,aACA,8BACA,sBACA,WACA,mBAvRF,yBA4RA,mCACE,gBACA,eACA,iBAGF,sCACE,sBACA,WApSF,mBAsSE,YACA,WACA,aACA,uBACA,mBAGF,SACE,SACA,OACA,sBAhTF,kBAkTE,cACA,WACA,kBACA,WACA,iBACA,6BAGF,eACE,eACA,aACA,sBA7TF,kBAiUA,iBACE,kBACA,YAGF,qCACE,uBACE,gBAGF,kBACE,sBAGF,qEACE,WAGF,eAnVF,WCAA,6BACE,aACA,SACA,kBAGF,yBACE,aACA,sBACA,uBACA,mBACA,sBAXF,oCAcE,aAGF,+BACE,yBAlBF,gCAqBE,mBAGF,uBACE,aACA,sBACA,uBACA,mBA5BF,oCA+BE,aACA,0BAGF,qDACE,0BAGF,uCACE,aAGF,oBACE,cACA,eACA,cACA,gBACA,eACA,iBACA,kBACA,qBACA,yBACA,yBArDF,mCA0DA,0BACE,yBACA,WAGF,6BACE,mBAGF,yBACE,aACA,sBACA,uBACA,SACA,WAGF,qBA3EA,aA6EE,aACA,sBACA,uBACA,mBACA,sBAjFF,kBAmFE,SACA,gBAGF,4BACE,WAGF,yBACE,yBA5FF,8BAiGA,+BACE,cACA,gBACA,eACA,iBACA,WACA,mBACA,eACA,gBACA,uBACA,mBAGF,mBACE,aACA,SAGF,sGACE,YACA,yBArHF,UAuHE,WACA,YAGF,kKACE,aAGF,sCACE,6BACE,sBAGF,gDACE,WAOH,mBACC","names":[]} \ No newline at end of file +{"version":3,"sources":["../src/Input/Inputs.css","../src/Library/Library.css","../src/Image/Image.css"],"sourcesContent":[".Input {\n &__Wrapper {\n @apply relative;\n\n &__Header {\n @apply flex justify-between;\n }\n \n &__Error {\n @apply text-error mt-1 text-sm;\n }\n }\n\n &__Text {\n @apply relative w-full rounded-md border border-mediumGrey outline-none py-2 px-4;\n height: 40px;\n \n &__Wrapper {\n @apply relative w-full flex flex-wrap items-stretch;\n }\n\n &:hover, &:focus {\n @apply border-darkCharbon;\n }\n\n /* &:focus {\n @apply outline-vermillon outline-1 outline-offset-1;\n } */\n \n &--withIcon {\n @apply pl-10;\n }\n \n &--withIcons {\n @apply px-10;\n }\n\n &--emphasize {\n @apply text-vermillon;\n }\n }\n\n &__Select {\n background: url(\"data:image/svg+xml,\") no-repeat;\n background-color: white;\n background-position: calc(100% - 12px) center;\n -moz-appearance:none;\n -webkit-appearance: none; \n appearance: none;\n\n &__Separator {\n @apply absolute h-6 bg-darkCharbon bottom-2 right-8 z-10;\n width: 1px;\n }\n }\n\n &__Icon {\n @apply absolute py-1 h-full leading-snug rounded text-base font-normal text-center flex items-center justify-center;\n\n &--left {\n @apply left-0 pr-5 pl-4;\n }\n\n &--right {\n @apply right-0 pr-4 pl-5;\n }\n }\n}\n",".Modal-Library {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n height: max-content;\n width: 90%;\n max-height: 90%;\n overflow: auto;\n border-radius: 8px;\n background-color: white;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 350ms;\n}\n\n.Modal-Upload {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n height: max-content;\n width: 50%;\n max-height: 90%;\n overflow: auto;\n border-radius: 8px;\n background-color: white;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 350ms;\n}\n\n.Modal-Tags {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n width: max-content;\n max-width: 700px;\n height: max-content;\n max-height: 80%;\n border-radius: 8px;\n background-color: white;\n}\n\n.Modal__Content__Loader {\n display: flex;\n flex-direction: column;\n gap: 12px;\n width: 100%;\n text-align: center;\n}\n\n.Modal__Content__Loader span {\n display: block;\n}\n\n.Library__NoContent {\n width: 100%;\n text-align: center;\n}\n\n.Library {\n display: flex;\n flex-direction: column;\n gap: 30px;\n}\n\n.Library__Filters {\n display: flex;\n gap: 15px;\n}\n\n.Library__Filters .Input__Wrapper {\n width: 400px\n}\n\n.Library__Content {\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n}\n\n.Library__Image {\n display: flex;\n flex-direction: column;\n max-width: 160px;\n height: max-content;\n border: 1px solid #EBEBEB;\n border-radius: 4px;\n position: relative;\n justify-content: center;\n align-items: center;\n gap: 10px;\n padding-bottom: 16px;\n}\n\n.Library__Image img {\n border-radius: 4px;\n object-fit: contain;\n}\n\n.Library__Image__Title {\n text-align: center;\n overflow: hidden;\n white-space: nowrap;\n font-weight: 600;\n text-overflow: ellipsis;\n max-width: 130px;\n}\n\n.Library__Image__Action__Title {\n text-align: center;\n overflow: hidden;\n white-space: nowrap;\n font-weight: 600;\n text-overflow: ellipsis;\n max-width: 120px;\n color: white;\n}\n\n.Library__Image__Tags {\n position: absolute;\n display: flex;\n justify-content: flex-end;\n gap: 4px; \n flex-wrap: wrap;\n top: 7px;\n right: 7px;\n}\n\n.Library__Image__Tag {\n width: 50px;\n height: 20px;\n border-radius: 20px;\n text-align: center;\n letter-spacing: 0.05em;\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n background-color: white;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 1px 3px;\n}\n\n.Library__Image__Actions {\n display: none;\n position: absolute;\n background-color: rgba(0, 0, 0, 0.9);\n height: 100%;\n width: 100%;\n top: 0;\n border-radius: 4px;\n}\n\n.Library__Image__Actions__Wrapper {\n display: flex;\n gap: 0.5rem;\n}\n\n.Library__Add__Button {\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n border-radius: 100%;\n background-color: #D21919;\n cursor: pointer;\n}\n\n.Library__Add__Button:disabled {\n background-color: #EBEBEB;\n color: #fff;\n}\n\n.Library__Add__Button:enabled:hover {\n background-color: #FA533C;\n color: #fff;\n}\n\n.Library__Add__Button:hover {\n background-color: transparent;\n color: #222222;\n}\n\n.Library__Image:hover .Library__Image__Actions {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.Library__Image__Select__Action {\n background: transparent;\n border: 1px solid #fff;\n color: #fff;\n text-transform: uppercase;\n padding: 6px 15px;\n letter-spacing: 0.05em;\n font-size: 12px;\n font-weight: 600;\n border-radius: 4px;\n}\n\n.Library__Image__Select__Action:hover {\n background: #fff;\n color: #000;\n}\n\n.Library__Image__Delete__Action {\n background-color: #D21919;\n border-radius: 100%;\n width: 30px;\n height: 30px;\n color: #fff;\n}\n\n.Library__Image__Tag__Action {\n background-color: #008958;\n border-radius: 100%;\n width: 30px;\n height: 30px;\n color: #fff;\n}\n\n.BlockImage__TagSelector {\n display: flex;\n align-items: center;\n position: relative;\n border-radius: 6px;\n outline: none;\n border: 1px solid #9B9B9B;\n height: max-content;\n min-height: 40px;\n padding: 5px;\n}\n\n.BlockImage__TagSelector__Add {\n position: absolute;\n bottom: 3px;\n right: 3px;\n width: 32px;\n height: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n border-radius: 4px;\n background-color: #444444;\n}\n\n.BlockImage__TagSelector__Add:hover {\n background-color: #333333;\n}\n\n.BlockImage__TagSelector__Tags {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.BlockImage__TagSelector__Tag {\n max-width: 100px;\n width: max-content;\n max-height: 30px;\n text-overflow: ellipsis;\n overflow: hidden;\n border-radius: 90px;\n display: flex;\n justify-content: space-between;\n background-color: #333333;\n color: white;\n align-items: center;\n padding: 4px;\n padding-left: 14px;\n}\n\n.BlockImage__TagSelector__Tag > span {\n font-weight: 600;\n font-size: 14px;\n margin-right: 7px;\n}\n\n.BlockImage__TagSelector__Tag__Remove {\n background-color: white;\n color: #111;\n border-radius: 90px;\n height: 20px;\n width: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.TagList {\n top: 100%;\n left: 0;\n background-color: white;\n border-radius: 6px;\n overflow: auto;\n width: 100%;\n position: absolute;\n z-index: 30;\n max-height: 200px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.25);\n}\n\n.TagList__Item {\n cursor: pointer;\n display: flex;\n flex-direction: column;\n padding: 20px 15px;\n}\n\n.Select__Wrapper {\n position: relative;\n width: 250px;\n}\n\n@media screen and (max-width: 768px) {\n .Library__Image__Title {\n max-width: 100px;\n }\n\n .Library__Filters {\n flex-direction: column;\n }\n\n .Library__Filters .Input__Wrapper, .Library__Filters .Select__Wrapper {\n width: auto;\n }\n\n .Library__Item {\n padding: 0px;\n }\n}\n",".BlockImage__Upload__Wrapper {\n display: flex;\n gap: 16px;\n text-align: center;\n}\n\n.BlockImage__FromLibrary {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: #fff;\n border-radius: 4px;\n padding: 50px 20px;\n height: 200px;\n}\n\n.BlockImage__FromLibrary__Icon {\n background-color: #f5f5f5;\n padding: 10px;\n border-radius: 100%;\n margin-bottom: 10px;\n}\n\n.BlockImage__FromLocal {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 4px;\n padding: 50px 20px;\n height: 200px;\n border: 1px dashed #787878;\n}\n\n.BlockImage__FromLocal.BlockImage__FromLocal--active {\n border: 2px dashed #dc3018;\n}\n\ninput.BlockImage__FromLocal__FileInput {\n display: none;\n}\n\n.BlockImage__Button {\n display: block;\n cursor: pointer;\n color: #dc3018;\n font-weight: 600;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n border: 1px solid #dc3018;\n border-radius: 4px;\n padding: 6px 15px;\n}\n\n.BlockImage__Button:hover {\n background-color: #dc3018;\n color: #fff;\n}\n\n.BlockImage__FromLocal__Icon {\n margin-bottom: 10px;\n}\n\n.BlockImage__Infos__Form {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n width: 100%;\n}\n\n.BlockImage__Preview {\n padding: 20px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: #fff;\n border-radius: 4px;\n gap: 18px;\n max-width: 290px;\n}\n\n.BlockImage__Preview__Infos {\n width: 100%;\n}\n\n.BlockImage__Preview img {\n border: 1px solid #EBEBEB;\n padding: 5px;\n border-radius: 4px;\n}\n\n.BlockImage__Preview__FileName {\n display: block;\n font-weight: 600;\n font-size: 14px;\n line-height: 19px;\n color: #333333;\n margin-bottom: 10px;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.BlockImage__Infos {\n display: flex;\n gap: 40px;\n}\n\n.BlockImage__Upload--light .BlockImage__FromLocal, .BlockImage__Upload--light .BlockImage__FromLibrary {\n border: none;\n background-color: inherit;\n padding: 0px;\n width: auto;\n height: auto;\n}\n\n.BlockImage__Upload--light .BlockImage__FromLocal .BlockImage__FromLocal__Icon, .BlockImage__Upload--light .BlockImage__FromLibrary .BlockImage__FromLibrary__Icon {\n display: none;\n}\n\n@media screen and (max-width: 1366px) {\n .BlockImage__Upload__Wrapper {\n flex-direction: column;\n }\n\n .BlockImage__FromLibrary {\n width: 100%;\n }\n\n .BlockImage__FromLocal {\n width: 100%;\n }\n\n .BlockImage__Infos {\n flex-direction: column;\n }\n} "],"mappings":";AAAA;AACE;AACE;AAEA;AACE;AAAA;AAGF;AACE;AAAA;AAAA;AAIJ;AACE;AACA;AAEA;AACE;AAAA;AAGF;AAAA;AACE;AAAA;AAOF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAAA;AAIJ;AACE;AACA;AACA;AACA;AACA;AACA;AAEA;AACE;AACA;AAAA;AAAA;AAIJ;AACE;AAEA;AACE;AAAA;AAGF;AACE;AAAA;AAAA;AAAA;;;AChEN;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AAAA;AACE;AAAA;AAGF;AACE;AAAA;AAAA;;;ACpVJ;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AAAA;AACE;AAAA;AAGF;AACE;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGH;AACC;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/templates/backOffice/default/tb-plugin/vendor/index.d.ts b/templates/backOffice/default/tb-plugin/vendor/index.d.ts index ee74625..704a946 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.d.ts +++ b/templates/backOffice/default/tb-plugin/vendor/index.d.ts @@ -1,3 +1,5 @@ +import { BlockPluginDefinition } from '@thelia/blocks-editor'; + declare type ImageTag = { imageTag: { id: number; @@ -28,6 +30,8 @@ declare const UploadImage: ({ onSelect, compact, uploadModes, }: { compact?: boolean | undefined; uploadModes?: ("local" | "library")[] | undefined; }) => JSX.Element; +declare const initialData: LibraryImage; +declare const blockImage: BlockPluginDefinition; declare function WrappedComponent(props: { isOpen: boolean; @@ -36,4 +40,4 @@ declare function WrappedComponent(props: { onSelect: (image: LibraryImage) => void; }): JSX.Element; -export { LibraryImage, UploadImage, WrappedComponent as default }; +export { blockImage as BlockImage, initialData as BlockImageInitialData, LibraryImage, UploadImage, WrappedComponent as default }; diff --git a/templates/backOffice/default/tb-plugin/vendor/index.global.js b/templates/backOffice/default/tb-plugin/vendor/index.global.js index caeb6c6..c56134f 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.global.js +++ b/templates/backOffice/default/tb-plugin/vendor/index.global.js @@ -1,38 +1,15990 @@ -"use strict";var TheliaMediaLibraryBlock=(()=>{var Ad=Object.create;var Yr=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Rd=Object.getOwnPropertyNames;var Pd=Object.getPrototypeOf,Ld=Object.prototype.hasOwnProperty;var Dd=(e,t,r)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Nd=(e,t)=>()=>(e&&(t=e(e=0)),t);var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),As=(e,t)=>{for(var r in t)Yr(e,r,{get:t[r],enumerable:!0})},Ss=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rd(t))!Ld.call(e,o)&&o!==r&&Yr(e,o,{get:()=>t[o],enumerable:!(n=Sd(t,o))||n.enumerable});return e};var W=(e,t,r)=>(r=e!=null?Ad(Pd(e)):{},Ss(t||!e||!e.__esModule?Yr(r,"default",{value:e,enumerable:!0}):r,e)),Rs=e=>Ss(Yr({},"__esModule",{value:!0}),e);var Ps=(e,t,r)=>(Dd(e,typeof t!="symbol"?t+"":t,r),r);var qn=A((gb,Ls)=>{Ls.exports=TheliaBlocks});var J=A((yb,Ds)=>{Ds.exports=React});var tu=A((bb,Vn)=>{var Ns,Ms,Fs,Bs,Hs,ks,Us,js,qs,Gn,vi,Gs,Ws,Vs,_r,$s,Qs,zs,Ys,Xs,Ks,Zs,Js,eu,Wn;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Vn=="object"&&typeof Vn.exports=="object"?e(r(t,r(Vn.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};Ns=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},Ms=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;l--)(c=n[l])&&(u=(s<3?c(u):s>3?c(o,i,u):c(o,i))||u);return s>3&&u&&Object.defineProperty(o,i,u),u},Hs=function(n,o){return function(i,a){o(i,a,n)}},ks=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},Us=function(n,o,i,a){function s(u){return u instanceof i?u:new i(function(c){c(u)})}return new(i||(i=Promise))(function(u,c){function l(m){try{f(a.next(m))}catch(g){c(g)}}function p(m){try{f(a.throw(m))}catch(g){c(g)}}function f(m){m.done?u(m.value):s(m.value).then(l,p)}f((a=a.apply(n,o||[])).next())})},js=function(n,o){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,s,u,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(m){return p([f,m])}}function p(f){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(u=f[0]&2?s.return:f[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,f[1])).done)return u;switch(s=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return i.label++,{value:f[1],done:!1};case 5:i.label++,s=f[1],f=[0];continue;case 7:f=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){i=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},vi=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,u=[],c;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)u.push(s.value)}catch(l){c={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return u},Gs=function(){for(var n=[],o=0;o1||l(v,b)})})}function l(v,b){try{p(a[v](b))}catch(_){g(u[0][3],_)}}function p(v){v.value instanceof _r?Promise.resolve(v.value.v).then(f,m):g(u[0][2],v)}function f(v){l("next",v)}function m(v){l("throw",v)}function g(v,b){v(b),u.shift(),u.length&&l(u[0][0],u[0][1])}},Qs=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,u){o[s]=n[s]?function(c){return(i=!i)?{value:_r(n[s](c)),done:s==="return"}:u?u(c):c}:u}},zs=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof Gn=="function"?Gn(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(u){i[u]=n[u]&&function(c){return new Promise(function(l,p){c=n[u](c),s(l,p,c.done,c.value)})}}function s(u,c,l,p){Promise.resolve(p).then(function(f){u({value:f,done:l})},c)}},Ys=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Xs=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Wn(o,n,i);return r(o,n),o},Ks=function(n){return n&&n.__esModule?n:{default:n}},Zs=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},Js=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},eu=function(n,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?o===n:n.has(o)},e("__extends",Ns),e("__assign",Ms),e("__rest",Fs),e("__decorate",Bs),e("__param",Hs),e("__metadata",ks),e("__awaiter",Us),e("__generator",js),e("__exportStar",qs),e("__createBinding",Wn),e("__values",Gn),e("__read",vi),e("__spread",Gs),e("__spreadArrays",Ws),e("__spreadArray",Vs),e("__await",_r),e("__asyncGenerator",$s),e("__asyncDelegator",Qs),e("__asyncValues",zs),e("__makeTemplateObject",Ys),e("__importStar",Xs),e("__importDefault",Ks),e("__classPrivateFieldGet",Zs),e("__classPrivateFieldSet",Js),e("__classPrivateFieldIn",eu)})});var ou=A(ee=>{"use strict";var _e=typeof Symbol=="function"&&Symbol.for,yi=_e?Symbol.for("react.element"):60103,bi=_e?Symbol.for("react.portal"):60106,$n=_e?Symbol.for("react.fragment"):60107,Qn=_e?Symbol.for("react.strict_mode"):60108,zn=_e?Symbol.for("react.profiler"):60114,Yn=_e?Symbol.for("react.provider"):60109,Xn=_e?Symbol.for("react.context"):60110,_i=_e?Symbol.for("react.async_mode"):60111,Kn=_e?Symbol.for("react.concurrent_mode"):60111,Zn=_e?Symbol.for("react.forward_ref"):60112,Jn=_e?Symbol.for("react.suspense"):60113,Md=_e?Symbol.for("react.suspense_list"):60120,eo=_e?Symbol.for("react.memo"):60115,to=_e?Symbol.for("react.lazy"):60116,Fd=_e?Symbol.for("react.block"):60121,Bd=_e?Symbol.for("react.fundamental"):60117,Hd=_e?Symbol.for("react.responder"):60118,kd=_e?Symbol.for("react.scope"):60119;function qe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yi:switch(e=e.type,e){case _i:case Kn:case $n:case zn:case Qn:case Jn:return e;default:switch(e=e&&e.$$typeof,e){case Xn:case Zn:case to:case eo:case Yn:return e;default:return t}}case bi:return t}}}function nu(e){return qe(e)===Kn}ee.AsyncMode=_i;ee.ConcurrentMode=Kn;ee.ContextConsumer=Xn;ee.ContextProvider=Yn;ee.Element=yi;ee.ForwardRef=Zn;ee.Fragment=$n;ee.Lazy=to;ee.Memo=eo;ee.Portal=bi;ee.Profiler=zn;ee.StrictMode=Qn;ee.Suspense=Jn;ee.isAsyncMode=function(e){return nu(e)||qe(e)===_i};ee.isConcurrentMode=nu;ee.isContextConsumer=function(e){return qe(e)===Xn};ee.isContextProvider=function(e){return qe(e)===Yn};ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yi};ee.isForwardRef=function(e){return qe(e)===Zn};ee.isFragment=function(e){return qe(e)===$n};ee.isLazy=function(e){return qe(e)===to};ee.isMemo=function(e){return qe(e)===eo};ee.isPortal=function(e){return qe(e)===bi};ee.isProfiler=function(e){return qe(e)===zn};ee.isStrictMode=function(e){return qe(e)===Qn};ee.isSuspense=function(e){return qe(e)===Jn};ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===$n||e===Kn||e===zn||e===Qn||e===Jn||e===Md||typeof e=="object"&&e!==null&&(e.$$typeof===to||e.$$typeof===eo||e.$$typeof===Yn||e.$$typeof===Xn||e.$$typeof===Zn||e.$$typeof===Bd||e.$$typeof===Hd||e.$$typeof===kd||e.$$typeof===Fd)};ee.typeOf=qe});var au=A((Ub,iu)=>{"use strict";iu.exports=ou()});var du=A((jb,pu)=>{"use strict";var Ei=au(),Ud={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},jd={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},qd={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},cu={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},xi={};xi[Ei.ForwardRef]=qd;xi[Ei.Memo]=cu;function su(e){return Ei.isMemo(e)?cu:xi[e.$$typeof]||Ud}var Gd=Object.defineProperty,Wd=Object.getOwnPropertyNames,uu=Object.getOwnPropertySymbols,Vd=Object.getOwnPropertyDescriptor,$d=Object.getPrototypeOf,lu=Object.prototype;function fu(e,t,r){if(typeof t!="string"){if(lu){var n=$d(t);n&&n!==lu&&fu(e,n,r)}var o=Wd(t);uu&&(o=o.concat(uu(t)));for(var i=su(e),a=su(t),s=0;s{"use strict";var Hm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";hl.exports=Hm});var _l=A((UE,bl)=>{"use strict";var km=vl();function gl(){}function yl(){}yl.resetWarningCache=gl;bl.exports=function(){function e(n,o,i,a,s,u){if(u!==km){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:yl,resetWarningCache:gl};return r.PropTypes=r,r}});var _o=A((GE,El)=>{El.exports=_l()();var jE,qE});var wl=A(Ki=>{"use strict";Ki.__esModule=!0;Ki.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?n.toLowerCase().endsWith(s):s.endsWith("/*")?i===s.replace(/\/.*$/,""):o===s})}return!0}});var wo=A((wO,pc)=>{pc.exports=ReactDOM});var ba=A((uC,Ec)=>{"use strict";Ec.exports=function(t,r){return function(){for(var o=new Array(arguments.length),i=0;i{"use strict";var Nh=ba(),kt=Object.prototype.toString;function xa(e){return Array.isArray(e)}function _a(e){return typeof e>"u"}function Mh(e){return e!==null&&!_a(e)&&e.constructor!==null&&!_a(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function xc(e){return kt.call(e)==="[object ArrayBuffer]"}function Fh(e){return kt.call(e)==="[object FormData]"}function Bh(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xc(e.buffer),t}function Hh(e){return typeof e=="string"}function kh(e){return typeof e=="number"}function Oc(e){return e!==null&&typeof e=="object"}function So(e){if(kt.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Uh(e){return kt.call(e)==="[object Date]"}function jh(e){return kt.call(e)==="[object File]"}function qh(e){return kt.call(e)==="[object Blob]"}function Cc(e){return kt.call(e)==="[object Function]"}function Gh(e){return Oc(e)&&Cc(e.pipe)}function Wh(e){return kt.call(e)==="[object URLSearchParams]"}function Vh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $h(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Oa(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),xa(e))for(var r=0,n=e.length;r{"use strict";var Mr=Ne();function wc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Ic.exports=function(t,r,n){if(!r)return t;var o;if(n)o=n(r);else if(Mr.isURLSearchParams(r))o=r.toString();else{var i=[];Mr.forEach(r,function(u,c){u===null||typeof u>"u"||(Mr.isArray(u)?c=c+"[]":u=[u],Mr.forEach(u,function(p){Mr.isDate(p)?p=p.toISOString():Mr.isObject(p)&&(p=JSON.stringify(p)),i.push(wc(c)+"="+wc(p))}))}),o=i.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Sc=A((fC,Ac)=>{"use strict";var Yh=Ne();function Ro(){this.handlers=[]}Ro.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Ro.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Ro.prototype.forEach=function(t){Yh.forEach(this.handlers,function(n){n!==null&&t(n)})};Ac.exports=Ro});var Pc=A((pC,Rc)=>{"use strict";var Xh=Ne();Rc.exports=function(t,r){Xh.forEach(t,function(o,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(t[r]=o,delete t[i])})}});var Ta=A((dC,Lc)=>{"use strict";Lc.exports=function(t,r,n,o,i){return t.config=r,n&&(t.code=n),t.request=o,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}});var wa=A((mC,Dc)=>{"use strict";var Kh=Ta();Dc.exports=function(t,r,n,o,i){var a=new Error(t);return Kh(a,r,n,o,i)}});var Mc=A((hC,Nc)=>{"use strict";var Zh=wa();Nc.exports=function(t,r,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):r(Zh("Request failed with status code "+n.status,n.config,null,n.request,n))}});var Bc=A((vC,Fc)=>{"use strict";var Po=Ne();Fc.exports=Po.isStandardBrowserEnv()?function(){return{write:function(r,n,o,i,a,s){var u=[];u.push(r+"="+encodeURIComponent(n)),Po.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),Po.isString(i)&&u.push("path="+i),Po.isString(a)&&u.push("domain="+a),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var kc=A((gC,Hc)=>{"use strict";Hc.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var jc=A((yC,Uc)=>{"use strict";Uc.exports=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t}});var Gc=A((bC,qc)=>{"use strict";var Jh=kc(),ev=jc();qc.exports=function(t,r){return t&&!Jh(r)?ev(t,r):r}});var Vc=A((_C,Wc)=>{"use strict";var Ia=Ne(),tv=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];Wc.exports=function(t){var r={},n,o,i;return t&&Ia.forEach(t.split(` -`),function(s){if(i=s.indexOf(":"),n=Ia.trim(s.substr(0,i)).toLowerCase(),o=Ia.trim(s.substr(i+1)),n){if(r[n]&&tv.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([o]):r[n]=r[n]?r[n]+", "+o:o}}),r}});var zc=A((EC,Qc)=>{"use strict";var $c=Ne();Qc.exports=$c.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function o(i){var a=i;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(a){var s=$c.isString(a)?o(a):a;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}()});var mn=A((xC,Yc)=>{"use strict";function Aa(e){this.message=e}Aa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Aa.prototype.__CANCEL__=!0;Yc.exports=Aa});var Ra=A((OC,Xc)=>{"use strict";var Lo=Ne(),rv=Mc(),nv=Bc(),ov=Ca(),iv=Gc(),av=Vc(),sv=zc(),Sa=wa(),uv=hn(),lv=mn();Xc.exports=function(t){return new Promise(function(n,o){var i=t.data,a=t.headers,s=t.responseType,u;function c(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}Lo.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var p=t.auth.username||"",f=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(p+":"+f)}var m=iv(t.baseURL,t.url);l.open(t.method.toUpperCase(),ov(m,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function g(){if(!!l){var b="getAllResponseHeaders"in l?av(l.getAllResponseHeaders()):null,_=!s||s==="text"||s==="json"?l.responseText:l.response,x={data:_,status:l.status,statusText:l.statusText,headers:b,config:t,request:l};rv(function(d){n(d),c()},function(d){o(d),c()},x),l=null}}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){!l||(o(Sa("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){o(Sa("Network Error",t,null,l)),l=null},l.ontimeout=function(){var _=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",x=t.transitional||uv.transitional;t.timeoutErrorMessage&&(_=t.timeoutErrorMessage),o(Sa(_,t,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},Lo.isStandardBrowserEnv()){var v=(t.withCredentials||sv(m))&&t.xsrfCookieName?nv.read(t.xsrfCookieName):void 0;v&&(a[t.xsrfHeaderName]=v)}"setRequestHeader"in l&&Lo.forEach(a,function(_,x){typeof i>"u"&&x.toLowerCase()==="content-type"?delete a[x]:l.setRequestHeader(x,_)}),Lo.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),s&&s!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(u=function(b){!l||(o(!b||b&&b.type?new lv("canceled"):b),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u))),i||(i=null),l.send(i)})}});var hn=A((CC,Jc)=>{"use strict";var we=Ne(),Kc=Pc(),cv=Ta(),fv={"Content-Type":"application/x-www-form-urlencoded"};function Zc(e,t){!we.isUndefined(e)&&we.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function pv(){var e;return typeof XMLHttpRequest<"u"?e=Ra():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(e=Ra()),e}function dv(e,t,r){if(we.isString(e))try{return(t||JSON.parse)(e),we.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Do={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:pv(),transformRequest:[function(t,r){return Kc(r,"Accept"),Kc(r,"Content-Type"),we.isFormData(t)||we.isArrayBuffer(t)||we.isBuffer(t)||we.isStream(t)||we.isFile(t)||we.isBlob(t)?t:we.isArrayBufferView(t)?t.buffer:we.isURLSearchParams(t)?(Zc(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):we.isObject(t)||r&&r["Content-Type"]==="application/json"?(Zc(r,"application/json"),dv(t)):t}],transformResponse:[function(t){var r=this.transitional||Do.transitional,n=r&&r.silentJSONParsing,o=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||o&&we.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?cv(a,this,"E_JSON_PARSE"):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],function(t){Do.headers[t]={}});we.forEach(["post","put","patch"],function(t){Do.headers[t]=we.merge(fv)});Jc.exports=Do});var tf=A((TC,ef)=>{"use strict";var mv=Ne(),hv=hn();ef.exports=function(t,r,n){var o=this||hv;return mv.forEach(n,function(a){t=a.call(o,t,r)}),t}});var Pa=A((wC,rf)=>{"use strict";rf.exports=function(t){return!!(t&&t.__CANCEL__)}});var af=A((IC,of)=>{"use strict";var nf=Ne(),La=tf(),vv=Pa(),gv=hn(),yv=mn();function Da(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yv("canceled")}of.exports=function(t){Da(t),t.headers=t.headers||{},t.data=La.call(t,t.data,t.headers,t.transformRequest),t.headers=nf.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),nf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var r=t.adapter||gv.adapter;return r(t).then(function(o){return Da(t),o.data=La.call(t,o.data,o.headers,t.transformResponse),o},function(o){return vv(o)||(Da(t),o&&o.response&&(o.response.data=La.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Na=A((AC,sf)=>{"use strict";var $e=Ne();sf.exports=function(t,r){r=r||{};var n={};function o(l,p){return $e.isPlainObject(l)&&$e.isPlainObject(p)?$e.merge(l,p):$e.isPlainObject(p)?$e.merge({},p):$e.isArray(p)?p.slice():p}function i(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(t[l],r[l])}function a(l){if(!$e.isUndefined(r[l]))return o(void 0,r[l])}function s(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(void 0,r[l])}function u(l){if(l in r)return o(t[l],r[l]);if(l in t)return o(void 0,t[l])}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return $e.forEach(Object.keys(t).concat(Object.keys(r)),function(p){var f=c[p]||i,m=f(p);$e.isUndefined(m)&&f!==u||(n[p]=m)}),n}});var Ma=A((SC,uf)=>{uf.exports={version:"0.25.0"}});var ff=A((RC,cf)=>{"use strict";var bv=Ma().version,Fa={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Fa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var lf={};Fa.transitional=function(t,r,n){function o(i,a){return"[Axios v"+bv+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return function(i,a,s){if(t===!1)throw new Error(o(a," has been removed"+(r?" in "+r:"")));return r&&!lf[a]&&(lf[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,s):!0}};function _v(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=s===void 0||a(s,i,e);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(r!==!0)throw Error("Unknown option "+i)}}cf.exports={assertOptions:_v,validators:Fa}});var gf=A((PC,vf)=>{"use strict";var mf=Ne(),Ev=Ca(),pf=Sc(),df=af(),No=Na(),hf=ff(),Fr=hf.validators;function vn(e){this.defaults=e,this.interceptors={request:new pf,response:new pf}}vn.prototype.request=function(t,r){if(typeof t=="string"?(r=r||{},r.url=t):r=t||{},!r.url)throw new Error("Provided config url is not valid");r=No(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&hf.assertOptions(n,{silentJSONParsing:Fr.transitional(Fr.boolean),forcedJSONParsing:Fr.transitional(Fr.boolean),clarifyTimeoutError:Fr.transitional(Fr.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(i=i&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});var a=[];this.interceptors.response.forEach(function(m){a.push(m.fulfilled,m.rejected)});var s;if(!i){var u=[df,void 0];for(Array.prototype.unshift.apply(u,o),u=u.concat(a),s=Promise.resolve(r);u.length;)s=s.then(u.shift(),u.shift());return s}for(var c=r;o.length;){var l=o.shift(),p=o.shift();try{c=l(c)}catch(f){p(f);break}}try{s=df(c)}catch(f){return Promise.reject(f)}for(;a.length;)s=s.then(a.shift(),a.shift());return s};vn.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=No(this.defaults,t),Ev(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};mf.forEach(["delete","get","head","options"],function(t){vn.prototype[t]=function(r,n){return this.request(No(n||{},{method:t,url:r,data:(n||{}).data}))}});mf.forEach(["post","put","patch"],function(t){vn.prototype[t]=function(r,n,o){return this.request(No(o||{},{method:t,url:r,data:n}))}});vf.exports=vn});var bf=A((LC,yf)=>{"use strict";var xv=mn();function Br(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var r=this;this.promise.then(function(n){if(!!r._listeners){var o,i=r._listeners.length;for(o=0;o{"use strict";_f.exports=function(t){return function(n){return t.apply(null,n)}}});var Of=A((NC,xf)=>{"use strict";var Ov=Ne();xf.exports=function(t){return Ov.isObject(t)&&t.isAxiosError===!0}});var wf=A((MC,Ba)=>{"use strict";var Cf=Ne(),Cv=ba(),Mo=gf(),Tv=Na(),wv=hn();function Tf(e){var t=new Mo(e),r=Cv(Mo.prototype.request,t);return Cf.extend(r,Mo.prototype,t),Cf.extend(r,t),r.create=function(o){return Tf(Tv(e,o))},r}var yt=Tf(wv);yt.Axios=Mo;yt.Cancel=mn();yt.CancelToken=bf();yt.isCancel=Pa();yt.VERSION=Ma().version;yt.all=function(t){return Promise.all(t)};yt.spread=Ef();yt.isAxiosError=Of();Ba.exports=yt;Ba.exports.default=yt});var Af=A((FC,If)=>{If.exports=wf()});var Ga=A((Fo,Hf)=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.default=Bf;var Av=/input|select|textarea|button|object|iframe/;function Sv(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var r=window.getComputedStyle(e);return t?r.getPropertyValue("overflow")!=="visible"||e.scrollWidth<=0&&e.scrollHeight<=0:r.getPropertyValue("display")=="none"}catch{return console.warn("Failed to inspect element style"),!1}}function Rv(e){for(var t=e,r=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(r&&t===r&&(t=r.host.parentNode),Sv(t))return!1;t=t.parentNode}return!0}function Pv(e,t){var r=e.nodeName.toLowerCase(),n=Av.test(r)&&!e.disabled||r==="a"&&e.href||t;return n&&Rv(e)}function Lv(e){var t=e.getAttribute("tabindex");t===null&&(t=void 0);var r=isNaN(t);return(r||t>=0)&&Pv(e,!r)}function Bf(e){var t=[].slice.call(e.querySelectorAll("*"),0).reduce(function(r,n){return r.concat(n.shadowRoot?Bf(n.shadowRoot):[n])},[]);return t.filter(Lv)}Hf.exports=Fo.default});var kf=A(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.resetState=Fv;st.log=Bv;st.handleBlur=yn;st.handleFocus=bn;st.markForFocusLater=Hv;st.returnFocus=kv;st.popWithoutFocus=Uv;st.setupScopedFocus=jv;st.teardownScopedFocus=qv;var Dv=Ga(),Nv=Mv(Dv);function Mv(e){return e&&e.__esModule?e:{default:e}}var kr=[],Hr=null,Wa=!1;function Fv(){kr=[]}function Bv(){}function yn(){Wa=!0}function bn(){if(Wa){if(Wa=!1,!Hr)return;setTimeout(function(){if(!Hr.contains(document.activeElement)){var e=(0,Nv.default)(Hr)[0]||Hr;e.focus()}},0)}}function Hv(){kr.push(document.activeElement)}function kv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{kr.length!==0&&(t=kr.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function Uv(){kr.length>0&&kr.pop()}function jv(e){Hr=e,window.addEventListener?(window.addEventListener("blur",yn,!1),document.addEventListener("focus",bn,!0)):(window.attachEvent("onBlur",yn),document.attachEvent("onFocus",bn))}function qv(){Hr=null,window.addEventListener?(window.removeEventListener("blur",yn),document.removeEventListener("focus",bn)):(window.detachEvent("onBlur",yn),document.detachEvent("onFocus",bn))}});var qf=A((Bo,jf)=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.default=$v;var Gv=Ga(),Wv=Vv(Gv);function Vv(e){return e&&e.__esModule?e:{default:e}}function Uf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return e.activeElement.shadowRoot?Uf(e.activeElement.shadowRoot):e.activeElement}function $v(e,t){var r=(0,Wv.default)(e);if(!r.length){t.preventDefault();return}var n=void 0,o=t.shiftKey,i=r[0],a=r[r.length-1],s=Uf();if(e===s){if(!o)return;n=a}if(a===s&&!o&&(n=i),i===s&&o&&(n=a),n){t.preventDefault(),n.focus();return}var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),c=u!=null&&u[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!c){var l=r.indexOf(s);if(l>-1&&(l+=o?-1:1),n=r[l],typeof n>"u"){t.preventDefault(),n=o?a:i,n.focus();return}t.preventDefault(),n.focus()}}jf.exports=Bo.default});var $f=A(($C,Vf)=>{"use strict";var Qv=!1,Wf=function(){};Qv&&(Gf=function(t,r){var n=arguments.length;r=new Array(n>1?n-1:0);for(var o=1;o2?n-2:0);for(var o=2;o{(function(){"use strict";var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};typeof define=="function"&&typeof define.amd=="object"&&define.amd?define(function(){return t}):typeof Ho<"u"&&Ho.exports?Ho.exports=t:window.ExecutionEnvironment=t})()});var Uo=A(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.canUseDOM=wt.SafeNodeList=wt.SafeHTMLCollection=void 0;var zv=Qf(),Yv=Xv(zv);function Xv(e){return e&&e.__esModule?e:{default:e}}var ko=Yv.default,Kv=ko.canUseDOM?window.HTMLElement:{},zC=wt.SafeHTMLCollection=ko.canUseDOM?window.HTMLCollection:{},YC=wt.SafeNodeList=ko.canUseDOM?window.NodeList:{},XC=wt.canUseDOM=ko.canUseDOM;wt.default=Kv});var $a=A(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.resetState=rg;bt.log=ng;bt.assertNodeList=zf;bt.setElement=og;bt.validateElement=Va;bt.hide=ig;bt.show=ag;bt.documentNotReadyOrSSRTesting=sg;var Zv=$f(),Jv=tg(Zv),eg=Uo();function tg(e){return e&&e.__esModule?e:{default:e}}var et=null;function rg(){et&&(et.removeAttribute?et.removeAttribute("aria-hidden"):et.length!=null?et.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(et).forEach(function(e){return e.removeAttribute("aria-hidden")})),et=null}function ng(){if(!1)var e}function zf(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function og(e){var t=e;if(typeof t=="string"&&eg.canUseDOM){var r=document.querySelectorAll(t);zf(r,t),t=r}return et=t||et,et}function Va(e){var t=e||et;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,Jv.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function ig(e){var t=!0,r=!1,n=void 0;try{for(var o=Va(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function ag(e){var t=!0,r=!1,n=void 0;try{for(var o=Va(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function sg(){et=null}});var Xf=A(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.resetState=ug;Ur.log=lg;var _n={},En={};function Yf(e,t){e.classList.remove(t)}function ug(){var e=document.getElementsByTagName("html")[0];for(var t in _n)Yf(e,_n[t]);var r=document.body;for(var n in En)Yf(r,En[n]);_n={},En={}}function lg(){if(!1){var e,t;for(var r in _n);for(var n in En);}}var cg=function(t,r){return t[r]||(t[r]=0),t[r]+=1,r},fg=function(t,r){return t[r]&&(t[r]-=1),r},pg=function(t,r,n){n.forEach(function(o){cg(r,o),t.add(o)})},dg=function(t,r,n){n.forEach(function(o){fg(r,o),r[o]===0&&t.remove(o)})},JC=Ur.add=function(t,r){return pg(t.classList,t.nodeName.toLowerCase()=="html"?_n:En,r.split(" "))},e2=Ur.remove=function(t,r){return dg(t.classList,t.nodeName.toLowerCase()=="html"?_n:En,r.split(" "))}});var Qa=A(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.log=hg;xn.resetState=vg;function mg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Kf=function e(){var t=this;mg(this,e),this.register=function(r){t.openInstances.indexOf(r)===-1&&(t.openInstances.push(r),t.emit("register"))},this.deregister=function(r){var n=t.openInstances.indexOf(r);n!==-1&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(r){t.subscribers.push(r)},this.emit=function(r){t.subscribers.forEach(function(n){return n(r,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},jo=new Kf;function hg(){console.log("portalOpenInstances ----------"),console.log(jo.openInstances.length),jo.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function vg(){jo=new Kf}xn.default=jo});var Jf=A(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.resetState=_g;qo.log=Eg;var gg=Qa(),yg=bg(gg);function bg(e){return e&&e.__esModule?e:{default:e}}var Pe=void 0,ut=void 0,or=[];function _g(){for(var e=[Pe,ut],t=0;t0?(document.body.firstChild!==Pe&&document.body.insertBefore(Pe,document.body.firstChild),document.body.lastChild!==ut&&document.body.appendChild(ut)):(Pe.parentElement&&Pe.parentElement.removeChild(Pe),ut.parentElement&&ut.parentElement.removeChild(ut))}yg.default.subscribe(xg)});var op=A((Qo,np)=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var Go=Object.assign||function(e){for(var t=1;t0&&(Vo-=1,Vo===0&&ep.show(i)),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(On.returnFocus(n.props.preventScroll),On.teardownScopedFocus()):On.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),rp.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(On.setupScopedFocus(n.node),On.markForFocusLater()),n.setState({isOpen:!0},function(){n.openAnimationFrame=requestAnimationFrame(function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})})}))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var o=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:o},function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())})},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(o){o.keyCode===Fg&&(0,Sg.default)(n.content,o),n.props.shouldCloseOnEsc&&o.keyCode===Bg&&(o.stopPropagation(),n.requestClose(o))},n.handleOverlayOnClick=function(o){n.shouldClose===null&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(o):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(o){!n.props.shouldCloseOnOverlayClick&&o.target==n.overlay&&o.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(o){return n.ownerHandlesClose()&&n.props.onRequestClose(o)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(o,i){var a=(typeof i>"u"?"undefined":Og(i))==="object"?i:{base:za[o],afterOpen:za[o]+"--after-open",beforeClose:za[o]+"--before-close"},s=a.base;return n.state.afterOpen&&(s=s+" "+a.afterOpen),n.state.beforeClose&&(s=s+" "+a.beforeClose),typeof i=="string"&&i?s+" "+i:s},n.attributesFromObject=function(o,i){return Object.keys(i).reduce(function(a,s){return a[o+"-"+s]=i[s],a},{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return Cg(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(n,o){this.props.isOpen&&!n.isOpen?this.open():!this.props.isOpen&&n.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!o.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var n=this.props,o=n.appElement,i=n.ariaHideApp,a=n.htmlOpenClassName,s=n.bodyOpenClassName;s&&Wo.add(document.body,s),a&&Wo.add(document.getElementsByTagName("html")[0],a),i&&(Vo+=1,ep.hide(o)),rp.default.register(this)}},{key:"render",value:function(){var n=this.props,o=n.id,i=n.className,a=n.overlayClassName,s=n.defaultStyles,u=n.children,c=i?{}:s.content,l=a?{}:s.overlay;if(this.shouldBeClosed())return null;var p={ref:this.setOverlayRef,className:this.buildClassName("overlay",a),style:Go({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},f=Go({id:o,ref:this.setContentRef,style:Go({},c,this.props.style.content),className:this.buildClassName("content",i),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",Go({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),m=this.props.contentElement(f,u);return this.props.overlayElement(p,m)}}]),t}(Tg.Component);Ka.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}};Ka.propTypes={isOpen:H.default.bool.isRequired,defaultStyles:H.default.shape({content:H.default.object,overlay:H.default.object}),style:H.default.shape({content:H.default.object,overlay:H.default.object}),className:H.default.oneOfType([H.default.string,H.default.object]),overlayClassName:H.default.oneOfType([H.default.string,H.default.object]),bodyOpenClassName:H.default.string,htmlOpenClassName:H.default.string,ariaHideApp:H.default.bool,appElement:H.default.oneOfType([H.default.instanceOf(tp.default),H.default.instanceOf(Ya.SafeHTMLCollection),H.default.instanceOf(Ya.SafeNodeList),H.default.arrayOf(H.default.instanceOf(tp.default))]),onAfterOpen:H.default.func,onAfterClose:H.default.func,onRequestClose:H.default.func,closeTimeoutMS:H.default.number,shouldFocusAfterRender:H.default.bool,shouldCloseOnOverlayClick:H.default.bool,shouldReturnFocusAfterClose:H.default.bool,preventScroll:H.default.bool,role:H.default.string,contentLabel:H.default.string,aria:H.default.object,data:H.default.object,children:H.default.node,shouldCloseOnEsc:H.default.bool,overlayRef:H.default.func,contentRef:H.default.func,id:H.default.string,overlayElement:H.default.func,contentElement:H.default.func,testId:H.default.string};Qo.default=Ka;np.exports=Qo.default});var up={};As(up,{polyfill:()=>Hg});function ip(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function ap(e){function t(r){var n=this.constructor.getDerivedStateFromProps(e,r);return n??null}this.setState(t.bind(this))}function sp(e,t){try{var r=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function Hg(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var r=null,n=null,o=null;if(typeof t.componentWillMount=="function"?r="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(r="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?n="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(n="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),r!==null||n!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. - -`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(r!==null?` - `+r:"")+(n!==null?` - `+n:"")+(o!==null?` - `+o:"")+` - -The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=ip,t.componentWillReceiveProps=ap),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=sp;var s=t.componentDidUpdate;t.componentDidUpdate=function(c,l,p){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:p;s.call(this,c,l,f)}}return e}var lp=Nd(()=>{ip.__suppressDeprecationWarning=!0;ap.__suppressDeprecationWarning=!0;sp.__suppressDeprecationWarning=!0});var gp=A(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.bodyOpenClassName=ar.portalClassName=void 0;var cp=Object.assign||function(e){for(var t=1;t{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var Kg=gp(),Zg=Jg(Kg);function Jg(e){return e&&e.__esModule?e:{default:e}}Ko.default=Zg.default;yp.exports=Ko.default});var hb={};As(hb,{UploadImage:()=>Mn,default:()=>mb});var Cd=W(qn()),nt=W(J());var ru=W(tu(),1),{__extends:Le,__assign:C,__rest:Er,__decorate:_b,__param:Eb,__metadata:xb,__awaiter:Yt,__generator:Xt,__exportStar:Ob,__createBinding:Cb,__values:Tb,__read:gi,__spread:wb,__spreadArrays:Ib,__spreadArray:Se,__await:Ab,__asyncGenerator:Sb,__asyncDelegator:Rb,__asyncValues:Pb,__makeTemplateObject:Lb,__importStar:Db,__importDefault:Nb,__classPrivateFieldGet:Mb,__classPrivateFieldSet:Fb,__classPrivateFieldIn:Bb}=ru.default;var yo=W(J());var ul=W(J());var go=W(J()),Nm=W(du());var ho=W(J());function Xr(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}var V;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(V||(V={}));var ne;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(ne||(ne={}));var Kt;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Kt||(Kt={}));function Oi(e){return e.type===ne.literal}function mu(e){return e.type===ne.argument}function ro(e){return e.type===ne.number}function no(e){return e.type===ne.date}function oo(e){return e.type===ne.time}function io(e){return e.type===ne.select}function ao(e){return e.type===ne.plural}function hu(e){return e.type===ne.pound}function so(e){return e.type===ne.tag}function uo(e){return!!(e&&typeof e=="object"&&e.type===Kt.number)}function Kr(e){return!!(e&&typeof e=="object"&&e.type===Kt.dateTime)}var Ci=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var Qd=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function vu(e){var t={};return e.replace(Qd,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"short":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var gu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Eu(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(gu).filter(function(f){return f.length>0}),r=[],n=0,o=t;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Yd,function(u,c,l,p,f,m){if(c)t.minimumIntegerDigits=l.length;else{if(p&&f)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ou.test(o.stem)){t.minimumIntegerDigits=o.stem.length;continue}if(yu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(yu,function(u,c,l,p,f,m){return l==="*"?t.minimumFractionDigits=c.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:f&&m?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+m.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});var i=o.options[0];i==="w"?t=C(C({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=C(C({},t),bu(i)));continue}if(xu.test(o.stem)){t=C(C({},t),bu(o.stem));continue}var a=Cu(o.stem);a&&(t=C(C({},t),a));var s=Xd(o.stem);s&&(t=C(C({},t),s))}return t}var Zr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function wu(e,t){for(var r="",n=0;n>1),u="a",c=Kd(t);for((c=="H"||c=="k")&&(s=0);s-- >0;)r+=u;for(;a-- >0;)r=c+r}else o==="J"?r+="H":r+=o}return r}function Kd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var o=Zr[n||""]||Zr[r||""]||Zr["".concat(r,"-001")]||Zr["001"];return o[0]}var Ti,Zd=new RegExp("^".concat(Ci.source,"*")),Jd=new RegExp("".concat(Ci.source,"*$"));function X(e,t){return{start:e,end:t}}var em=!!String.prototype.startsWith,tm=!!String.fromCodePoint,rm=!!Object.fromEntries,nm=!!String.prototype.codePointAt,om=!!String.prototype.trimStart,im=!!String.prototype.trimEnd,am=!!Number.isSafeInteger,sm=am?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ii=!0;try{Iu=Pu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ii=((Ti=Iu.exec("a"))===null||Ti===void 0?void 0:Ti[0])==="a"}catch{Ii=!1}var Iu,Au=em?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Ai=tm?String.fromCodePoint:function(){for(var t=[],r=0;ri;){if(a=t[i++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},Su=rm?Object.fromEntries:function(t){for(var r={},n=0,o=t;n=n)){var o=t.charCodeAt(r),i;return o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?o:(o-55296<<10)+(i-56320)+65536}},um=om?function(t){return t.trimStart()}:function(t){return t.replace(Zd,"")},lm=im?function(t){return t.trimEnd()}:function(t){return t.replace(Jd,"")};function Pu(e,t){return new RegExp(e,t)}var Si;Ii?(wi=Pu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Si=function(t,r){var n;wi.lastIndex=r;var o=wi.exec(t);return(n=o[1])!==null&&n!==void 0?n:""}):Si=function(t,r){for(var n=[];;){var o=Ru(t,r);if(o===void 0||Du(o)||pm(o))break;n.push(o),r+=o>=65536?2:1}return Ai.apply(void 0,n)};var wi,Lu=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var o=[];!this.isEOF();){var i=this.char();if(i===123){var a=this.parseArgument(t,n);if(a.err)return a;o.push(a.val)}else{if(i===125&&t>0)break;if(i===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),o.push({type:ne.pound,location:X(s,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(V.UNMATCHED_CLOSING_TAG,X(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ri(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;o.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;o.push(a.val)}}}return{val:o,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ne.literal,value:"<".concat(o,"/>"),location:X(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,r,!0);if(i.err)return i;var a=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:ne.tag,value:o,children:a,location:X(n,this.clonePosition())},err:null}:this.error(V.INVALID_TAG,X(s,this.clonePosition())))}else return this.error(V.UNCLOSED_TAG,X(n,this.clonePosition()))}else return this.error(V.INVALID_TAG,X(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&fm(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),o="";;){var i=this.tryParseQuote(r);if(i){o+=i;continue}var a=this.tryParseUnquoted(t,r);if(a){o+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){o+=s;continue}break}var u=X(n,this.clonePosition());return{val:{type:ne.literal,value:o,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!cm(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Ai.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Ai(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(V.EMPTY_ARGUMENT,X(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(V.MALFORMED_ARGUMENT,X(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ne.argument,value:o,location:X(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition())):this.parseArgumentOptions(t,r,o,n);default:return this.error(V.MALFORMED_ARGUMENT,X(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Si(this.message,r),o=r+n.length;this.bumpTo(o);var i=this.clonePosition(),a=X(t,i);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(s){case"":return this.error(V.EXPECT_ARGUMENT_TYPE,X(a,u));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=lm(p.val);if(f.length===0)return this.error(V.EXPECT_ARGUMENT_STYLE,X(this.clonePosition(),this.clonePosition()));var m=X(l,this.clonePosition());c={style:f,styleLocation:m}}var g=this.tryParseArgumentClose(o);if(g.err)return g;var v=X(o,this.clonePosition());if(c&&Au(c?.style,"::",0)){var b=um(c.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(b,c.styleLocation);return p.err?p:{val:{type:ne.number,value:n,location:v,style:p.val},err:null}}else{if(b.length===0)return this.error(V.EXPECT_DATE_TIME_SKELETON,v);var _=b;this.locale&&(_=wu(b,this.locale));var f={type:Kt.dateTime,pattern:_,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?vu(_):{}},x=s==="date"?ne.date:ne.time;return{val:{type:x,value:n,location:v,style:f},err:null}}}return{val:{type:s==="number"?ne.number:s==="date"?ne.date:ne.time,value:n,location:v,style:(i=c?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var E=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS,X(E,C({},E)));this.bumpSpace();var d=this.parseIdentifierIfPossible(),w=0;if(s!=="select"&&d.value==="offset"){if(!this.bumpIf(":"))return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,X(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),d=this.parseIdentifierIfPossible(),w=p.val}var y=this.tryParsePluralOrSelectOptions(t,s,r,d);if(y.err)return y;var g=this.tryParseArgumentClose(o);if(g.err)return g;var P=X(o,this.clonePosition());return s==="select"?{val:{type:ne.select,value:n,options:Su(y.val),location:P},err:null}:{val:{type:ne.plural,value:n,options:Su(y.val),offset:w,pluralType:s==="plural"?"cardinal":"ordinal",location:P},err:null}}default:return this.error(V.INVALID_ARGUMENT_TYPE,X(a,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(V.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,X(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=Eu(t)}catch{return this.error(V.INVALID_NUMBER_SKELETON,r)}return{val:{type:Kt.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Tu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,o){for(var i,a=!1,s=[],u=new Set,c=o.value,l=o.location;;){if(c.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_SELECTOR,V.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;l=X(p,this.clonePosition()),c=this.message.slice(p.offset,this.offset())}else break}if(u.has(c))return this.error(r==="select"?V.DUPLICATE_SELECT_ARGUMENT_SELECTOR:V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);c==="other"&&(a=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,X(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(t+1,r,n);if(g.err)return g;var v=this.tryParseArgumentClose(m);if(v.err)return v;s.push([c,{value:g.val,location:X(m,this.clonePosition())}]),u.add(c),this.bumpSpace(),i=this.parseIdentifierIfPossible(),c=i.value,l=i.location}return s.length===0?this.error(r==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR:V.EXPECT_PLURAL_ARGUMENT_SELECTOR,X(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(V.MISSING_OTHER_CLAUSE,X(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)i=!0,a=a*10+(s-48),this.bump();else break}var u=X(o,this.clonePosition());return i?(a*=n,sm(a)?{val:a,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=Ru(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Au(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Du(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Ri(e){return e>=97&&e<=122||e>=65&&e<=90}function cm(e){return Ri(e)||e===47}function fm(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Du(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function pm(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Pi(e){e.forEach(function(t){if(delete t.location,io(t)||ao(t))for(var r in t.options)delete t.options[r].location,Pi(t.options[r].value);else ro(t)&&uo(t.style)||(no(t)||oo(t))&&Kr(t.style)?delete t.style.location:so(t)&&Pi(t.children)})}function Nu(e,t){t===void 0&&(t={}),t=C({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Lu(e,t).parse();if(r.err){var n=SyntaxError(V[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Pi(r.val),r.val}function Ge(e,t){var r=t&&t.cache?t.cache:ym,n=t&&t.serializer?t.serializer:gm,o=t&&t.strategy?t.strategy:mm;return o(e,{cache:r,serializer:n})}function dm(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Mu(e,t,r,n){var o=dm(n)?n:r(n),i=t.get(o);return typeof i>"u"&&(i=e.call(this,n),t.set(o,i)),i}function Fu(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,n),t.set(o,i)),i}function Li(e,t,r,n,o){return r.bind(t,e,n,o)}function mm(e,t){var r=e.length===1?Mu:Fu;return Li(e,this,r,t.cache.create(),t.serializer)}function hm(e,t){return Li(e,this,Fu,t.cache.create(),t.serializer)}function vm(e,t){return Li(e,this,Mu,t.cache.create(),t.serializer)}var gm=function(){return JSON.stringify(arguments)};function Di(){this.cache=Object.create(null)}Di.prototype.get=function(e){return this.cache[e]};Di.prototype.set=function(e,t){this.cache[e]=t};var ym={create:function(){return new Di}},Ze={variadic:hm,monadic:vm};var De;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(De||(De={}));var We=function(e){Le(t,e);function t(r,n,o){var i=e.call(this,r)||this;return i.code=n,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Ni=function(e){Le(t,e);function t(r,n,o,i){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(o).join('", "'),'"'),De.INVALID_VALUE,i)||this}return t}(We);var Bu=function(e){Le(t,e);function t(r,n,o){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),De.INVALID_VALUE,o)||this}return t}(We);var Hu=function(e){Le(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),De.MISSING_VALUE,n)||this}return t}(We);var Re;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Re||(Re={}));function bm(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==Re.literal||r.type!==Re.literal?t.push(r):n.value+=r.value,t},[])}function Mi(e){return typeof e=="function"}function Jr(e,t,r,n,o,i,a){if(e.length===1&&Oi(e[0]))return[{type:Re.literal,value:e[0].value}];for(var s=[],u=0,c=e;u"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Nu,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var de;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(de||(de={}));var Ee=function(e){Le(t,e);function t(r,n,o){var i=this,a=o?o instanceof Error?o:new Error(String(o)):void 0;return i=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,` -`).concat(a?` -`.concat(a.message,` -`).concat(a.stack):""))||this,i.code=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(i,t),i}return t}(Error);var ku=function(e){Le(t,e);function t(r,n){return e.call(this,de.UNSUPPORTED_FORMATTER,r,n)||this}return t}(Ee);var Uu=function(e){Le(t,e);function t(r,n){return e.call(this,de.INVALID_CONFIG,r,n)||this}return t}(Ee);var Bi=function(e){Le(t,e);function t(r,n){return e.call(this,de.MISSING_DATA,r,n)||this}return t}(Ee);var en=function(e){Le(t,e);function t(r,n,o){return e.call(this,de.FORMAT_ERROR,"".concat(r,` -Locale: `).concat(n,` -`),o)||this}return t}(Ee);var co=function(e){Le(t,e);function t(r,n,o,i){var a=e.call(this,"".concat(r,` -MessageID: `).concat(o?.id,` -Default Message: `).concat(o?.defaultMessage,` -Description: `).concat(o?.description,` -`),n,i)||this;return a.descriptor=o,a}return t}(en);var ju=function(e){Le(t,e);function t(r,n){var o=e.call(this,de.MISSING_TRANSLATION,'Missing message: "'.concat(r.id,'" for locale "').concat(n,'", using ').concat(r.defaultMessage?"default message (".concat(typeof r.defaultMessage=="string"?r.defaultMessage:r.defaultMessage.map(function(i){var a;return(a=i.value)!==null&&a!==void 0?a:JSON.stringify(i)}).join(),")"):"id"," as fallback."))||this;return o.descriptor=r,o}return t}(Ee);function ke(e,t,r){return r===void 0&&(r={}),t.reduce(function(n,o){return o in e?n[o]=e[o]:o in r&&(n[o]=r[o]),n},{})}var Om=function(e){},Cm=function(e){},tn={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:Om,onWarn:Cm};function fo(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function Zt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Hi(e){e===void 0&&(e=fo());var t=Intl.RelativeTimeFormat,r=Intl.ListFormat,n=Intl.DisplayNames,o=Ge(function(){for(var s,u=[],c=0;c needs to exist in the component ancestry.")}var ji=C(C({},tn),{textComponent:ho.Fragment});function ol(e){return function(t){return e(ho.Children.toArray(t))}}function il(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),o=r.length;if(n.length!==o)return!1;for(var i=0;ibo.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},bo.createElement("path",{d:"M19.86 15.26V2.47C19.8574 1.814 19.5949 1.18577 19.1301 0.722836C18.6653 0.259906 18.036 -5.33299e-06 17.38 0H2.5C2.16847 0.00126416 1.84048 0.068193 1.53497 0.196922C1.22945 0.32565 0.952464 0.513628 0.72 0.75C0.268046 1.20961 0.0102384 1.82548 1.31138e-09 2.47V17.38C-1.06443e-05 17.7074 0.0647931 18.0315 0.190674 18.3337C0.316554 18.6359 0.50102 18.9102 0.733432 19.1407C0.965844 19.3713 1.2416 19.5535 1.5448 19.677C1.848 19.8004 2.17264 19.8626 2.5 19.86H17.38C18.0369 19.8574 18.6662 19.5952 19.1307 19.1307C19.5952 18.6662 19.8574 18.0369 19.86 17.38V15.38V15.25V15.26ZM15.61 13.04L18.7 15.52L18.79 15.6V17.38C18.7821 17.7478 18.6298 18.0978 18.3659 18.3541C18.1021 18.6105 17.7479 18.7527 17.38 18.75H2.5C2.31454 18.7508 2.13075 18.715 1.95916 18.6446C1.78756 18.5743 1.63153 18.4707 1.5 18.34C1.36742 18.2098 1.26271 18.0541 1.19222 17.8821C1.12174 17.7102 1.08696 17.5258 1.09 17.34V16.47L1.18 16.39L6.25 12.14C6.39167 12.0175 6.5727 11.95 6.76 11.95C6.95222 11.9494 7.13771 12.0208 7.28 12.15L9.8 14.75C10.1157 15.0571 10.5305 15.2414 10.97 15.27C11.4102 15.304 11.8476 15.176 12.2 14.91L14.66 13C14.7961 12.8988 14.9604 12.8428 15.13 12.84C15.2999 12.8407 15.4649 12.8969 15.6 13L15.61 13.04ZM18.78 13.67V14.19L18.38 13.86L16.26 12.18C15.9416 11.9269 15.5468 11.7891 15.14 11.7891C14.7332 11.7891 14.3384 11.9269 14.02 12.18L11.56 13.97C11.4214 14.0831 11.2489 14.1465 11.07 14.15C10.8861 14.1476 10.7091 14.0803 10.57 13.96L8.02 11.44C7.6917 11.1055 7.24813 10.9089 6.77983 10.8904C6.31152 10.8718 5.85377 11.0326 5.5 11.34L1.5 14.75L1.09 15.1V2.47C1.09 2.28531 1.12654 2.10243 1.19752 1.93192C1.2685 1.76141 1.37252 1.60663 1.50358 1.4765C1.63464 1.34636 1.79016 1.24345 1.96117 1.17368C2.13218 1.10392 2.31531 1.06868 2.5 1.07H17.38C17.5658 1.06696 17.7502 1.10174 17.9221 1.17222C18.0941 1.24271 18.2498 1.34742 18.38 1.48C18.5107 1.61153 18.6143 1.76756 18.6846 1.93916C18.755 2.11075 18.7908 2.29454 18.79 2.48L18.78 13.67Z",fill:"#333333"}),bo.createElement("path",{d:"M14.0707 4.37993C13.5919 4.18009 13.0647 4.12687 12.5557 4.22701C12.0467 4.32715 11.5788 4.57613 11.2115 4.94241C10.8441 5.30869 10.5938 5.77578 10.4922 6.28449C10.3905 6.7932 10.4422 7.32062 10.6407 7.79993C10.8466 8.2856 11.1953 8.69714 11.6407 8.97992C12.1453 9.31662 12.7511 9.46778 13.3547 9.4076C13.9584 9.34742 14.5224 9.07963 14.9507 8.64992C15.2546 8.34523 15.4788 7.97034 15.6035 7.5584C15.7281 7.14646 15.7494 6.71016 15.6654 6.28805C15.5813 5.86595 15.3946 5.47104 15.1217 5.13824C14.8488 4.80544 14.4981 4.545 14.1007 4.37993H14.0707ZM14.3507 7.65992C14.1855 7.91702 13.9443 8.11626 13.6607 8.22992C13.3763 8.34874 13.0629 8.38007 12.7607 8.31992C12.4597 8.25811 12.1824 8.11251 11.9607 7.89992C11.7994 7.73572 11.6763 7.53809 11.5999 7.32101C11.5235 7.10393 11.4958 6.87271 11.5187 6.64373C11.5416 6.41475 11.6146 6.1936 11.7324 5.99594C11.8502 5.79828 12.0101 5.62895 12.2007 5.49993C12.4548 5.32915 12.7544 5.23857 13.0607 5.23992C13.4736 5.24265 13.8687 5.40791 14.1607 5.69992C14.3062 5.84383 14.4217 6.01513 14.5007 6.20392C14.5796 6.39272 14.6204 6.59528 14.6207 6.79993C14.6216 7.10759 14.5273 7.40801 14.3507 7.65992Z",fill:"#333333"}));var zi=W(J()),dl=e=>zi.createElement("svg",{width:28,height:26,viewBox:"0 0 26 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},zi.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 25C19.9036 25 25.5 19.4036 25.5 12.5C25.5 5.59644 19.9036 0 13 0C6.09644 0 0.5 5.59644 0.5 12.5C0.5 19.4036 6.09644 25 13 25ZM17.6328 15.9581L13.5555 19.9162C13.4826 19.9868 13.396 20.0428 13.3006 20.081C13.2053 20.1193 13.1031 20.1389 12.9998 20.1389C12.8966 20.1389 12.7944 20.1191 12.6991 20.0808C12.6038 20.0426 12.5172 19.9865 12.4444 19.9158L8.36709 15.9578C8.22042 15.8153 8.13834 15.6225 8.13889 15.4216C8.13944 15.2207 8.22258 15.0282 8.37002 14.8865C8.51747 14.7449 8.71713 14.6656 8.92509 14.6661C9.13305 14.6666 9.33228 14.7469 9.47894 14.8894L12.2162 17.5465V5.61856C12.2162 5.41767 12.2988 5.22501 12.4459 5.08296C12.5929 4.94091 12.7924 4.86111 13.0003 4.86111C13.2083 4.86111 13.4077 4.94091 13.5548 5.08296C13.7018 5.22501 13.7844 5.41767 13.7844 5.61856L13.7844 17.5465L16.5209 14.8894C16.5936 14.8189 16.6799 14.7628 16.7749 14.7245C16.87 14.6862 16.9719 14.6664 17.0749 14.6662C17.1779 14.6659 17.2799 14.6853 17.3752 14.7231C17.4704 14.761 17.557 14.8166 17.63 14.8867C17.703 14.9569 17.761 15.0403 17.8007 15.1321C17.8403 15.2239 17.8609 15.3224 17.8611 15.4219C17.8614 15.5214 17.8413 15.6199 17.8022 15.7119C17.763 15.804 17.7054 15.8876 17.6328 15.9581Z",fill:"#222222"}));var rn=W(J()),ml=e=>rn.createElement("svg",{width:28,height:26,viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},rn.createElement("path",{d:"M7.25281 20.4814C5.42678 20.4814 3.80262 19.3023 3.21296 17.5469L3.17304 17.4146C3.03389 16.9499 2.97572 16.5588 2.97572 16.1677V8.32471L0.20873 17.6401C-0.147124 19.0102 0.663812 20.4308 2.0245 20.8093L19.6609 25.5728C19.8811 25.6303 20.1012 25.6579 20.3179 25.6579C21.4539 25.6579 22.4918 24.8976 22.7826 23.7771L23.8103 20.4814H7.25281Z",fill:"#222222"}),rn.createElement("path",{d:"M10.3885 8.40309C11.6466 8.40309 12.6696 7.37124 12.6696 6.10242C12.6696 4.83361 11.6466 3.80176 10.3885 3.80176C9.1305 3.80176 8.10742 4.83361 8.10742 6.10242C8.10742 7.37124 9.1305 8.40309 10.3885 8.40309Z",fill:"#222222"}),rn.createElement("path",{d:"M24.6453 0.350098H7.53694C5.96525 0.350098 4.68555 1.64077 4.68555 3.22593V15.8796C4.68555 17.4648 5.96525 18.7554 7.53694 18.7554H24.6453C26.217 18.7554 27.4967 17.4648 27.4967 15.8796V3.22593C27.4967 1.64077 26.217 0.350098 24.6453 0.350098ZM7.53694 2.65076H24.6453C24.9601 2.65076 25.2156 2.90844 25.2156 3.22593V11.3921L21.6126 7.15202C21.2305 6.69994 20.6773 6.45837 20.0831 6.44456C19.4923 6.44801 18.938 6.71259 18.5593 7.17042L14.3233 12.2986L12.9432 10.9102C12.163 10.1233 10.8936 10.1233 10.1146 10.9102L6.96666 14.0839V3.22593C6.96666 2.90844 7.22215 2.65076 7.53694 2.65076Z",fill:"#222222"}));var Bm=()=>document.documentElement.lang||navigator.languages&&navigator.languages[0]||navigator.language||"en",Nt=Bm(),Mt={fr:{BlockImage__DOWNLOAD:"T\xE9l\xE9charger une image",BlockImage__OR_DROP:"ou glisser-d\xE9poser une image",BlockImage__SELECT_BUTTON:"S\xE9lectionner une image",BlockImage__SELECT:"depuis votre m\xE9diath\xE8que",BlockImage__TITLE:"Titre de l'image",BlockImage__LINK:"Lien de l'image",BlockImage__HEIGHT:"Hauteur de l'image",BlockImage__WIDTH:"Largeur de l'image",BlockImage__HEIGHT__PLACEHOLDER:"Indiquez la hauteur de l'image (ex: 100px, 50%, auto)",BlockImage__WIDTH__PLACEHOLDER:"Indiquez la largeur de l'image (ex: 100px, 50%, auto)",BlockImage__LINK_PLACEHOLDER:"Lien au clic sur l'image",BlockImage__LIBRARY_MODAL_TITLE:"Rechercher une image",BlockImage__LIBRARY_MODAL_TITLE_UPLOAD:"Uploader une image",BlockImage__LIBRARY_MODAL_SEARCH:"Rechercher dans la m\xE9diath\xE8que",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrer par tag",BlockImage__LIBRARY_LOADING:"Chargement de la librairie...",BlockImage__TOAST_WRONG_FILE_TYPE:"Votre image n'a pas pu \xEAtre t\xE9l\xE9charg\xE9e. Veuillez v\xE9rifier que votre fichier est bien une image.",BlockImage__TOAST_MAX_FILE:"Veuillez uploader une seule image.",BlockImage__DROP_TO_UPLOAD:"Relacher pour uploader votre image",BlockImage__LIBRARY_NO_CONTENT:"Aucune image trouv\xE9e",BlockImage__LIBRARY_SEARCHING:"Recherche en cours...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configuration des tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Ajouter un ou plusieurs tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"S\xE9lectionnez un ou plusieurs tag",REPLACE:"Remplacer",REPLACE_IMAGE:"Remplacer l'image",OPTIONAL:"Optionnel",CANCEL:"Annuler",DELETE:"Supprimer",SEARCH_BY:"R\xE9f\xE9rence, nom, ...",LOADING:"Chargement...",DOWNLOADING:"T\xE9l\xE9chargement...",ALL_TAGS:"Tous les tags",CHOOSE:"Choisir"},en:{BlockImage__DOWNLOAD:"Download an image",BlockImage__OR_DROP:"or drop an image",BlockImage__SELECT_BUTTON:"Select an image",BlockImage__SELECT:"from your library",BlockImage__TITLE:"Image title",BlockImage__LINK:"Image link",BlockImage__HEIGHT:"Image height",BlockImage__WIDTH:"Image width",BlockImage__HEIGHT__PLACEHOLDER:"Indicate the height of the image (ex: 100px, 50%, auto)",BlockImage__WIDTH__PLACEHOLDER:"Indicate the width of the image (ex: 100px, 50%, auto)",BlockImage__LINK_PLACEHOLDER:"Link on click on image",BlockImage__LIBRARY_MODAL_TITLE:"Search an image",BlockImage__LIBRARY_MODAL_TITLE_UPLOAD:"Upload an image",BlockImage__LIBRARY_MODAL_SEARCH:"Search in the library",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filter by tag",BlockImage__LIBRARY_LOADING:"Loading library...",BlockImage__TOAST_WRONG_FILE_TYPE:"Your image could not be uploaded. Please check that your file is an image.",BlockImage__TOAST_MAX_FILE:"Please upload only one image.",BlockImage__DROP_TO_UPLOAD:"Release to upload your image",BlockImage__LIBRARY_NO_CONTENT:"No image found",BlockImage__LIBRARY_SEARCHING:"Searching...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configure tags of",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Add one or more tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Select one or more tag",REPLACE:"Replace",REPLACE_IMAGE:"Replace image",OPTIONAL:"Optional",CANCEL:"Cancel",DELETE:"Delete",SEARCH_BY:"Reference, name, ...",LOADING:"Loading...",DOWNLOADING:"Downloading...",ALL_TAGS:"All tags",CHOOSE:"Choose"},es:{BlockImage__DOWNLOAD:"Descargar una imagen",BlockImage__OR_DROP:"o arrastrar una imagen",BlockImage__SELECT_BUTTON:"Seleccionar una imagen",BlockImage__SELECT:"de tu biblioteca",BlockImage__TITLE:"T\xEDtulo de la imagen",BlockImage__LINK:"Enlace de la imagen",BlockImage__HEIGHT:"Altura de la imagen",BlockImage__WIDTH:"Ancho de la imagen",BlockImage__HEIGHT__PLACEHOLDER:"Indica la altura de la imagen (ex: 100px, 50%, auto)",BlockImage__WIDTH__PLACEHOLDER:"Indica el ancho de la imagen (ex: 100px, 50%, auto)",BlockImage__LINK_PLACEHOLDER:"Enlace al hacer clic en la imagen",BlockImage__LIBRARY_MODAL_TITLE:"Buscar una imagen",BlockImage__LIBRARY_MODAL_TITLE_UPLOAD:"Subir una imagen",BlockImage__LIBRARY_MODAL_SEARCH:"Buscar en la biblioteca",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrar por tag",BlockImage__LIBRARY_LOADING:"Cargando la biblioteca...",BlockImage__TOAST_WRONG_FILE_TYPE:"Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.",BlockImage__TOAST_MAX_FILE:"Por favor sube solo una imagen.",BlockImage__DROP_TO_UPLOAD:"Suelte para subir tu imagen",BlockImage__LIBRARY_NO_CONTENT:"No se encontraron imagenes",BlockImage__LIBRARY_SEARCHING:"Buscando...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configurar tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Agregar uno o m\xE1s tags",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleccionar uno o m\xE1s tags",REPLACE:"Reemplazar",REPLACE_IMAGE:"Reemplazar imagen",OPTIONAL:"Opcional",CANCEL:"Cancelar",DELETE:"Eliminar",SEARCH_BY:"Referencia, nombre, ...",LOADING:"Cargando...",DOWNLOADING:"Descargando...",ALL_TAGS:"Todos los tags",CHOOSE:"Elegir"},it:{BlockImage__DOWNLOAD:"Scarica un immagine",BlockImage__OR_DROP:"o trascina un immagine",BlockImage__SELECT_BUTTON:"Seleziona un immagine",BlockImage__SELECT:"dalla tua libreria",BlockImage__TITLE:"Titolo dell immagine",BlockImage__LINK:"Link dell immagine",BlockImage__HEIGHT:"Altezza dell immagine",BlockImage__WIDTH:"Larghezza dell immagine",BlockImage__HEIGHT__PLACEHOLDER:"Indica l altezza dell immagine (ex: 100px, 50%, auto)",BlockImage__WIDTH__PLACEHOLDER:"Indica la larghezza dell immagine (ex: 100px, 50%, auto)",BlockImage__LINK_PLACEHOLDER:"Link al click sull immagine",BlockImage__LIBRARY_MODAL_TITLE:"Cerca un immagine",BlockImage__LIBRARY_MODAL_TITLE_UPLOAD:"Carica un immagine",BlockImage__LIBRARY_MODAL_SEARCH:"Cerca nella libreria",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtra per tag",BlockImage__LIBRARY_LOADING:"Caricamento della libreria...",BlockImage__TOAST_WRONG_FILE_TYPE:"La tua immagine non pu\xF2 essere caricata. Per favore verifica che il tuo file sia un immagine.",BlockImage__TOAST_MAX_FILE:"Per favore carica solo una immagine.",BlockImage__DROP_TO_UPLOAD:"Rilascia per caricare la tua immagine",BlockImage__LIBRARY_NO_CONTENT:"Nessuna immagine trovata",BlockImage__LIBRARY_SEARCHING:"Ricerca in corso...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configura i tag di",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Aggiungi uno o pi\xF9 tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleziona uno o pi\xF9 tag",REPLACE:"Sostituisci",REPLACE_IMAGE:"Sostituisci immagine",OPTIONAL:"Opzionale",CANCEL:"Annulla",DELETE:"Elimina",SEARCH_BY:"Riferimento, nome, ...",LOADING:"Caricamento...",DOWNLOADING:"Scaricare...",ALL_TAGS:"Tutti i tag",CHOOSE:"Scegli"}};var j=W(J()),re=W(_o());var Um=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function wr(e,t){var r=jm(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function jm(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=Um.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var qm=[".DS_Store","Thumbs.db"];function Xi(e){return Yt(this,void 0,void 0,function(){return Xt(this,function(t){return Eo(e)&&Gm(e.dataTransfer)?[2,Qm(e.dataTransfer,e.type)]:Wm(e)?[2,Vm(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,$m(e)]:[2,[]]})})}function Gm(e){return Eo(e)}function Wm(e){return Eo(e)&&Eo(e.target)}function Eo(e){return typeof e=="object"&&e!==null}function Vm(e){return Yi(e.target.files).map(function(t){return wr(t)})}function $m(e){return Yt(this,void 0,void 0,function(){var t;return Xt(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return wr(n)})]}})})}function Qm(e,t){return Yt(this,void 0,void 0,function(){var r,n;return Xt(this,function(o){switch(o.label){case 0:return e.items?(r=Yi(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(zm))]):[3,2];case 1:return n=o.sent(),[2,xl(Cl(n))];case 2:return[2,xl(Yi(e.files).map(function(i){return wr(i)}))]}})})}function xl(e){return e.filter(function(t){return qm.indexOf(t.name)===-1})}function Yi(e){if(e===null)return[];for(var t=[],r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);rr)return[!1,Rl(r)];if(e.sizer)return[!1,Rl(r)]}return[!0,null]}function er(e){return e!=null}function Fl(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(u){var c=Ji(u,r),l=nn(c,1),p=l[0],f=ea(u,n,o),m=nn(f,1),g=m[0],v=s?s(u):null;return p&&g&&!v})}function on(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function an(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function ta(e){e.preventDefault()}function uh(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function lh(e){return e.indexOf("Edge/")!==-1}function Bl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return uh(e)||lh(e)}function at(){for(var e=arguments.length,t=new Array(e),r=0;r1?o-1:0),a=1;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function Eh(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var aa=(0,j.forwardRef)(function(e,t){var r=e.children,n=xo(e,ch),o=sa(n),i=o.open,a=xo(o,fh);return(0,j.useImperativeHandle)(t,function(){return{open:i}},[i]),j.default.createElement(j.Fragment,null,r(ae(ae({},a),{},{open:i})))});aa.displayName="Dropzone";var zl={disabled:!1,getFilesFromEvent:Xi,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};aa.defaultProps=zl;aa.propTypes={children:re.default.func,accept:re.default.objectOf(re.default.arrayOf(re.default.string)),multiple:re.default.bool,preventDropOnDocument:re.default.bool,noClick:re.default.bool,noKeyboard:re.default.bool,noDrag:re.default.bool,noDragEventsBubbling:re.default.bool,minSize:re.default.number,maxSize:re.default.number,maxFiles:re.default.number,disabled:re.default.bool,getFilesFromEvent:re.default.func,onFileDialogCancel:re.default.func,onFileDialogOpen:re.default.func,useFsAccessApi:re.default.bool,autoFocus:re.default.bool,onDragEnter:re.default.func,onDragLeave:re.default.func,onDragOver:re.default.func,onDrop:re.default.func,onDropAccepted:re.default.func,onDropRejected:re.default.func,onError:re.default.func,validator:re.default.func};var ia={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function sa(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ae(ae({},zl),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,c=t.onDragEnter,l=t.onDragLeave,p=t.onDragOver,f=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,b=t.onFileDialogOpen,_=t.useFsAccessApi,x=t.autoFocus,E=t.preventDropOnDocument,d=t.noClick,w=t.noKeyboard,y=t.noDrag,P=t.noDragEventsBubbling,z=t.onError,Z=t.validator,F=(0,j.useMemo)(function(){return Ul(r)},[r]),L=(0,j.useMemo)(function(){return kl(r)},[r]),M=(0,j.useMemo)(function(){return typeof b=="function"?b:$l},[b]),k=(0,j.useMemo)(function(){return typeof v=="function"?v:$l},[v]),U=(0,j.useRef)(null),Y=(0,j.useRef)(null),B=(0,j.useReducer)(xh,ia),R=ra(B,2),$=R[0],q=R[1],ie=$.isFocused,ce=$.isFileDialogActive,te=(0,j.useRef)(typeof window<"u"&&window.isSecureContext&&_&&Hl()),mt=function(){!te.current&&ce&&setTimeout(function(){if(Y.current){var I=Y.current.files;I.length||(q({type:"closeDialog"}),k())}},300)};(0,j.useEffect)(function(){return window.addEventListener("focus",mt,!1),function(){window.removeEventListener("focus",mt,!1)}},[Y,ce,k,te]);var Ae=(0,j.useRef)([]),Be=function(I){U.current&&U.current.contains(I.target)||(I.preventDefault(),Ae.current=[])};(0,j.useEffect)(function(){return E&&(document.addEventListener("dragover",ta,!1),document.addEventListener("drop",Be,!1)),function(){E&&(document.removeEventListener("dragover",ta),document.removeEventListener("drop",Be))}},[U,E]),(0,j.useEffect)(function(){return!n&&x&&U.current&&U.current.focus(),function(){}},[U,x,n]);var Ce=(0,j.useCallback)(function(O){z?z(O):console.error(O)},[z]),xt=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[].concat(mh(Ae.current),[O.target]),an(O)&&Promise.resolve(o(O)).then(function(I){if(!(on(O)&&!P)){var oe=I.length,ue=oe>0&&Fl({files:I,accept:F,minSize:a,maxSize:i,multiple:s,maxFiles:u,validator:Z}),be=oe>0&&!ue;q({isDragAccept:ue,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),c&&c(O)}}).catch(function(I){return Ce(I)})},[o,c,Ce,P,F,a,i,s,u,Z]),Ye=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var I=an(O);if(I&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return I&&p&&p(O),!1},[p,P]),Ot=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var I=Ae.current.filter(function(ue){return U.current&&U.current.contains(ue)}),oe=I.indexOf(O.target);oe!==-1&&I.splice(oe,1),Ae.current=I,!(I.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),an(O)&&l&&l(O))},[U,l,P]),je=(0,j.useCallback)(function(O,I){var oe=[],ue=[];O.forEach(function(be){var Qt=Ji(be,F),Dt=ra(Qt,2),$r=Dt[0],Qr=Dt[1],zr=ea(be,a,i),h=ra(zr,2),T=h[0],S=h[1],K=Z?Z(be):null;if($r&&T&&!K)oe.push(be);else{var G=[Qr,S];K&&(G=G.concat(K)),ue.push({file:be,errors:G.filter(function(Te){return Te})})}}),(!s&&oe.length>1||s&&u>=1&&oe.length>u)&&(oe.forEach(function(be){ue.push({file:be,errors:[Ml]})}),oe.splice(0)),q({acceptedFiles:oe,fileRejections:ue,type:"setFiles"}),f&&f(oe,ue,I),ue.length>0&&g&&g(ue,I),oe.length>0&&m&&m(oe,I)},[q,s,F,a,i,u,f,m,g,Z]),ot=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[],an(O)&&Promise.resolve(o(O)).then(function(I){on(O)&&!P||je(I,O)}).catch(function(I){return Ce(I)}),q({type:"reset"})},[o,je,Ce,P]),it=(0,j.useCallback)(function(){if(te.current){q({type:"openDialog"}),M();var O={multiple:s,types:L};window.showOpenFilePicker(O).then(function(I){return o(I)}).then(function(I){je(I,null),q({type:"closeDialog"})}).catch(function(I){jl(I)?(k(I),q({type:"closeDialog"})):ql(I)?(te.current=!1,Y.current?(Y.current.value=null,Y.current.click()):Ce(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Ce(I)});return}Y.current&&(q({type:"openDialog"}),M(),Y.current.value=null,Y.current.click())},[q,M,k,_,je,Ce,L,s]),Rt=(0,j.useCallback)(function(O){!U.current||!U.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),it())},[U,it]),Wt=(0,j.useCallback)(function(){q({type:"focus"})},[]),Vt=(0,j.useCallback)(function(){q({type:"blur"})},[]),Pt=(0,j.useCallback)(function(){d||(Bl()?setTimeout(it,0):it())},[d,it]),Xe=function(I){return n?null:I},Lt=function(I){return w?null:Xe(I)},Ct=function(I){return y?null:Xe(I)},He=function(I){P&&I.stopPropagation()},ht=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=O.refKey,oe=I===void 0?"ref":I,ue=O.role,be=O.onKeyDown,Qt=O.onFocus,Dt=O.onBlur,$r=O.onClick,Qr=O.onDragEnter,zr=O.onDragOver,h=O.onDragLeave,T=O.onDrop,S=xo(O,ph);return ae(ae(oa({onKeyDown:Lt(at(be,Rt)),onFocus:Lt(at(Qt,Wt)),onBlur:Lt(at(Dt,Vt)),onClick:Xe(at($r,Pt)),onDragEnter:Ct(at(Qr,xt)),onDragOver:Ct(at(zr,Ye)),onDragLeave:Ct(at(h,Ot)),onDrop:Ct(at(T,ot)),role:typeof ue=="string"&&ue!==""?ue:"presentation"},oe,U),!n&&!w?{tabIndex:0}:{}),S)}},[U,Rt,Wt,Vt,Pt,xt,Ye,Ot,ot,w,y,n]),$t=(0,j.useCallback)(function(O){O.stopPropagation()},[]),Tt=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=O.refKey,oe=I===void 0?"ref":I,ue=O.onChange,be=O.onClick,Qt=xo(O,dh),Dt=oa({accept:F,multiple:s,type:"file",style:{display:"none"},onChange:Xe(at(ue,ot)),onClick:Xe(at(be,$t)),tabIndex:-1},oe,Y);return ae(ae({},Dt),Qt)}},[Y,r,s,ot,n]);return ae(ae({},$),{},{isFocused:ie&&!n,getRootProps:ht,getInputProps:Tt,rootRef:U,inputRef:Y,open:Xe(it)})}function xh(e,t){switch(t.type){case"focus":return ae(ae({},e),{},{isFocused:!0});case"blur":return ae(ae({},e),{},{isFocused:!1});case"openDialog":return ae(ae({},ia),{},{isFileDialogActive:!0});case"closeDialog":return ae(ae({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ae(ae({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ae(ae({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ae({},ia);default:return e}}function $l(){}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sn(e,t)}function Ve(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sn(e,t)}var Je=function(){function e(){this.listeners=[]}var t=e.prototype;return t.subscribe=function(n){var o=this,i=n||function(){};return this.listeners.push(i),this.onSubscribe(),function(){o.listeners=o.listeners.filter(function(a){return a!==i}),o.onUnsubscribe()}},t.hasListeners=function(){return this.listeners.length>0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}();function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u";function se(){}function Xl(e,t){return typeof e=="function"?e(t):e}function ln(e){return typeof e=="number"&&e>=0&&e!==1/0}function un(e){return Array.isArray(e)?e:[e]}function Oo(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ir(e,t,r){return pn(e)?typeof t=="function"?D({},r,{queryKey:e,queryFn:t}):D({},t,{queryKey:e}):e}function Kl(e,t,r){return pn(e)?typeof t=="function"?D({},r,{mutationKey:e,mutationFn:t}):D({},t,{mutationKey:e}):typeof e=="function"?D({},t,{mutationFn:e}):D({},e)}function vt(e,t,r){return pn(e)?[D({},t,{queryKey:e}),r]:[e||{},t]}function Oh(e,t){if(e===!0&&t===!0||e==null&&t==null)return"all";if(e===!1&&t===!1)return"none";var r=e??!t;return r?"active":"inactive"}function la(e,t){var r=e.active,n=e.exact,o=e.fetching,i=e.inactive,a=e.predicate,s=e.queryKey,u=e.stale;if(pn(s)){if(n){if(t.queryHash!==cn(s,t.options))return!1}else if(!fn(t.queryKey,s))return!1}var c=Oh(r,i);if(c==="none")return!1;if(c!=="all"){var l=t.isActive();if(c==="active"&&!l||c==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof o=="boolean"&&t.isFetching()!==o||a&&!a(t))}function ca(e,t){var r=e.exact,n=e.fetching,o=e.predicate,i=e.mutationKey;if(pn(i)){if(!t.options.mutationKey)return!1;if(r){if(Ft(t.options.mutationKey)!==Ft(i))return!1}else if(!fn(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function cn(e,t){var r=t?.queryKeyHashFn||Ft;return r(e)}function Ft(e){var t=un(e);return Ch(t)}function Ch(e){return JSON.stringify(e,function(t,r){return ua(r)?Object.keys(r).sort().reduce(function(n,o){return n[o]=r[o],n},{}):r})}function fn(e,t){return Zl(un(e),un(t))}function Zl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(function(r){return!Zl(e[r],t[r])}):!1}function Ar(e,t){if(e===t)return e;var r=Array.isArray(e)&&Array.isArray(t);if(r||ua(e)&&ua(t)){for(var n=r?e.length:Object.keys(e).length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{},s=0,u=0;u"u")return!0;var r=t.prototype;return!(!Yl(r)||!r.hasOwnProperty("isPrototypeOf"))}function Yl(e){return Object.prototype.toString.call(e)==="[object Object]"}function pn(e){return typeof e=="string"||Array.isArray(e)}function ec(e){return new Promise(function(t){setTimeout(t,e)})}function fa(e){Promise.resolve().then(e).catch(function(t){return setTimeout(function(){throw t})})}function Co(){if(typeof AbortController=="function")return new AbortController}var Th=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!tr&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",a,!1),function(){window.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setFocused(s):a.onFocus()})},r.setFocused=function(o){this.focused=o,o&&this.onFocus()},r.onFocus=function(){this.listeners.forEach(function(o){o()})},r.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},t}(Je),Bt=new Th;var wh=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!tr&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("online",a,!1),window.addEventListener("offline",a,!1),function(){window.removeEventListener("online",a),window.removeEventListener("offline",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setOnline(s):a.onOnline()})},r.setOnline=function(o){this.online=o,o&&this.onOnline()},r.onOnline=function(){this.listeners.forEach(function(o){o()})},r.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},t}(Je),Sr=new wh;function Ih(e){return Math.min(1e3*Math.pow(2,e),3e4)}function dn(e){return typeof e?.cancel=="function"}var tc=function(t){this.revert=t?.revert,this.silent=t?.silent};function Rr(e){return e instanceof tc}var To=function(t){var r=this,n=!1,o,i,a,s;this.abort=t.abort,this.cancel=function(f){return o?.(f)},this.cancelRetry=function(){n=!0},this.continueRetry=function(){n=!1},this.continue=function(){return i?.()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(f,m){a=f,s=m});var u=function(m){r.isResolved||(r.isResolved=!0,t.onSuccess==null||t.onSuccess(m),i?.(),a(m))},c=function(m){r.isResolved||(r.isResolved=!0,t.onError==null||t.onError(m),i?.(),s(m))},l=function(){return new Promise(function(m){i=m,r.isPaused=!0,t.onPause==null||t.onPause()}).then(function(){i=void 0,r.isPaused=!1,t.onContinue==null||t.onContinue()})},p=function f(){if(!r.isResolved){var m;try{m=t.fn()}catch(g){m=Promise.reject(g)}o=function(v){if(!r.isResolved&&(c(new tc(v)),r.abort==null||r.abort(),dn(m)))try{m.cancel()}catch{}},r.isTransportCancelable=dn(m),Promise.resolve(m).then(u).catch(function(g){var v,b;if(!r.isResolved){var _=(v=t.retry)!=null?v:3,x=(b=t.retryDelay)!=null?b:Ih,E=typeof x=="function"?x(r.failureCount,g):x,d=_===!0||typeof _=="number"&&r.failureCount<_||typeof _=="function"&&_(r.failureCount,g);if(n||!d){c(g);return}r.failureCount++,t.onFail==null||t.onFail(r.failureCount,g),ec(E).then(function(){if(!Bt.isFocused()||!Sr.isOnline())return l()}).then(function(){n?c(g):f()})}})}};p()};var Ah=function(){function e(){this.queue=[],this.transactions=0,this.notifyFn=function(r){r()},this.batchNotifyFn=function(r){r()}}var t=e.prototype;return t.batch=function(n){var o;this.transactions++;try{o=n()}finally{this.transactions--,this.transactions||this.flush()}return o},t.schedule=function(n){var o=this;this.transactions?this.queue.push(n):fa(function(){o.notifyFn(n)})},t.batchCalls=function(n){var o=this;return function(){for(var i=arguments.length,a=new Array(i),s=0;s"u"&&(s.exact=!0),this.queries.find(function(u){return la(s,u)})},r.findAll=function(o,i){var a=vt(o,i),s=a[0];return Object.keys(s).length>0?this.queries.filter(function(u){return la(s,u)}):this.queries},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onFocus()})})},r.onOnline=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onOnline()})})},t}(Je);var ic=function(){function e(r){this.options=D({},r.defaultOptions,r.options),this.mutationId=r.mutationId,this.mutationCache=r.mutationCache,this.observers=[],this.state=r.state||da(),this.meta=r.meta}var t=e.prototype;return t.setState=function(n){this.dispatch({type:"setState",state:n})},t.addObserver=function(n){this.observers.indexOf(n)===-1&&this.observers.push(n)},t.removeObserver=function(n){this.observers=this.observers.filter(function(o){return o!==n})},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(se).catch(se)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var n=this,o,i=this.state.status==="loading",a=Promise.resolve();return i||(this.dispatch({type:"loading",variables:this.options.variables}),a=a.then(function(){n.mutationCache.config.onMutate==null||n.mutationCache.config.onMutate(n.state.variables,n)}).then(function(){return n.options.onMutate==null?void 0:n.options.onMutate(n.state.variables)}).then(function(s){s!==n.state.context&&n.dispatch({type:"loading",context:s,variables:n.state.variables})})),a.then(function(){return n.executeMutation()}).then(function(s){o=s,n.mutationCache.config.onSuccess==null||n.mutationCache.config.onSuccess(o,n.state.variables,n.state.context,n)}).then(function(){return n.options.onSuccess==null?void 0:n.options.onSuccess(o,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(o,null,n.state.variables,n.state.context)}).then(function(){return n.dispatch({type:"success",data:o}),o}).catch(function(s){return n.mutationCache.config.onError==null||n.mutationCache.config.onError(s,n.state.variables,n.state.context,n),rr().error(s),Promise.resolve().then(function(){return n.options.onError==null?void 0:n.options.onError(s,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(void 0,s,n.state.variables,n.state.context)}).then(function(){throw n.dispatch({type:"error",error:s}),s})})},t.executeMutation=function(){var n=this,o;return this.retryer=new To({fn:function(){return n.options.mutationFn?n.options.mutationFn(n.state.variables):Promise.reject("No mutationFn found")},onFail:function(){n.dispatch({type:"failed"})},onPause:function(){n.dispatch({type:"pause"})},onContinue:function(){n.dispatch({type:"continue"})},retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(n){var o=this;this.state=Sh(this.state,n),Q.batch(function(){o.observers.forEach(function(i){i.onMutationUpdate(n)}),o.mutationCache.notify(o)})},e}();function da(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function Sh(e,t){switch(t.type){case"failed":return D({},e,{failureCount:e.failureCount+1});case"pause":return D({},e,{isPaused:!0});case"continue":return D({},e,{isPaused:!1});case"loading":return D({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return D({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return D({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return D({},e,t.state);default:return e}}var ac=function(e){Ve(t,e);function t(n){var o;return o=e.call(this)||this,o.config=n||{},o.mutations=[],o.mutationId=0,o}var r=t.prototype;return r.build=function(o,i,a){var s=new ic({mutationCache:this,mutationId:++this.mutationId,options:o.defaultMutationOptions(i),state:a,defaultOptions:i.mutationKey?o.getMutationDefaults(i.mutationKey):void 0,meta:i.meta});return this.add(s),s},r.add=function(o){this.mutations.push(o),this.notify(o)},r.remove=function(o){this.mutations=this.mutations.filter(function(i){return i!==o}),o.cancel(),this.notify(o)},r.clear=function(){var o=this;Q.batch(function(){o.mutations.forEach(function(i){o.remove(i)})})},r.getAll=function(){return this.mutations},r.find=function(o){return typeof o.exact>"u"&&(o.exact=!0),this.mutations.find(function(i){return ca(o,i)})},r.findAll=function(o){return this.mutations.filter(function(i){return ca(o,i)})},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){this.resumePausedMutations()},r.onOnline=function(){this.resumePausedMutations()},r.resumePausedMutations=function(){var o=this.mutations.filter(function(i){return i.state.isPaused});return Q.batch(function(){return o.reduce(function(i,a){return i.then(function(){return a.continue().catch(se)})},Promise.resolve())})},t}(Je);function uc(){return{onFetch:function(t){t.fetchFn=function(){var r,n,o,i,a,s,u=(r=t.fetchOptions)==null||(n=r.meta)==null?void 0:n.refetchPage,c=(o=t.fetchOptions)==null||(i=o.meta)==null?void 0:i.fetchMore,l=c?.pageParam,p=c?.direction==="forward",f=c?.direction==="backward",m=((a=t.state.data)==null?void 0:a.pages)||[],g=((s=t.state.data)==null?void 0:s.pageParams)||[],v=Co(),b=v?.signal,_=g,x=!1,E=t.options.queryFn||function(){return Promise.reject("Missing queryFn")},d=function(U,Y,B,R){return _=R?[Y].concat(_):[].concat(_,[Y]),R?[B].concat(U):[].concat(U,[B])},w=function(U,Y,B,R){if(x)return Promise.reject("Cancelled");if(typeof B>"u"&&!Y&&U.length)return Promise.resolve(U);var $={queryKey:t.queryKey,signal:b,pageParam:B,meta:t.meta},q=E($),ie=Promise.resolve(q).then(function(te){return d(U,B,te,R)});if(dn(q)){var ce=ie;ce.cancel=q.cancel}return ie},y;if(!m.length)y=w([]);else if(p){var P=typeof l<"u",z=P?l:sc(t.options,m);y=w(m,P,z)}else if(f){var Z=typeof l<"u",F=Z?l:Rh(t.options,m);y=w(m,Z,F,!0)}else(function(){_=[];var k=typeof t.options.getNextPageParam>"u",U=u&&m[0]?u(m[0],0,m):!0;y=U?w([],k,g[0]):Promise.resolve(d([],g[0],m[0]));for(var Y=function($){y=y.then(function(q){var ie=u&&m[$]?u(m[$],$,m):!0;if(ie){var ce=k?g[$]:sc(t.options,q);return w(q,k,ce)}return Promise.resolve(d(q,g[$],m[$]))})},B=1;B"u"&&(l.revert=!0);var p=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.cancel(l)})});return Promise.all(p).then(se).catch(se)},t.invalidateQueries=function(n,o,i){var a,s,u,c=this,l=vt(n,o,i),p=l[0],f=l[1],m=D({},p,{active:(a=(s=p.refetchActive)!=null?s:p.active)!=null?a:!0,inactive:(u=p.refetchInactive)!=null?u:!1});return Q.batch(function(){return c.queryCache.findAll(p).forEach(function(g){g.invalidate()}),c.refetchQueries(m,f)})},t.refetchQueries=function(n,o,i){var a=this,s=vt(n,o,i),u=s[0],c=s[1],l=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.fetch(void 0,D({},c,{meta:{refetchPage:u?.refetchPage}}))})}),p=Promise.all(l).then(se);return c?.throwOnError||(p=p.catch(se)),p},t.fetchQuery=function(n,o,i){var a=Ir(n,o,i),s=this.defaultQueryOptions(a);typeof s.retry>"u"&&(s.retry=!1);var u=this.queryCache.build(this,s);return u.isStaleByTime(s.staleTime)?u.fetch(s):Promise.resolve(u.state.data)},t.prefetchQuery=function(n,o,i){return this.fetchQuery(n,o,i).then(se).catch(se)},t.fetchInfiniteQuery=function(n,o,i){var a=Ir(n,o,i);return a.behavior=uc(),this.fetchQuery(a)},t.prefetchInfiniteQuery=function(n,o,i){return this.fetchInfiniteQuery(n,o,i).then(se).catch(se)},t.cancelMutations=function(){var n=this,o=Q.batch(function(){return n.mutationCache.getAll().map(function(i){return i.cancel()})});return Promise.all(o).then(se).catch(se)},t.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},t.executeMutation=function(n){return this.mutationCache.build(this,n).execute()},t.getQueryCache=function(){return this.queryCache},t.getMutationCache=function(){return this.mutationCache},t.getDefaultOptions=function(){return this.defaultOptions},t.setDefaultOptions=function(n){this.defaultOptions=n},t.setQueryDefaults=function(n,o){var i=this.queryDefaults.find(function(a){return Ft(n)===Ft(a.queryKey)});i?i.defaultOptions=o:this.queryDefaults.push({queryKey:n,defaultOptions:o})},t.getQueryDefaults=function(n){var o;return n?(o=this.queryDefaults.find(function(i){return fn(n,i.queryKey)}))==null?void 0:o.defaultOptions:void 0},t.setMutationDefaults=function(n,o){var i=this.mutationDefaults.find(function(a){return Ft(n)===Ft(a.mutationKey)});i?i.defaultOptions=o:this.mutationDefaults.push({mutationKey:n,defaultOptions:o})},t.getMutationDefaults=function(n){var o;return n?(o=this.mutationDefaults.find(function(i){return fn(n,i.mutationKey)}))==null?void 0:o.defaultOptions:void 0},t.defaultQueryOptions=function(n){if(n?._defaulted)return n;var o=D({},this.defaultOptions.queries,this.getQueryDefaults(n?.queryKey),n,{_defaulted:!0});return!o.queryHash&&o.queryKey&&(o.queryHash=cn(o.queryKey,o)),o},t.defaultQueryObserverOptions=function(n){return this.defaultQueryOptions(n)},t.defaultMutationOptions=function(n){return n?._defaulted?n:D({},this.defaultOptions.mutations,this.getMutationDefaults(n?.mutationKey),n,{_defaulted:!0})},t.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},e}();var va=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.options=o,i.trackedProps=[],i.selectError=null,i.bindMethods(),i.setOptions(o),i}var r=t.prototype;return r.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},r.onSubscribe=function(){this.listeners.length===1&&(this.currentQuery.addObserver(this),lc(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},r.onUnsubscribe=function(){this.listeners.length||this.destroy()},r.shouldFetchOnReconnect=function(){return ha(this.currentQuery,this.options,this.options.refetchOnReconnect)},r.shouldFetchOnWindowFocus=function(){return ha(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},r.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},r.setOptions=function(o,i){var a=this.options,s=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(o),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),this.updateQuery();var u=this.hasListeners();u&&cc(this.currentQuery,s,this.options,a)&&this.executeFetch(),this.updateResult(i),u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},r.getOptimisticResult=function(o){var i=this.client.defaultQueryObserverOptions(o),a=this.client.getQueryCache().build(this.client,i);return this.createResult(a,i)},r.getCurrentResult=function(){return this.currentResult},r.trackResult=function(o,i){var a=this,s={},u=function(l){a.trackedProps.includes(l)||a.trackedProps.push(l)};return Object.keys(o).forEach(function(c){Object.defineProperty(s,c,{configurable:!1,enumerable:!0,get:function(){return u(c),o[c]}})}),(i.useErrorBoundary||i.suspense)&&u("error"),s},r.getNextResult=function(o){var i=this;return new Promise(function(a,s){var u=i.subscribe(function(c){c.isFetching||(u(),c.isError&&o?.throwOnError?s(c.error):a(c))})})},r.getCurrentQuery=function(){return this.currentQuery},r.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},r.refetch=function(o){return this.fetch(D({},o,{meta:{refetchPage:o?.refetchPage}}))},r.fetchOptimistic=function(o){var i=this,a=this.client.defaultQueryObserverOptions(o),s=this.client.getQueryCache().build(this.client,a);return s.fetch().then(function(){return i.createResult(s,a)})},r.fetch=function(o){var i=this;return this.executeFetch(o).then(function(){return i.updateResult(),i.currentResult})},r.executeFetch=function(o){this.updateQuery();var i=this.currentQuery.fetch(this.options,o);return o?.throwOnError||(i=i.catch(se)),i},r.updateStaleTimeout=function(){var o=this;if(this.clearStaleTimeout(),!(tr||this.currentResult.isStale||!ln(this.options.staleTime))){var i=Oo(this.currentResult.dataUpdatedAt,this.options.staleTime),a=i+1;this.staleTimeoutId=setTimeout(function(){o.currentResult.isStale||o.updateResult()},a)}},r.computeRefetchInterval=function(){var o;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(o=this.options.refetchInterval)!=null?o:!1},r.updateRefetchInterval=function(o){var i=this;this.clearRefetchInterval(),this.currentRefetchInterval=o,!(tr||this.options.enabled===!1||!ln(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(i.options.refetchIntervalInBackground||Bt.isFocused())&&i.executeFetch()},this.currentRefetchInterval))},r.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},r.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},r.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},r.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},r.createResult=function(o,i){var a=this.currentQuery,s=this.options,u=this.currentResult,c=this.currentResultState,l=this.currentResultOptions,p=o!==a,f=p?o.state:this.currentQueryInitialState,m=p?this.currentResult:this.previousQueryResult,g=o.state,v=g.dataUpdatedAt,b=g.error,_=g.errorUpdatedAt,x=g.isFetching,E=g.status,d=!1,w=!1,y;if(i.optimisticResults){var P=this.hasListeners(),z=!P&&lc(o,i),Z=P&&cc(o,a,i,s);(z||Z)&&(x=!0,v||(E="loading"))}if(i.keepPreviousData&&!g.dataUpdateCount&&m?.isSuccess&&E!=="error")y=m.data,v=m.dataUpdatedAt,E=m.status,d=!0;else if(i.select&&typeof g.data<"u")if(u&&g.data===c?.data&&i.select===this.selectFn)y=this.selectResult;else try{this.selectFn=i.select,y=i.select(g.data),i.structuralSharing!==!1&&(y=Ar(u?.data,y)),this.selectResult=y,this.selectError=null}catch(M){rr().error(M),this.selectError=M}else y=g.data;if(typeof i.placeholderData<"u"&&typeof y>"u"&&(E==="loading"||E==="idle")){var F;if(u?.isPlaceholderData&&i.placeholderData===l?.placeholderData)F=u.data;else if(F=typeof i.placeholderData=="function"?i.placeholderData():i.placeholderData,i.select&&typeof F<"u")try{F=i.select(F),i.structuralSharing!==!1&&(F=Ar(u?.data,F)),this.selectError=null}catch(M){rr().error(M),this.selectError=M}typeof F<"u"&&(E="success",y=F,w=!0)}this.selectError&&(b=this.selectError,y=this.selectResult,_=Date.now(),E="error");var L={status:E,isLoading:E==="loading",isSuccess:E==="success",isError:E==="error",isIdle:E==="idle",data:y,dataUpdatedAt:v,error:b,errorUpdatedAt:_,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:x,isRefetching:x&&E!=="loading",isLoadingError:E==="error"&&g.dataUpdatedAt===0,isPlaceholderData:w,isPreviousData:d,isRefetchError:E==="error"&&g.dataUpdatedAt!==0,isStale:ga(o,i),refetch:this.refetch,remove:this.remove};return L},r.shouldNotifyListeners=function(o,i){if(!i)return!0;var a=this.options,s=a.notifyOnChangeProps,u=a.notifyOnChangePropsExclusions;if(!s&&!u||s==="tracked"&&!this.trackedProps.length)return!0;var c=s==="tracked"?this.trackedProps:s;return Object.keys(o).some(function(l){var p=l,f=o[p]!==i[p],m=c?.some(function(v){return v===l}),g=u?.some(function(v){return v===l});return f&&!g&&(!c||m)})},r.updateResult=function(o){var i=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!Jl(this.currentResult,i)){var a={cache:!0};o?.listeners!==!1&&this.shouldNotifyListeners(this.currentResult,i)&&(a.listeners=!0),this.notify(D({},a,o))}},r.updateQuery=function(){var o=this.client.getQueryCache().build(this.client,this.options);if(o!==this.currentQuery){var i=this.currentQuery;this.currentQuery=o,this.currentQueryInitialState=o.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(i?.removeObserver(this),o.addObserver(this))}},r.onQueryUpdate=function(o){var i={};o.type==="success"?i.onSuccess=!0:o.type==="error"&&!Rr(o.error)&&(i.onError=!0),this.updateResult(i),this.hasListeners()&&this.updateTimers()},r.notify=function(o){var i=this;Q.batch(function(){o.onSuccess?(i.options.onSuccess==null||i.options.onSuccess(i.currentResult.data),i.options.onSettled==null||i.options.onSettled(i.currentResult.data,null)):o.onError&&(i.options.onError==null||i.options.onError(i.currentResult.error),i.options.onSettled==null||i.options.onSettled(void 0,i.currentResult.error)),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)}),o.cache&&i.client.getQueryCache().notify({query:i.currentQuery,type:"observerResultsUpdated"})})},t}(Je);function Ph(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function lc(e,t){return Ph(e,t)||e.state.dataUpdatedAt>0&&ha(e,t,t.refetchOnMount)}function ha(e,t,r){if(t.enabled!==!1){var n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ga(e,t)}return!1}function cc(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&ga(e,r)}function ga(e,t){return e.isStaleByTime(t.staleTime)}var fc=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.setOptions(o),i.bindMethods(),i.updateResult(),i}var r=t.prototype;return r.bindMethods=function(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)},r.setOptions=function(o){this.options=this.client.defaultMutationOptions(o)},r.onUnsubscribe=function(){if(!this.listeners.length){var o;(o=this.currentMutation)==null||o.removeObserver(this)}},r.onMutationUpdate=function(o){this.updateResult();var i={listeners:!0};o.type==="success"?i.onSuccess=!0:o.type==="error"&&(i.onError=!0),this.notify(i)},r.getCurrentResult=function(){return this.currentResult},r.reset=function(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})},r.mutate=function(o,i){return this.mutateOptions=i,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,D({},this.options,{variables:typeof o<"u"?o:this.options.variables})),this.currentMutation.addObserver(this),this.currentMutation.execute()},r.updateResult=function(){var o=this.currentMutation?this.currentMutation.state:da(),i=D({},o,{isLoading:o.status==="loading",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset});this.currentResult=i},r.notify=function(o){var i=this;Q.batch(function(){i.mutateOptions&&(o.onSuccess?(i.mutateOptions.onSuccess==null||i.mutateOptions.onSuccess(i.currentResult.data,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(i.currentResult.data,null,i.currentResult.variables,i.currentResult.context)):o.onError&&(i.mutateOptions.onError==null||i.mutateOptions.onError(i.currentResult.error,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(void 0,i.currentResult.error,i.currentResult.variables,i.currentResult.context))),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)})})},t}(Je);var dc=W(wo()),mc=dc.default.unstable_batchedUpdates;Q.setBatchNotifyFunction(mc);var hc=console;pa(hc);var Ht=W(J()),vc=Ht.default.createContext(void 0),gc=Ht.default.createContext(!1);function yc(e){return e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=vc),window.ReactQueryClientContext):vc}var gt=function(){var t=Ht.default.useContext(yc(Ht.default.useContext(gc)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Pr=function(t){var r=t.client,n=t.contextSharing,o=n===void 0?!1:n,i=t.children;Ht.default.useEffect(function(){return r.mount(),function(){r.unmount()}},[r]);var a=yc(o);return Ht.default.createElement(gc.Provider,{value:o},Ht.default.createElement(a.Provider,{value:r},i))};var ya=W(J());function Lh(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var Dh=ya.default.createContext(Lh()),bc=function(){return ya.default.useContext(Dh)};var Lr=W(J());function Io(e,t,r){return typeof t=="function"?t.apply(void 0,r):typeof t=="boolean"?t:!!e}function Dr(e,t,r){var n=Lr.default.useRef(!1),o=Lr.default.useState(0),i=o[1],a=Kl(e,t,r),s=gt(),u=Lr.default.useRef();u.current?u.current.setOptions(a):u.current=new fc(s,a);var c=u.current.getCurrentResult();Lr.default.useEffect(function(){n.current=!0;var p=u.current.subscribe(Q.batchCalls(function(){n.current&&i(function(f){return f+1})}));return function(){n.current=!1,p()}},[]);var l=Lr.default.useCallback(function(p,f){u.current.mutate(p,f).catch(se)},[]);if(c.error&&Io(void 0,u.current.options.useErrorBoundary,[c.error]))throw c.error;return D({},c,{mutate:l,mutateAsync:c.mutate})}var Nr=W(J());function _c(e,t){var r=Nr.default.useRef(!1),n=Nr.default.useState(0),o=n[1],i=gt(),a=bc(),s=i.defaultQueryObserverOptions(e);s.optimisticResults=!0,s.onError&&(s.onError=Q.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Q.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Q.batchCalls(s.onSettled)),s.suspense&&(typeof s.staleTime!="number"&&(s.staleTime=1e3),s.cacheTime===0&&(s.cacheTime=1)),(s.suspense||s.useErrorBoundary)&&(a.isReset()||(s.retryOnMount=!1));var u=Nr.default.useState(function(){return new t(i,s)}),c=u[0],l=c.getOptimisticResult(s);if(Nr.default.useEffect(function(){r.current=!0,a.clearReset();var p=c.subscribe(Q.batchCalls(function(){r.current&&o(function(f){return f+1})}));return c.updateResult(),function(){r.current=!1,p()}},[a,c]),Nr.default.useEffect(function(){c.setOptions(s,{listeners:!1})},[s,c]),s.suspense&&l.isLoading)throw c.fetchOptimistic(s).then(function(p){var f=p.data;s.onSuccess==null||s.onSuccess(f),s.onSettled==null||s.onSettled(f,null)}).catch(function(p){a.clearReset(),s.onError==null||s.onError(p),s.onSettled==null||s.onSettled(void 0,p)});if(l.isError&&!a.isReset()&&!l.isFetching&&Io(s.suspense,s.useErrorBoundary,[l.error,c.getCurrentQuery()]))throw l.error;return s.notifyOnChangeProps==="tracked"&&(l=c.trackResult(l,s)),l}function Ao(e,t,r){var n=Ir(e,t,r);return _c(n,va)}var Sf=W(Af(),1);var Iv=Sf.default.create(),gn=new ma({defaultOptions:{queries:{suspense:!0,refetchOnWindowFocus:!1,cacheTime:1/0}}});async function nr(e,t={}){try{return(await Iv({url:e,withCredentials:!0,...t})).data}catch(r){throw Error(r)}}function Rf(e){return Ao(["LibraryImage",e],()=>nr("/open_api/library/image",{method:"GET",params:{id:e.id||null,limit:e.limit||5,offset:e.offset||0,title:e.title||null,tagId:e.tagId||null}}),{keepPreviousData:!0,onSuccess:t=>{}})}function Pf(){let e=gt();return Dr(t=>nr("/open_api/library/image",{method:"POST",headers:{"content-type":"multipart/form-data"},data:t}),{onSuccess:t=>{e.setQueryData(["LibraryImage"],r=>r&&Array.isArray(r)?[...r,t]:r)}})}function Lf(){let e=gt();return Dr(t=>nr(`/open_api/library/image/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.filter(o=>o.id!==r):n)}})}function Ha(){return Ao(["LibraryTag"],()=>nr("/open_api/library/tag",{method:"GET"}),{keepPreviousData:!0,onSuccess:e=>{}})}function Df(){let e=gt();return Dr(t=>nr(`/open_api/library/image_tag/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.map(o=>o.tags&&o.tags.length?{...o,tags:o.tags.filter(({imageTag:i})=>i.id!==r)}:o):n)}})}function Nf(){let e=gt();return Dr(t=>nr("/open_api/library/image_tag",{method:"POST",data:t}),{onSuccess:t=>{e.setQueriesData(["LibraryImage"],r=>r&&Array.isArray(r)?r.map(n=>n.id===t.imageTag.imageId?{...n,tags:[...n.tags,t]}:n):r)}})}var ka=W(J()),Ua=e=>ka.createElement("svg",{width:19,height:18,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ka.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var ja=W(J()),Mf=e=>ja.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ja.createElement("path",{d:"M3.91875 0.498484C4.04531 0.257609 4.30547 0.105469 4.58906 0.105469H7.41094C7.69453 0.105469 7.95469 0.257609 8.08125 0.498484L8.25 0.816406H10.5C10.9148 0.816406 11.25 1.13477 11.25 1.52734C11.25 1.91991 10.9148 2.23828 10.5 2.23828H1.5C1.08586 2.23828 0.75 1.91991 0.75 1.52734C0.75 1.13477 1.08586 0.816406 1.5 0.816406H3.75L3.91875 0.498484ZM1.47891 2.94922H10.5V10.0586C10.5 10.8428 9.82734 11.4805 9 11.4805H2.97891C2.17148 11.4805 1.47891 10.8428 1.47891 10.0586V2.94922ZM3.35391 4.72656V9.70312C3.35391 9.89863 3.54375 10.0586 3.72891 10.0586C3.95625 10.0586 4.10391 9.89863 4.10391 9.70312V4.72656C4.10391 4.53105 3.95625 4.37109 3.72891 4.37109C3.54375 4.37109 3.35391 4.53105 3.35391 4.72656ZM5.60391 4.72656V9.70312C5.60391 9.89863 5.79375 10.0586 5.97891 10.0586C6.20625 10.0586 6.375 9.89863 6.375 9.70312V4.72656C6.375 4.53105 6.20625 4.37109 5.97891 4.37109C5.79375 4.37109 5.60391 4.53105 5.60391 4.72656ZM7.875 4.72656V9.70312C7.875 9.89863 8.04375 10.0586 8.25 10.0586C8.45625 10.0586 8.625 9.89863 8.625 9.70312V4.72656C8.625 4.53105 8.45625 4.37109 8.25 4.37109C8.04375 4.37109 7.875 4.53105 7.875 4.72656Z",fill:"white"}));var qa=W(J()),Ff=e=>qa.createElement("svg",{width:8,height:8,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},qa.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var Os=W(bp()),Qe=W(J());var dd=W(J());var le="top",ge="bottom",me="right",fe="left",Zo="auto",jt=[le,ge,me,fe],It="start",sr="end",_p="clippingParents",Jo="viewport",jr="popper",Ep="reference",Za=jt.reduce(function(e,t){return e.concat([t+"-"+It,t+"-"+sr])},[]),ei=[].concat(jt,[Zo]).reduce(function(e,t){return e.concat([t,t+"-"+It,t+"-"+sr])},[]),ey="beforeRead",ty="read",ry="afterRead",ny="beforeMain",oy="main",iy="afterMain",ay="beforeWrite",sy="write",uy="afterWrite",xp=[ey,ty,ry,ny,oy,iy,ay,sy,uy];function xe(e){return e?(e.nodeName||"").toLowerCase():null}function pe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _t(e){var t=pe(e).Element;return e instanceof t||e instanceof Element}function ye(e){var t=pe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qr(e){if(typeof ShadowRoot>"u")return!1;var t=pe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ly(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!ye(i)||!xe(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function cy(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(u,c){return u[c]="",u},{});!ye(o)||!xe(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(u){o.removeAttribute(u)}))})}}var wn={name:"applyStyles",enabled:!0,phase:"write",fn:ly,effect:cy,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var lt=Math.max,ur=Math.min,At=Math.round;function tt(e,t){t===void 0&&(t=!1);var r=e.getBoundingClientRect(),n=1,o=1;if(ye(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(n=At(r.width)/a||1),i>0&&(o=At(r.height)/i||1)}return{width:r.width/n,height:r.height/o,top:r.top/o,right:r.right/n,bottom:r.bottom/o,left:r.left/n,x:r.left/n,y:r.top/o}}function lr(e){var t=tt(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function In(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&qr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Me(e){return pe(e).getComputedStyle(e)}function Ja(e){return["table","td","th"].indexOf(xe(e))>=0}function Ie(e){return((_t(e)?e.ownerDocument:e.document)||window.document).documentElement}function St(e){return xe(e)==="html"?e:e.assignedSlot||e.parentNode||(qr(e)?e.host:null)||Ie(e)}function Op(e){return!ye(e)||Me(e).position==="fixed"?null:e.offsetParent}function fy(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&ye(e)){var n=Me(e);if(n.position==="fixed")return null}var o=St(e);for(qr(o)&&(o=o.host);ye(o)&&["html","body"].indexOf(xe(o))<0;){var i=Me(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function ct(e){for(var t=pe(e),r=Op(e);r&&Ja(r)&&Me(r).position==="static";)r=Op(r);return r&&(xe(r)==="html"||xe(r)==="body"&&Me(r).position==="static")?t:r||fy(e)||t}function cr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function fr(e,t,r){return lt(e,ur(t,r))}function Cp(e,t,r){var n=fr(e,t,r);return n>r?r:n}function An(){return{top:0,right:0,bottom:0,left:0}}function Sn(e){return Object.assign({},An(),e)}function Rn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var py=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Sn(typeof t!="number"?t:Rn(t,jt))};function dy(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=Oe(r.placement),u=cr(s),c=[fe,me].indexOf(s)>=0,l=c?"height":"width";if(!(!i||!a)){var p=py(o.padding,r),f=lr(i),m=u==="y"?le:fe,g=u==="y"?ge:me,v=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],b=a[u]-r.rects.reference[u],_=ct(i),x=_?u==="y"?_.clientHeight||0:_.clientWidth||0:0,E=v/2-b/2,d=p[m],w=x-f[l]-p[g],y=x/2-f[l]/2+E,P=fr(d,y,w),z=u;r.modifiersData[n]=(t={},t[z]=P,t.centerOffset=P-y,t)}}function my(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!In(t.elements.popper,o)||(t.elements.arrow=o))}var Tp={name:"arrow",enabled:!0,phase:"main",fn:dy,effect:my,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rt(e){return e.split("-")[1]}var hy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vy(e){var t=e.x,r=e.y,n=window,o=n.devicePixelRatio||1;return{x:At(t*o)/o||0,y:At(r*o)/o||0}}function wp(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,p=e.isFixed,f=a.x,m=f===void 0?0:f,g=a.y,v=g===void 0?0:g,b=typeof l=="function"?l({x:m,y:v}):{x:m,y:v};m=b.x,v=b.y;var _=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),E=fe,d=le,w=window;if(c){var y=ct(r),P="clientHeight",z="clientWidth";if(y===pe(r)&&(y=Ie(r),Me(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",z="scrollWidth")),y=y,o===le||(o===fe||o===me)&&i===sr){d=ge;var Z=p&&y===w&&w.visualViewport?w.visualViewport.height:y[P];v-=Z-n.height,v*=u?1:-1}if(o===fe||(o===le||o===ge)&&i===sr){E=me;var F=p&&y===w&&w.visualViewport?w.visualViewport.width:y[z];m-=F-n.width,m*=u?1:-1}}var L=Object.assign({position:s},c&&hy),M=l===!0?vy({x:m,y:v}):{x:m,y:v};if(m=M.x,v=M.y,u){var k;return Object.assign({},L,(k={},k[d]=x?"0":"",k[E]=_?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",k))}return Object.assign({},L,(t={},t[d]=x?v+"px":"",t[E]=_?m+"px":"",t.transform="",t))}function gy(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,s=r.roundOffsets,u=s===void 0?!0:s;if(!1)var c;var l={placement:Oe(t.placement),variation:rt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wp(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wp(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Ip={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gy,data:{}};var ti={passive:!0};function yy(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,a=n.resize,s=a===void 0?!0:a,u=pe(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",r.update,ti)}),s&&u.addEventListener("resize",r.update,ti),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",r.update,ti)}),s&&u.removeEventListener("resize",r.update,ti)}}var Ap={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yy,data:{}};var by={left:"right",right:"left",bottom:"top",top:"bottom"};function Gr(e){return e.replace(/left|right|bottom|top/g,function(t){return by[t]})}var _y={start:"end",end:"start"};function ri(e){return e.replace(/start|end/g,function(t){return _y[t]})}function pr(e){var t=pe(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function dr(e){return tt(Ie(e)).left+pr(e).scrollLeft}function es(e){var t=pe(e),r=Ie(e),n=t.visualViewport,o=r.clientWidth,i=r.clientHeight,a=0,s=0;return n&&(o=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,s=n.offsetTop)),{width:o,height:i,x:a+dr(e),y:s}}function ts(e){var t,r=Ie(e),n=pr(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=lt(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=lt(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+dr(e),u=-n.scrollTop;return Me(o||r).direction==="rtl"&&(s+=lt(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}function mr(e){var t=Me(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function ni(e){return["html","body","#document"].indexOf(xe(e))>=0?e.ownerDocument.body:ye(e)&&mr(e)?e:ni(St(e))}function qt(e,t){var r;t===void 0&&(t=[]);var n=ni(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pe(n),a=o?[i].concat(i.visualViewport||[],mr(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(qt(St(a)))}function Wr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ey(e){var t=tt(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Sp(e,t){return t===Jo?Wr(es(e)):_t(t)?Ey(t):Wr(ts(Ie(e)))}function xy(e){var t=qt(St(e)),r=["absolute","fixed"].indexOf(Me(e).position)>=0,n=r&&ye(e)?ct(e):e;return _t(n)?t.filter(function(o){return _t(o)&&In(o,n)&&xe(o)!=="body"}):[]}function rs(e,t,r){var n=t==="clippingParents"?xy(e):[].concat(t),o=[].concat(n,[r]),i=o[0],a=o.reduce(function(s,u){var c=Sp(e,u);return s.top=lt(c.top,s.top),s.right=ur(c.right,s.right),s.bottom=ur(c.bottom,s.bottom),s.left=lt(c.left,s.left),s},Sp(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Pn(e){var t=e.reference,r=e.element,n=e.placement,o=n?Oe(n):null,i=n?rt(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,u;switch(o){case le:u={x:a,y:t.y-r.height};break;case ge:u={x:a,y:t.y+t.height};break;case me:u={x:t.x+t.width,y:s};break;case fe:u={x:t.x-r.width,y:s};break;default:u={x:t.x,y:t.y}}var c=o?cr(o):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case It:u[c]=u[c]-(t[l]/2-r[l]/2);break;case sr:u[c]=u[c]+(t[l]/2-r[l]/2);break;default:}}return u}function ft(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.boundary,a=i===void 0?_p:i,s=r.rootBoundary,u=s===void 0?Jo:s,c=r.elementContext,l=c===void 0?jr:c,p=r.altBoundary,f=p===void 0?!1:p,m=r.padding,g=m===void 0?0:m,v=Sn(typeof g!="number"?g:Rn(g,jt)),b=l===jr?Ep:jr,_=e.rects.popper,x=e.elements[f?b:l],E=rs(_t(x)?x:x.contextElement||Ie(e.elements.popper),a,u),d=tt(e.elements.reference),w=Pn({reference:d,element:_,strategy:"absolute",placement:o}),y=Wr(Object.assign({},_,w)),P=l===jr?y:d,z={top:E.top-P.top+v.top,bottom:P.bottom-E.bottom+v.bottom,left:E.left-P.left+v.left,right:P.right-E.right+v.right},Z=e.modifiersData.offset;if(l===jr&&Z){var F=Z[o];Object.keys(z).forEach(function(L){var M=[me,ge].indexOf(L)>=0?1:-1,k=[le,ge].indexOf(L)>=0?"y":"x";z[L]+=F[k]*M})}return z}function ns(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,u=r.allowedAutoPlacements,c=u===void 0?ei:u,l=rt(n),p=l?s?Za:Za.filter(function(g){return rt(g)===l}):jt,f=p.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=p);var m=f.reduce(function(g,v){return g[v]=ft(e,{placement:v,boundary:o,rootBoundary:i,padding:a})[Oe(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Oy(e){if(Oe(e)===Zo)return[];var t=Gr(e);return[ri(e),t,ri(t)]}function Cy(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!0:a,u=r.fallbackPlacements,c=r.padding,l=r.boundary,p=r.rootBoundary,f=r.altBoundary,m=r.flipVariations,g=m===void 0?!0:m,v=r.allowedAutoPlacements,b=t.options.placement,_=Oe(b),x=_===b,E=u||(x||!g?[Gr(b)]:Oy(b)),d=[b].concat(E).reduce(function(Ae,Be){return Ae.concat(Oe(Be)===Zo?ns(t,{placement:Be,boundary:l,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:v}):Be)},[]),w=t.rects.reference,y=t.rects.popper,P=new Map,z=!0,Z=d[0],F=0;F=0,Y=U?"width":"height",B=ft(t,{placement:L,boundary:l,rootBoundary:p,altBoundary:f,padding:c}),R=U?k?me:fe:k?ge:le;w[Y]>y[Y]&&(R=Gr(R));var $=Gr(R),q=[];if(i&&q.push(B[M]<=0),s&&q.push(B[R]<=0,B[$]<=0),q.every(function(Ae){return Ae})){Z=L,z=!1;break}P.set(L,q)}if(z)for(var ie=g?3:1,ce=function(Be){var Ce=d.find(function(xt){var Ye=P.get(xt);if(Ye)return Ye.slice(0,Be).every(function(Ot){return Ot})});if(Ce)return Z=Ce,"break"},te=ie;te>0;te--){var mt=ce(te);if(mt==="break")break}t.placement!==Z&&(t.modifiersData[n]._skip=!0,t.placement=Z,t.reset=!0)}}var Rp={name:"flip",enabled:!0,phase:"main",fn:Cy,requiresIfExists:["offset"],data:{_skip:!1}};function Pp(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Lp(e){return[le,me,ge,fe].some(function(t){return e[t]>=0})}function Ty(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ft(t,{elementContext:"reference"}),s=ft(t,{altBoundary:!0}),u=Pp(a,n),c=Pp(s,o,i),l=Lp(u),p=Lp(c);t.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}var Dp={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ty};function wy(e,t,r){var n=Oe(e),o=[fe,le].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[fe,me].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function Iy(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,a=ei.reduce(function(l,p){return l[p]=wy(p,t.rects,i),l},{}),s=a[t.placement],u=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}var Np={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Iy};function Ay(e){var t=e.state,r=e.name;t.modifiersData[r]=Pn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Mp={name:"popperOffsets",enabled:!0,phase:"read",fn:Ay,data:{}};function os(e){return e==="x"?"y":"x"}function Sy(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!1:a,u=r.boundary,c=r.rootBoundary,l=r.altBoundary,p=r.padding,f=r.tether,m=f===void 0?!0:f,g=r.tetherOffset,v=g===void 0?0:g,b=ft(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),_=Oe(t.placement),x=rt(t.placement),E=!x,d=cr(_),w=os(d),y=t.modifiersData.popperOffsets,P=t.rects.reference,z=t.rects.popper,Z=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,F=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(!!y){if(i){var k,U=d==="y"?le:fe,Y=d==="y"?ge:me,B=d==="y"?"height":"width",R=y[d],$=R+b[U],q=R-b[Y],ie=m?-z[B]/2:0,ce=x===It?P[B]:z[B],te=x===It?-z[B]:-P[B],mt=t.elements.arrow,Ae=m&&mt?lr(mt):{width:0,height:0},Be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:An(),Ce=Be[U],xt=Be[Y],Ye=fr(0,P[B],Ae[B]),Ot=E?P[B]/2-ie-Ye-Ce-F.mainAxis:ce-Ye-Ce-F.mainAxis,je=E?-P[B]/2+ie+Ye+xt+F.mainAxis:te+Ye+xt+F.mainAxis,ot=t.elements.arrow&&ct(t.elements.arrow),it=ot?d==="y"?ot.clientTop||0:ot.clientLeft||0:0,Rt=(k=L?.[d])!=null?k:0,Wt=R+Ot-Rt-it,Vt=R+je-Rt,Pt=fr(m?ur($,Wt):$,R,m?lt(q,Vt):q);y[d]=Pt,M[d]=Pt-R}if(s){var Xe,Lt=d==="x"?le:fe,Ct=d==="x"?ge:me,He=y[w],ht=w==="y"?"height":"width",$t=He+b[Lt],Tt=He-b[Ct],O=[le,fe].indexOf(_)!==-1,I=(Xe=L?.[w])!=null?Xe:0,oe=O?$t:He-P[ht]-z[ht]-I+F.altAxis,ue=O?He+P[ht]+z[ht]-I-F.altAxis:Tt,be=m&&O?Cp(oe,He,ue):fr(m?oe:$t,He,m?ue:Tt);y[w]=be,M[w]=be-He}t.modifiersData[n]=M}}var Fp={name:"preventOverflow",enabled:!0,phase:"main",fn:Sy,requiresIfExists:["offset"]};function is(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function as(e){return e===pe(e)||!ye(e)?pr(e):is(e)}function Ry(e){var t=e.getBoundingClientRect(),r=At(t.width)/e.offsetWidth||1,n=At(t.height)/e.offsetHeight||1;return r!==1||n!==1}function ss(e,t,r){r===void 0&&(r=!1);var n=ye(t),o=ye(t)&&Ry(t),i=Ie(t),a=tt(e,o),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(n||!n&&!r)&&((xe(t)!=="body"||mr(i))&&(s=as(t)),ye(t)?(u=tt(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=dr(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function Py(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var u=t.get(s);u&&o(u)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function us(e){var t=Py(e);return xp.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function ls(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function cs(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Bp={placement:"bottom",modifiers:[],strategy:"absolute"};function Hp(){for(var e=arguments.length,t=new Array(e),r=0;r-1}function Jp(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Up(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function My(e){return e.split(/\s+/).filter(Boolean)}function Vr(e){return[].concat(e)}function jp(e,t){e.indexOf(t)===-1&&e.push(t)}function Fy(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function By(e){return e.split("-")[0]}function ii(e){return[].slice.call(e)}function qp(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function Ln(){return document.createElement("div")}function ai(e){return["Element","Fragment"].some(function(t){return ys(e,t)})}function Hy(e){return ys(e,"NodeList")}function ky(e){return ys(e,"MouseEvent")}function Uy(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function jy(e){return ai(e)?[e]:Hy(e)?ii(e):Array.isArray(e)?e:ii(document.querySelectorAll(e))}function ds(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function Gp(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function qy(e){var t,r=Vr(e),n=r[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Gy(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,a=o.popperState,s=o.props,u=s.interactiveBorder,c=By(a.placement),l=a.modifiersData.offset;if(!l)return!0;var p=c==="bottom"?l.top.y:0,f=c==="top"?l.bottom.y:0,m=c==="right"?l.left.x:0,g=c==="left"?l.right.x:0,v=i.top-n+p>u,b=n-i.bottom-f>u,_=i.left-r+m>u,x=r-i.right-g>u;return v||b||_||x})}function ms(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}function Wp(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var Et={isTouch:!1},Vp=0;function Wy(){Et.isTouch||(Et.isTouch=!0,window.performance&&document.addEventListener("mousemove",ed))}function ed(){var e=performance.now();e-Vp<20&&(Et.isTouch=!1,document.removeEventListener("mousemove",ed)),Vp=e}function Vy(){var e=document.activeElement;if(Uy(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function $y(){document.addEventListener("touchstart",Wy,hr),window.addEventListener("blur",Vy)}var Qy=typeof window<"u"&&typeof document<"u",zy=Qy?!!window.msCrypto:!1;var Yy={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Xy={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},pt=Object.assign({appendTo:Zp,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Yy,Xy),Ky=Object.keys(pt),Zy=function(t){var r=Object.keys(t);r.forEach(function(n){pt[n]=t[n]})};function td(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,a=o.defaultValue;if(i){var s;n[i]=e[i]!==void 0?e[i]:(s=pt[i])!=null?s:a}return n},{});return Object.assign({},e,r)}function Jy(e,t){var r=t?Object.keys(td(Object.assign({},pt,{plugins:t}))):Ky,n=r.reduce(function(o,i){var a=(e.getAttribute("data-tippy-"+i)||"").trim();if(!a)return o;if(i==="content")o[i]=a;else try{o[i]=JSON.parse(a)}catch{o[i]=a}return o},{});return n}function $p(e,t){var r=Object.assign({},t,{content:Jp(t.content,[e])},t.ignoreAttributes?{}:Jy(e,t.plugins));return r.aria=Object.assign({},pt.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var e0=function(){return"innerHTML"};function vs(e,t){e[e0()]=t}function Qp(e){var t=Ln();return e===!0?t.className=Xp:(t.className=Kp,ai(e)?t.appendChild(e):vs(t,e)),t}function zp(e,t){ai(t.content)?(vs(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?vs(e,t.content):e.textContent=t.content)}function gs(e){var t=e.firstElementChild,r=ii(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(Yp)}),arrow:r.find(function(n){return n.classList.contains(Xp)||n.classList.contains(Kp)}),backdrop:r.find(function(n){return n.classList.contains(Ny)})}}function rd(e){var t=Ln(),r=Ln();r.className=Dy,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=Ln();n.className=Yp,n.setAttribute("data-state","hidden"),zp(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,a){var s=gs(t),u=s.box,c=s.content,l=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(i.content!==a.content||i.allowHTML!==a.allowHTML)&&zp(c,e.props),a.arrow?l?i.arrow!==a.arrow&&(u.removeChild(l),u.appendChild(Qp(a.arrow))):u.appendChild(Qp(a.arrow)):l&&u.removeChild(l)}return{popper:t,onUpdate:o}}rd.$$tippy=!0;var t0=1,oi=[],hs=[];function r0(e,t){var r=$p(e,Object.assign({},pt,td(qp(t)))),n,o,i,a=!1,s=!1,u=!1,c=!1,l,p,f,m=[],g=Up(Wt,r.interactiveDebounce),v,b=t0++,_=null,x=Fy(r.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},d={id:b,reference:e,popper:Ln(),popperInstance:_,props:r,state:E,plugins:x,clearDelayTimeouts:oe,setProps:ue,setContent:be,show:Qt,hide:Dt,hideWithInteractivity:$r,enable:O,disable:I,unmount:Qr,destroy:zr};if(!r.render)return d;var w=r.render(d),y=w.popper,P=w.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+d.id,d.popper=y,e._tippy=d,y._tippy=d;var z=x.map(function(h){return h.fn(d)}),Z=e.hasAttribute("aria-expanded");return ot(),ie(),R(),$("onCreate",[d]),r.showOnCreate&&$t(),y.addEventListener("mouseenter",function(){d.props.interactive&&d.state.isVisible&&d.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){d.props.interactive&&d.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",g)}),d;function F(){var h=d.props.touch;return Array.isArray(h)?h:[h,0]}function L(){return F()[0]==="hold"}function M(){var h;return!!((h=d.props.render)!=null&&h.$$tippy)}function k(){return v||e}function U(){var h=k().parentNode;return h?qy(h):document}function Y(){return gs(y)}function B(h){return d.state.isMounted&&!d.state.isVisible||Et.isTouch||l&&l.type==="focus"?0:ps(d.props.delay,h?0:1,pt.delay)}function R(h){h===void 0&&(h=!1),y.style.pointerEvents=d.props.interactive&&!h?"":"none",y.style.zIndex=""+d.props.zIndex}function $(h,T,S){if(S===void 0&&(S=!0),z.forEach(function(G){G[h]&&G[h].apply(G,T)}),S){var K;(K=d.props)[h].apply(K,T)}}function q(){var h=d.props.aria;if(!!h.content){var T="aria-"+h.content,S=y.id,K=Vr(d.props.triggerTarget||e);K.forEach(function(G){var Te=G.getAttribute(T);if(d.state.isVisible)G.setAttribute(T,Te?Te+" "+S:S);else{var Ke=Te&&Te.replace(S,"").trim();Ke?G.setAttribute(T,Ke):G.removeAttribute(T)}})}}function ie(){if(!(Z||!d.props.aria.expanded)){var h=Vr(d.props.triggerTarget||e);h.forEach(function(T){d.props.interactive?T.setAttribute("aria-expanded",d.state.isVisible&&T===k()?"true":"false"):T.removeAttribute("aria-expanded")})}}function ce(){U().removeEventListener("mousemove",g),oi=oi.filter(function(h){return h!==g})}function te(h){if(!(Et.isTouch&&(u||h.type==="mousedown"))){var T=h.composedPath&&h.composedPath()[0]||h.target;if(!(d.props.interactive&&Wp(y,T))){if(Vr(d.props.triggerTarget||e).some(function(S){return Wp(S,T)})){if(Et.isTouch||d.state.isVisible&&d.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[d,h]);d.props.hideOnClick===!0&&(d.clearDelayTimeouts(),d.hide(),s=!0,setTimeout(function(){s=!1}),d.state.isMounted||Ce())}}}function mt(){u=!0}function Ae(){u=!1}function Be(){var h=U();h.addEventListener("mousedown",te,!0),h.addEventListener("touchend",te,hr),h.addEventListener("touchstart",Ae,hr),h.addEventListener("touchmove",mt,hr)}function Ce(){var h=U();h.removeEventListener("mousedown",te,!0),h.removeEventListener("touchend",te,hr),h.removeEventListener("touchstart",Ae,hr),h.removeEventListener("touchmove",mt,hr)}function xt(h,T){Ot(h,function(){!d.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&T()})}function Ye(h,T){Ot(h,T)}function Ot(h,T){var S=Y().box;function K(G){G.target===S&&(ms(S,"remove",K),T())}if(h===0)return T();ms(S,"remove",p),ms(S,"add",K),p=K}function je(h,T,S){S===void 0&&(S=!1);var K=Vr(d.props.triggerTarget||e);K.forEach(function(G){G.addEventListener(h,T,S),m.push({node:G,eventType:h,handler:T,options:S})})}function ot(){L()&&(je("touchstart",Rt,{passive:!0}),je("touchend",Vt,{passive:!0})),My(d.props.trigger).forEach(function(h){if(h!=="manual")switch(je(h,Rt),h){case"mouseenter":je("mouseleave",Vt);break;case"focus":je(zy?"focusout":"blur",Pt);break;case"focusin":je("focusout",Pt);break}})}function it(){m.forEach(function(h){var T=h.node,S=h.eventType,K=h.handler,G=h.options;T.removeEventListener(S,K,G)}),m=[]}function Rt(h){var T,S=!1;if(!(!d.state.isEnabled||Xe(h)||s)){var K=((T=l)==null?void 0:T.type)==="focus";l=h,v=h.currentTarget,ie(),!d.state.isVisible&&ky(h)&&oi.forEach(function(G){return G(h)}),h.type==="click"&&(d.props.trigger.indexOf("mouseenter")<0||a)&&d.props.hideOnClick!==!1&&d.state.isVisible?S=!0:$t(h),h.type==="click"&&(a=!S),S&&!K&&Tt(h)}}function Wt(h){var T=h.target,S=k().contains(T)||y.contains(T);if(!(h.type==="mousemove"&&S)){var K=ht().concat(y).map(function(G){var Te,Ke=G._tippy,yr=(Te=Ke.popperInstance)==null?void 0:Te.state;return yr?{popperRect:G.getBoundingClientRect(),popperState:yr,props:r}:null}).filter(Boolean);Gy(K,h)&&(ce(),Tt(h))}}function Vt(h){var T=Xe(h)||d.props.trigger.indexOf("click")>=0&&a;if(!T){if(d.props.interactive){d.hideWithInteractivity(h);return}Tt(h)}}function Pt(h){d.props.trigger.indexOf("focusin")<0&&h.target!==k()||d.props.interactive&&h.relatedTarget&&y.contains(h.relatedTarget)||Tt(h)}function Xe(h){return Et.isTouch?L()!==h.type.indexOf("touch")>=0:!1}function Lt(){Ct();var h=d.props,T=h.popperOptions,S=h.placement,K=h.offset,G=h.getReferenceClientRect,Te=h.moveTransition,Ke=M()?gs(y).arrow:null,yr=G?{getBoundingClientRect:G,contextElement:G.contextElement||k()}:e,Is={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Un){var br=Un.state;if(M()){var Id=Y(),hi=Id.box;["placement","reference-hidden","escaped"].forEach(function(jn){jn==="placement"?hi.setAttribute("data-placement",br.placement):br.attributes.popper["data-popper-"+jn]?hi.setAttribute("data-"+jn,""):hi.removeAttribute("data-"+jn)}),br.attributes.popper={}}}},zt=[{name:"offset",options:{offset:K}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Te}},Is];M()&&Ke&&zt.push({name:"arrow",options:{element:Ke,padding:3}}),zt.push.apply(zt,T?.modifiers||[]),d.popperInstance=fs(yr,y,Object.assign({},T,{placement:S,onFirstUpdate:f,modifiers:zt}))}function Ct(){d.popperInstance&&(d.popperInstance.destroy(),d.popperInstance=null)}function He(){var h=d.props.appendTo,T,S=k();d.props.interactive&&h===Zp||h==="parent"?T=S.parentNode:T=Jp(h,[S]),T.contains(y)||T.appendChild(y),d.state.isMounted=!0,Lt()}function ht(){return ii(y.querySelectorAll("[data-tippy-root]"))}function $t(h){d.clearDelayTimeouts(),h&&$("onTrigger",[d,h]),Be();var T=B(!0),S=F(),K=S[0],G=S[1];Et.isTouch&&K==="hold"&&G&&(T=G),T?n=setTimeout(function(){d.show()},T):d.show()}function Tt(h){if(d.clearDelayTimeouts(),$("onUntrigger",[d,h]),!d.state.isVisible){Ce();return}if(!(d.props.trigger.indexOf("mouseenter")>=0&&d.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(h.type)>=0&&a)){var T=B(!1);T?o=setTimeout(function(){d.state.isVisible&&d.hide()},T):i=requestAnimationFrame(function(){d.hide()})}}function O(){d.state.isEnabled=!0}function I(){d.hide(),d.state.isEnabled=!1}function oe(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function ue(h){if(!d.state.isDestroyed){$("onBeforeUpdate",[d,h]),it();var T=d.props,S=$p(e,Object.assign({},T,qp(h),{ignoreAttributes:!0}));d.props=S,ot(),T.interactiveDebounce!==S.interactiveDebounce&&(ce(),g=Up(Wt,S.interactiveDebounce)),T.triggerTarget&&!S.triggerTarget?Vr(T.triggerTarget).forEach(function(K){K.removeAttribute("aria-expanded")}):S.triggerTarget&&e.removeAttribute("aria-expanded"),ie(),R(),P&&P(T,S),d.popperInstance&&(Lt(),ht().forEach(function(K){requestAnimationFrame(K._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[d,h])}}function be(h){d.setProps({content:h})}function Qt(){var h=d.state.isVisible,T=d.state.isDestroyed,S=!d.state.isEnabled,K=Et.isTouch&&!d.props.touch,G=ps(d.props.duration,0,pt.duration);if(!(h||T||S||K)&&!k().hasAttribute("disabled")&&($("onShow",[d],!1),d.props.onShow(d)!==!1)){if(d.state.isVisible=!0,M()&&(y.style.visibility="visible"),R(),Be(),d.state.isMounted||(y.style.transition="none"),M()){var Te=Y(),Ke=Te.box,yr=Te.content;ds([Ke,yr],0)}f=function(){var zt;if(!(!d.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=d.props.moveTransition,M()&&d.props.animation){var mi=Y(),Un=mi.box,br=mi.content;ds([Un,br],G),Gp([Un,br],"visible")}q(),ie(),jp(hs,d),(zt=d.popperInstance)==null||zt.forceUpdate(),$("onMount",[d]),d.props.animation&&M()&&Ye(G,function(){d.state.isShown=!0,$("onShown",[d])})}},He()}}function Dt(){var h=!d.state.isVisible,T=d.state.isDestroyed,S=!d.state.isEnabled,K=ps(d.props.duration,1,pt.duration);if(!(h||T||S)&&($("onHide",[d],!1),d.props.onHide(d)!==!1)){if(d.state.isVisible=!1,d.state.isShown=!1,c=!1,a=!1,M()&&(y.style.visibility="hidden"),ce(),Ce(),R(!0),M()){var G=Y(),Te=G.box,Ke=G.content;d.props.animation&&(ds([Te,Ke],K),Gp([Te,Ke],"hidden"))}q(),ie(),d.props.animation?M()&&xt(K,d.unmount):d.unmount()}}function $r(h){U().addEventListener("mousemove",g),jp(oi,g),g(h)}function Qr(){d.state.isVisible&&d.hide(),d.state.isMounted&&(Ct(),ht().forEach(function(h){h._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),hs=hs.filter(function(h){return h!==d}),d.state.isMounted=!1,$("onHidden",[d]))}function zr(){d.state.isDestroyed||(d.clearDelayTimeouts(),d.unmount(),it(),delete e._tippy,d.state.isDestroyed=!0,$("onDestroy",[d]))}}function Dn(e,t){t===void 0&&(t={});var r=pt.plugins.concat(t.plugins||[]);$y();var n=Object.assign({},t,{plugins:r}),o=jy(e);if(!1)var i,a;var s=o.reduce(function(u,c){var l=c&&r0(c,n);return l&&u.push(l),u},[]);return ai(e)?s[0]:s}Dn.defaultProps=pt;Dn.setDefaultProps=Zy;Dn.currentInput=Et;var zI=Object.assign({},wn,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});Dn.setDefaultProps({render:rd});var nd=Dn;var he=W(J()),ad=W(wo());function sd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var ud=typeof window<"u"&&typeof document<"u";function _s(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function od(){return ud&&document.createElement("div")}function n0(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function ld(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!ld(e[r],t[r]))return!1}else return!1;return!0}else return!1}function o0(e){var t=[];return e.forEach(function(r){t.find(function(n){return ld(r,n)})||t.push(r)}),t}function i0(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:o0([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var bs=ud?he.useLayoutEffect:he.useEffect;function a0(e){var t=(0,he.useRef)();return t.current||(t.current=typeof e=="function"?e():e),t.current}function id(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var s0={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function o(){t.props.className&&!n()||id(r,"add",t.props.className)}function i(){n()&&id(r,"remove",t.props.className)}return{onCreate:o,onBeforeUpdate:i,onAfterUpdate:o}}};function u0(e){function t(r){var n=r.children,o=r.content,i=r.visible,a=r.singleton,s=r.render,u=r.reference,c=r.disabled,l=c===void 0?!1:c,p=r.ignoreAttributes,f=p===void 0?!0:p,m=r.__source,g=r.__self,v=sd(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),b=i!==void 0,_=a!==void 0,x=(0,he.useState)(!1),E=x[0],d=x[1],w=(0,he.useState)({}),y=w[0],P=w[1],z=(0,he.useState)(),Z=z[0],F=z[1],L=a0(function(){return{container:od(),renders:1}}),M=Object.assign({ignoreAttributes:f},v,{content:L.container});b&&(M.trigger="manual",M.hideOnClick=!1),_&&(l=!0);var k=M,U=M.plugins||[];s&&(k=Object.assign({},M,{plugins:_&&a.data!=null?[].concat(U,[{fn:function(){return{onTrigger:function($,q){var ie=a.data.children.find(function(ce){var te=ce.instance;return te.reference===q.currentTarget});$.state.$$activeSingletonInstance=ie.instance,F(ie.content)}}}}]):U,render:function(){return{popper:L.container}}}));var Y=[u].concat(n?[n.type]:[]);return bs(function(){var B=u;u&&u.hasOwnProperty("current")&&(B=u.current);var R=e(B||L.ref||od(),Object.assign({},k,{plugins:[s0].concat(M.plugins||[])}));return L.instance=R,l&&R.disable(),i&&R.show(),_&&a.hook({instance:R,content:o,props:k,setSingletonContent:F}),d(!0),function(){R.destroy(),a?.cleanup(R)}},Y),bs(function(){var B;if(L.renders===1){L.renders++;return}var R=L.instance;R.setProps(i0(R.props,k)),(B=R.popperInstance)==null||B.forceUpdate(),l?R.disable():R.enable(),b&&(i?R.show():R.hide()),_&&a.hook({instance:R,content:o,props:k,setSingletonContent:F})}),bs(function(){var B;if(!!s){var R=L.instance;R.setProps({popperOptions:Object.assign({},R.props.popperOptions,{modifiers:[].concat((((B=R.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function($){var q=$.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var ie,ce=q.state,te=(ie=ce.modifiersData)==null?void 0:ie.hide;(y.placement!==ce.placement||y.referenceHidden!==te?.isReferenceHidden||y.escaped!==te?.hasPopperEscaped)&&P({placement:ce.placement,referenceHidden:te?.isReferenceHidden,escaped:te?.hasPopperEscaped}),ce.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(Y)),he.default.createElement(he.default.Fragment,null,n?(0,he.cloneElement)(n,{ref:function(R){L.ref=R,_s(n.ref,R)}}):null,E&&(0,ad.createPortal)(s?s(n0(y),Z,L.instance):o,L.container))}return t}var l0=function(e,t){return(0,he.forwardRef)(function(n,o){var i=n.children,a=sd(n,["children"]);return he.default.createElement(e,Object.assign({},t,a),i?(0,he.cloneElement)(i,{ref:function(u){_s(o,u),_s(i.ref,u)}}):null)})};var c0=l0(u0(nd)),cd=c0;var f0=({children:e,label:t,error:r,info:n,id:o})=>React.createElement("div",{className:"Input__Wrapper"},React.createElement("div",{className:"Input__Wrapper__Header"},t&&React.createElement("label",{htmlFor:o},t),n&&React.createElement(cd,{delay:[700,0],content:n},React.createElement("i",{className:"fa fa-info-circle"}))),e,r&&React.createElement("div",{className:"Input__Wrapper__Error"},r)),fd=f0;var pd=({icon:e,alignment:t="left"})=>React.createElement("span",{className:`Input__Icon Input__Icon${t==="left"?"--left":"--right"}`},e),p0=(0,dd.forwardRef)(({value:e,onChange:t,className:r="",emphasize:n,placeholder:o,icon:i,iconAlignment:a="left",type:s="text",isValid:u,label:c,id:l,info:p,error:f,...m},g)=>React.createElement(fd,{id:l,label:c,error:f,info:p},React.createElement("div",{className:"Input__Text__Wrapper"},React.createElement("input",{ref:g,type:s,value:e,id:l,onChange:t,className:`Input__Text ${n?"Input__Text--emphasize":""} ${a==="left"&&i?"Input__Text--withIcon":i&&u?"Input__Text--withIcons":""}`,placeholder:o,...m}),i&&React.createElement(pd,{alignment:a,icon:i}),i&&u&&a==="left"&&React.createElement(pd,{alignment:a,icon:React.createElement("i",{className:"fas fa-check"})})))),Es=p0;var md=W(J()),xs=class extends md.Component{constructor(){super(...arguments);Ps(this,"state",{hasError:!1})}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,n){}render(){return this.state.hasError?(console.log(this.state),React.createElement("span",{className:"block p-8 text-2xl text-center text-red"},"Une erreur est survenue")):this.props.children}},hd=xs;var vd=W(qn());var d0=({currentTags:e,onUpdate:t})=>{let{data:r}=Ha(),n=r?.filter(o=>!e.find(({tag:i})=>i.id===o.id))||[];return React.createElement("ul",{className:"TagList"},n?.length>0?n.map(o=>React.createElement("li",{key:o.id,onClick:()=>{t(o)},className:"TagList__Item"},React.createElement("span",null,o.title))):React.createElement("li",{className:"TagList__Item"},React.createElement("span",null,"No tags available.")))},m0=({isOpen:e,setIsOpen:t,image:r})=>{let[n,o]=(0,Qe.useState)(!1),i=ve(),a=Df(),s=Nf();return React.createElement(Os.default,{isOpen:e,onRequestClose:()=>{t(!1)},className:"Modal-Tags",overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>{t(!1)},className:"Modal__Header__Close"},React.createElement(Ua,null)),React.createElement("div",{className:"Modal__Header__Title"},i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_TAG_CONFIG"})," ",r.title)),React.createElement("div",{className:"Modal__Content",style:{overflow:"inherit"}},React.createElement("div",null,React.createElement("label",null,i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_ADD_TAG"})),React.createElement("div",{className:"BlockImage__TagSelector"},React.createElement("div",{className:"BlockImage__TagSelector__Tags",style:{paddingLeft:r.tags.length<1?"14px":"0"}},r.tags.length?r.tags.map(({tag:u,imageTag:c})=>React.createElement("div",{key:u.id,className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,u.title),React.createElement("button",{className:"BlockImage__TagSelector__Tag__Remove",onClick:()=>a.mutate(c.id||57)},React.createElement(Ff,null)))):s.isLoading?null:i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_SELECT_TAG"}),s.isLoading&&React.createElement("div",{className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,React.createElement("i",{className:"fa fa-circle-notch fa-spin"})))),React.createElement("button",{className:"BlockImage__TagSelector__Add",onClick:()=>o(!n),disabled:s.isLoading||a.isLoading},React.createElement("i",{className:"block fas fa-plus"})),n?React.createElement(Qe.Suspense,{fallback:React.createElement("div",{className:"BlockProduct__Loader"},React.createElement("i",{className:"fa fa-circle-notch fa-spin"}))},React.createElement(d0,{currentTags:r.tags,onUpdate:u=>{s.mutate({imageId:r.id,tagId:u.id}),o(!1)}})):null)))))},h0=()=>{let e=ve(),{data:t}=Ha();return React.createElement(React.Fragment,null,React.createElement("option",{value:""},e.formatMessage({id:"ALL_TAGS"})),t?.map(r=>React.createElement("option",{key:r.id,value:r.id},r.title)))},v0=({setTagId:e})=>{let t=ve();return React.createElement("div",{className:"Select__Wrapper"},React.createElement("div",{className:"Input__Select__Separator"}),React.createElement("label",{htmlFor:"tag-filter",style:{display:"flex"}},t.formatMessage({id:"BlockImage__LIBRARY_MODAL_TAG_FILTER"})),React.createElement("select",{className:"Input__Select",name:"tag-filter",id:"tag-filter",onChange:r=>e(r.target.value)},React.createElement(Qe.Suspense,{fallback:React.createElement("option",null,t.formatMessage({id:"LOADING"}))},React.createElement(h0,null))))},g0=({image:e,onSelect:t})=>{let[r,n]=(0,Qe.useState)(!1),o=ve(),i=Lf(),{getUrlWithPrefix:a}=(0,Qe.useContext)(vd.LocaleContext);return React.createElement(React.Fragment,null,React.createElement("div",{className:"Library__Image"},React.createElement("div",{className:"Library__Image__Tags"},e.tags?.map(({tag:s})=>React.createElement("span",{key:s.id,style:{border:`1px solid ${s.colorCode}`,color:s.colorCode},className:"Library__Image__Tag"},s.title))),React.createElement("img",{width:"150",height:"150",loading:"lazy",src:a(`/image-library/${e.id}/full/^!150,150/0/default.webp`)}),React.createElement("span",{className:"Library__Image__Title"},e.title),React.createElement("div",{className:"Library__Image__Actions"},React.createElement("span",{className:"Library__Image__Action__Title"},e.title),React.createElement("button",{className:"Library__Image__Select__Action",style:{marginTop:"12px",marginBottom:"6px"},onClick:()=>t(e)},o.formatMessage({id:"CHOOSE"})),React.createElement("div",{className:"Library__Image__Actions__Wrapper"},React.createElement("button",{className:"Library__Image__Tag__Action",onClick:()=>n(!0)},React.createElement("i",{className:"fas fa-tag"})),React.createElement("button",{className:"Library__Image__Delete__Action",onClick:()=>i.mutate(e.id)},React.createElement(Mf,null))))),React.createElement(m0,{image:e,isOpen:r,setIsOpen:n}))},y0=({limit:e=20,onSelect:t,setMode:r})=>{let[n,o]=(0,Qe.useState)(0),[i,a]=(0,Qe.useState)(""),[s,u]=(0,Qe.useState)(),{data:c=[],isFetching:l,isPreviousData:p}=Rf({offset:n,limit:e,title:i,tagId:s}),f=ve();return React.createElement("div",{className:"Library"},React.createElement("div",{className:"Library__Filters"},React.createElement(Es,{placeholder:f.formatMessage({id:"SEARCH_BY"}),type:"text",name:"library-search",id:"library-search",value:i,onChange:m=>a(m.target.value),label:f.formatMessage({id:"BlockImage__LIBRARY_MODAL_SEARCH"}),icon:React.createElement("i",{className:"fa fa-search emphasize"}),iconAlignment:"right"}),React.createElement(v0,{setTagId:u}),React.createElement("button",{className:"BlockImage__Button",style:{marginTop:"auto",height:"40px"},onClick:()=>r("upload")},f.formatMessage({id:"BlockImage__LIBRARY_MODAL_TITLE_UPLOAD"}))),React.createElement("div",{className:"Library__Content"},l?React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,f.formatMessage({id:"BlockImage__LIBRARY_SEARCHING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):c.length>0?c?.map(m=>React.createElement(g0,{key:m.id,image:m,onSelect:t})):React.createElement("div",{className:"Library__NoContent"},React.createElement("span",null,f.formatMessage({id:"BlockImage__LIBRARY_NO_CONTENT"})))),React.createElement("div",{className:"Pagination"},React.createElement("button",{className:"Pagination__Button Pagination__Button--previous",onClick:()=>o(m=>Math.max(m-e,0)),disabled:n===0},React.createElement("i",{className:"fa fa-chevron-left"})),React.createElement("div",{className:"Pagination__Button Pagination__Button--page"},n/e+1),React.createElement("button",{className:"Pagination__Button Pagination__Button--next",onClick:()=>{!p&&(c?.length||0)>=e&&o(m=>m+e)},disabled:p||(c?.length||0)t(!1),className:i==="upload"?"Modal-Upload":"Modal-Library",ariaHideApp:!1,overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>t(!1),className:"Modal__Header__Close"},React.createElement(Ua,null)),React.createElement("div",{className:"Modal__Header__Title"},i==="upload"?React.createElement("button",{className:"mr-2",onClick:()=>a("library")},React.createElement("i",{className:"fas fa-chevron-left"})):null,i==="library"?o.formatMessage({id:"BlockImage__LIBRARY_MODAL_TITLE"}):o.formatMessage({id:"BlockImage__LIBRARY_MODAL_TITLE_UPLOAD"}))),React.createElement("div",{className:"Modal__Content"},i==="library"?React.createElement(Qe.Suspense,{fallback:React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,o.formatMessage({id:"BlockImage__LIBRARY_LOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"}))},React.createElement(hd,null,React.createElement(y0,{onSelect:n,limit:r,setMode:a}))):React.createElement(Mn,{onSelect:n,uploadModes:["local"]}))))}function Nn(e){return React.createElement(Tr,{locale:Nt,defaultLocale:"fr",messages:Mt[Nt]||Mt.fr},React.createElement(Pr,{client:gn},React.createElement(b0,{...e})))}var pi=W(J(),1),di=W(J(),1),dt=W(J(),1);var _0={data:""},E0=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||_0;var x0=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,O0=/\/\*[^]*?\*\/| +/g,gd=/\n+/g,Gt=(e,t)=>{let r="",n="",o="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+a+";":n+=i[1]=="f"?Gt(a,i):i+"{"+Gt(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=Gt(a,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Gt.p?Gt.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Fn={},yd=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+yd(e[r]);return t}return e},C0=(e,t,r,n,o)=>{let i=yd(e),a=Fn[i]||(Fn[i]=(s=>{let u=0,c=11;for(;u>>0;return"go"+c})(i));if(!Fn[a]){let s=i!==e?e:(u=>{let c,l,p=[{}];for(;c=x0.exec(u.replace(O0,""));)c[4]?p.shift():c[3]?(l=c[3].replace(gd," ").trim(),p.unshift(p[0][l]=p[0][l]||{})):p[0][c[1]]=c[2].replace(gd," ").trim();return p[0]})(e);Fn[a]=Gt(o?{["@keyframes "+a]:s}:s,r?"":"."+a)}return((s,u,c)=>{u.data.indexOf(s)==-1&&(u.data=c?s+u.data:u.data+s)})(Fn[a],t,n),a},T0=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let s=a(r),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":Gt(s,""):s===!1?"":s}return n+o+(a??"")},"");function Bn(e){let t=this||{},r=e.call?e(t.p):e;return C0(r.unshift?r.raw?T0(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,E0(t.target),t.g,t.o,t.k)}var bd,Cs,Ts,PA=Bn.bind({g:1}),Ue=Bn.bind({k:1});function _d(e,t,r,n){Gt.p=t,bd=e,Cs=r,Ts=n}function ze(e,t){let r=this||{};return function(){let n=arguments;function o(i,a){let s=Object.assign({},i),u=s.className||o.className;r.p=Object.assign({theme:Cs&&Cs()},s),r.o=/ *go\d+/.test(u),s.className=Bn.apply(r,n)+(u?" "+u:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),Ts&&c[0]&&Ts(s),bd(c,s)}return t?t(o):o}}var vr=W(J(),1);var Hn=W(J(),1),w0=e=>typeof e=="function",fi=(e,t)=>w0(e)?e(t):e,I0=(()=>{let e=0;return()=>(++e).toString()})(),A0=e=>t=>{t&&setTimeout(()=>{let r=t.getBoundingClientRect();e(r)})},xd=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),S0=20,ui=new Map,Ed=e=>{if(ui.has(e))return;let t=setTimeout(()=>{ui.delete(e),gr({type:4,toastId:e})},1e3);ui.set(e,t)},R0=e=>{let t=ui.get(e);t&&clearTimeout(t)},ws=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,S0)};case 1:return t.toast.id&&R0(t.toast.id),{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:r}=t;return e.toasts.find(i=>i.id===r.id)?ws(e,{type:1,toast:r}):ws(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?Ed(n):e.toasts.forEach(i=>{Ed(i.id)}),{...e,toasts:e.toasts.map(i=>i.id===n||n===void 0?{...i,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+o}))}}},li=[],ci={toasts:[],pausedAt:void 0},gr=e=>{ci=ws(ci,e),li.forEach(t=>{t(ci)})},P0={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},L0=(e={})=>{let[t,r]=(0,pi.useState)(ci);(0,pi.useEffect)(()=>(li.push(r),()=>{let o=li.indexOf(r);o>-1&&li.splice(o,1)}),[t]);let n=t.toasts.map(o=>{var i,a;return{...e,...e[o.type],...o,duration:o.duration||((i=e[o.type])==null?void 0:i.duration)||e?.duration||P0[o.type],style:{...e.style,...(a=e[o.type])==null?void 0:a.style,...o.style}}});return{...t,toasts:n}},D0=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||I0()}),kn=e=>(t,r)=>{let n=D0(t,e,r);return gr({type:2,toast:n}),n.id},Fe=(e,t)=>kn("blank")(e,t);Fe.error=kn("error");Fe.success=kn("success");Fe.loading=kn("loading");Fe.custom=kn("custom");Fe.dismiss=e=>{gr({type:3,toastId:e})};Fe.remove=e=>gr({type:4,toastId:e});Fe.promise=(e,t,r)=>{let n=Fe.loading(t.loading,{...r,...r?.loading});return e.then(o=>(Fe.success(fi(t.success,o),{id:n,...r,...r?.success}),o)).catch(o=>{Fe.error(fi(t.error,o),{id:n,...r,...r?.error})}),e};var N0=e=>{let{toasts:t,pausedAt:r}=L0(e);(0,di.useEffect)(()=>{if(r)return;let o=Date.now(),i=t.map(a=>{if(a.duration===1/0)return;let s=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(s<0){a.visible&&Fe.dismiss(a.id);return}return setTimeout(()=>Fe.dismiss(a.id),s)});return()=>{i.forEach(a=>a&&clearTimeout(a))}},[t,r]);let n=(0,di.useMemo)(()=>({startPause:()=>{gr({type:5,time:Date.now()})},endPause:()=>{r&&gr({type:6,time:Date.now()})},updateHeight:(o,i)=>gr({type:1,toast:{id:o,height:i}}),calculateOffset:(o,i)=>{let{reverseOrder:a=!1,gutter:s=8,defaultPosition:u}=i||{},c=t.filter(f=>(f.position||u)===(o.position||u)&&f.height),l=c.findIndex(f=>f.id===o.id),p=c.filter((f,m)=>mf.visible).slice(...a?[p+1]:[0,p]).reduce((f,m)=>f+(m.height||0)+s,0)}}),[t,r]);return{toasts:t,handlers:n}},M0=Ue` +"use strict"; +var TheliaMediaLibraryBlock = (() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __esm = (fn3, res) => function __init() { + return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res; + }; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // external-global:@thelia/blocks-editor + var require_blocks_editor = __commonJS({ + "external-global:@thelia/blocks-editor"(exports, module) { + module.exports = TheliaBlocks; + } + }); + + // external-global:react + var require_react = __commonJS({ + "external-global:react"(exports, module) { + module.exports = React; + } + }); + + // ../../node_modules/tslib/tslib.js + var require_tslib = __commonJS({ + "../../node_modules/tslib/tslib.js"(exports, module) { + var __extends2; + var __assign2; + var __rest2; + var __decorate2; + var __param2; + var __metadata2; + var __awaiter2; + var __generator2; + var __exportStar2; + var __values2; + var __read2; + var __spread2; + var __spreadArrays2; + var __spreadArray2; + var __await2; + var __asyncGenerator2; + var __asyncDelegator2; + var __asyncValues2; + var __makeTemplateObject2; + var __importStar2; + var __importDefault2; + var __classPrivateFieldGet2; + var __classPrivateFieldSet2; + var __classPrivateFieldIn2; + var __createBinding2; + (function(factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function(exports2) { + factory(createExporter(root, createExporter(exports2))); + }); + } else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } else { + factory(createExporter(root)); + } + function createExporter(exports2, previous) { + if (exports2 !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports2, "__esModule", { value: true }); + } else { + exports2.__esModule = true; + } + } + return function(id, v2) { + return exports2[id] = previous ? previous(id, v2) : v2; + }; + } + })(function(exporter) { + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) { + d3.__proto__ = b2; + } || function(d3, b2) { + for (var p2 in b2) + if (Object.prototype.hasOwnProperty.call(b2, p2)) + d3[p2] = b2[p2]; + }; + __extends2 = function(d3, b2) { + if (typeof b2 !== "function" && b2 !== null) + throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); + extendStatics(d3, b2); + function __() { + this.constructor = d3; + } + d3.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __()); + }; + __assign2 = Object.assign || function(t2) { + for (var s2, i2 = 1, n4 = arguments.length; i2 < n4; i2++) { + s2 = arguments[i2]; + for (var p2 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p2)) + t2[p2] = s2[p2]; + } + return t2; + }; + __rest2 = function(s2, e2) { + var t2 = {}; + for (var p2 in s2) + if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) + t2[p2] = s2[p2]; + if (s2 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { + if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) + t2[p2[i2]] = s2[p2[i2]]; + } + return t2; + }; + __decorate2 = function(decorators, target, key, desc) { + var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r = Reflect.decorate(decorators, target, key, desc); + else + for (var i2 = decorators.length - 1; i2 >= 0; i2--) + if (d3 = decorators[i2]) + r = (c2 < 3 ? d3(r) : c2 > 3 ? d3(target, key, r) : d3(target, key)) || r; + return c2 > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param2 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + __metadata2 = function(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); + }; + __awaiter2 = function(thisArg, _arguments, P2, generator) { + function adopt(value) { + return value instanceof P2 ? value : new P2(function(resolve) { + resolve(value); + }); + } + return new (P2 || (P2 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + __generator2 = function(thisArg, body) { + var _2 = { label: 0, sent: function() { + if (t2[0] & 1) + throw t2[1]; + return t2[1]; + }, trys: [], ops: [] }, f4, y, t2, g3; + return g3 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() { + return this; + }), g3; + function verb(n4) { + return function(v2) { + return step([n4, v2]); + }; + } + function step(op) { + if (f4) + throw new TypeError("Generator is already executing."); + while (_2) + try { + if (f4 = 1, y && (t2 = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t2 = y["return"]) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done) + return t2; + if (y = 0, t2) + op = [op[0] & 2, t2.value]; + switch (op[0]) { + case 0: + case 1: + t2 = op; + break; + case 4: + _2.label++; + return { value: op[1], done: false }; + case 5: + _2.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _2.ops.pop(); + _2.trys.pop(); + continue; + default: + if (!(t2 = _2.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _2 = 0; + continue; + } + if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { + _2.label = op[1]; + break; + } + if (op[0] === 6 && _2.label < t2[1]) { + _2.label = t2[1]; + t2 = op; + break; + } + if (t2 && _2.label < t2[2]) { + _2.label = t2[2]; + _2.ops.push(op); + break; + } + if (t2[2]) + _2.ops.pop(); + _2.trys.pop(); + continue; + } + op = body.call(thisArg, _2); + } catch (e2) { + op = [6, e2]; + y = 0; + } finally { + f4 = t2 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + __exportStar2 = function(m3, o3) { + for (var p2 in m3) + if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(o3, p2)) + __createBinding2(o3, m3, p2); + }; + __createBinding2 = Object.create ? function(o3, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + var desc = Object.getOwnPropertyDescriptor(m3, k2); + if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m3[k2]; + } }; + } + Object.defineProperty(o3, k22, desc); + } : function(o3, m3, k2, k22) { + if (k22 === void 0) + k22 = k2; + o3[k22] = m3[k2]; + }; + __values2 = function(o3) { + var s2 = typeof Symbol === "function" && Symbol.iterator, m3 = s2 && o3[s2], i2 = 0; + if (m3) + return m3.call(o3); + if (o3 && typeof o3.length === "number") + return { + next: function() { + if (o3 && i2 >= o3.length) + o3 = void 0; + return { value: o3 && o3[i2++], done: !o3 }; + } + }; + throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + __read2 = function(o3, n4) { + var m3 = typeof Symbol === "function" && o3[Symbol.iterator]; + if (!m3) + return o3; + var i2 = m3.call(o3), r, ar = [], e2; + try { + while ((n4 === void 0 || n4-- > 0) && !(r = i2.next()).done) + ar.push(r.value); + } catch (error) { + e2 = { error }; + } finally { + try { + if (r && !r.done && (m3 = i2["return"])) + m3.call(i2); + } finally { + if (e2) + throw e2.error; + } + } + return ar; + }; + __spread2 = function() { + for (var ar = [], i2 = 0; i2 < arguments.length; i2++) + ar = ar.concat(__read2(arguments[i2])); + return ar; + }; + __spreadArrays2 = function() { + for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++) + s2 += arguments[i2].length; + for (var r = Array(s2), k2 = 0, i2 = 0; i2 < il; i2++) + for (var a2 = arguments[i2], j3 = 0, jl = a2.length; j3 < jl; j3++, k2++) + r[k2] = a2[j3]; + return r; + }; + __spreadArray2 = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) { + if (ar || !(i2 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i2); + ar[i2] = from[i2]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + __await2 = function(v2) { + return this instanceof __await2 ? (this.v = v2, this) : new __await2(v2); + }; + __asyncGenerator2 = function(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g3 = generator.apply(thisArg, _arguments || []), i2, q2 = []; + return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2; + function verb(n4) { + if (g3[n4]) + i2[n4] = function(v2) { + return new Promise(function(a2, b2) { + q2.push([n4, v2, a2, b2]) > 1 || resume(n4, v2); + }); + }; + } + function resume(n4, v2) { + try { + step(g3[n4](v2)); + } catch (e2) { + settle(q2[0][3], e2); + } + } + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q2[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f4, v2) { + if (f4(v2), q2.shift(), q2.length) + resume(q2[0][0], q2[0][1]); + } + }; + __asyncDelegator2 = function(o3) { + var i2, p2; + return i2 = {}, verb("next"), verb("throw", function(e2) { + throw e2; + }), verb("return"), i2[Symbol.iterator] = function() { + return this; + }, i2; + function verb(n4, f4) { + i2[n4] = o3[n4] ? function(v2) { + return (p2 = !p2) ? { value: __await2(o3[n4](v2)), done: n4 === "return" } : f4 ? f4(v2) : v2; + } : f4; + } + }; + __asyncValues2 = function(o3) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m3 = o3[Symbol.asyncIterator], i2; + return m3 ? m3.call(o3) : (o3 = typeof __values2 === "function" ? __values2(o3) : o3[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() { + return this; + }, i2); + function verb(n4) { + i2[n4] = o3[n4] && function(v2) { + return new Promise(function(resolve, reject) { + v2 = o3[n4](v2), settle(resolve, reject, v2.done, v2.value); + }); + }; + } + function settle(resolve, reject, d3, v2) { + Promise.resolve(v2).then(function(v3) { + resolve({ value: v3, done: d3 }); + }, reject); + } + }; + __makeTemplateObject2 = function(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; + }; + var __setModuleDefault = Object.create ? function(o3, v2) { + Object.defineProperty(o3, "default", { enumerable: true, value: v2 }); + } : function(o3, v2) { + o3["default"] = v2; + }; + __importStar2 = function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k2 in mod) + if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) + __createBinding2(result, mod, k2); + } + __setModuleDefault(result, mod); + return result; + }; + __importDefault2 = function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + __classPrivateFieldGet2 = function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); + }; + __classPrivateFieldSet2 = function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; + }; + __classPrivateFieldIn2 = function(state, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") + throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + exporter("__extends", __extends2); + exporter("__assign", __assign2); + exporter("__rest", __rest2); + exporter("__decorate", __decorate2); + exporter("__param", __param2); + exporter("__metadata", __metadata2); + exporter("__awaiter", __awaiter2); + exporter("__generator", __generator2); + exporter("__exportStar", __exportStar2); + exporter("__createBinding", __createBinding2); + exporter("__values", __values2); + exporter("__read", __read2); + exporter("__spread", __spread2); + exporter("__spreadArrays", __spreadArrays2); + exporter("__spreadArray", __spreadArray2); + exporter("__await", __await2); + exporter("__asyncGenerator", __asyncGenerator2); + exporter("__asyncDelegator", __asyncDelegator2); + exporter("__asyncValues", __asyncValues2); + exporter("__makeTemplateObject", __makeTemplateObject2); + exporter("__importStar", __importStar2); + exporter("__importDefault", __importDefault2); + exporter("__classPrivateFieldGet", __classPrivateFieldGet2); + exporter("__classPrivateFieldSet", __classPrivateFieldSet2); + exporter("__classPrivateFieldIn", __classPrivateFieldIn2); + }); + } + }); + + // ../../node_modules/react-is/cjs/react-is.development.js + var require_react_is_development = __commonJS({ + "../../node_modules/react-is/cjs/react-is.development.js"(exports) { + "use strict"; + if (true) { + (function() { + "use strict"; + var hasSymbol = typeof Symbol === "function" && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; + function isValidElementType(type) { + return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); + } + function typeOf(object) { + if (typeof object === "object" && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + return void 0; + } + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element2 = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment5 = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense2 = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement3(object) { + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element2; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment5; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense2; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement3; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } + } + }); + + // ../../node_modules/react-is/index.js + var require_react_is = __commonJS({ + "../../node_modules/react-is/index.js"(exports, module) { + "use strict"; + if (false) { + module.exports = null; + } else { + module.exports = require_react_is_development(); + } + } + }); + + // ../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js + var require_hoist_non_react_statics_cjs = __commonJS({ + "../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) { + "use strict"; + var reactIs = require_react_is(); + var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true + }; + var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true + }; + var FORWARD_REF_STATICS = { + "$$typeof": true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true + }; + var MEMO_STATICS = { + "$$typeof": true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true + }; + var TYPE_STATICS = {}; + TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; + TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; + function getStatics(component) { + if (reactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; + } + var defineProperty = Object.defineProperty; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var getPrototypeOf = Object.getPrototypeOf; + var objectPrototype = Object.prototype; + function hoistNonReactStatics2(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== "string") { + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics2(targetComponent, inheritedComponent, blacklist); + } + } + var keys = getOwnPropertyNames(sourceComponent); + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + for (var i2 = 0; i2 < keys.length; ++i2) { + var key = keys[i2]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + defineProperty(targetComponent, key, descriptor); + } catch (e2) { + } + } + } + } + return targetComponent; + } + module.exports = hoistNonReactStatics2; + } + }); + + // ../../node_modules/object-assign/index.js + var require_object_assign = __commonJS({ + "../../node_modules/object-assign/index.js"(exports, module) { + "use strict"; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty2 = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === void 0) { + throw new TypeError("Object.assign cannot be called with null or undefined"); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String("abc"); + test1[5] = "de"; + if (Object.getOwnPropertyNames(test1)[0] === "5") { + return false; + } + var test2 = {}; + for (var i2 = 0; i2 < 10; i2++) { + test2["_" + String.fromCharCode(i2)] = i2; + } + var order2 = Object.getOwnPropertyNames(test2).map(function(n4) { + return test2[n4]; + }); + if (order2.join("") !== "0123456789") { + return false; + } + var test3 = {}; + "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { + return false; + } + return true; + } catch (err) { + return false; + } + } + module.exports = shouldUseNative() ? Object.assign : function(target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s2 = 1; s2 < arguments.length; s2++) { + from = Object(arguments[s2]); + for (var key in from) { + if (hasOwnProperty2.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i2 = 0; i2 < symbols.length; i2++) { + if (propIsEnumerable.call(from, symbols[i2])) { + to[symbols[i2]] = from[symbols[i2]]; + } + } + } + } + return to; + }; + } + }); + + // ../../node_modules/prop-types/lib/ReactPropTypesSecret.js + var require_ReactPropTypesSecret = __commonJS({ + "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { + "use strict"; + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + module.exports = ReactPropTypesSecret; + } + }); + + // ../../node_modules/prop-types/lib/has.js + var require_has = __commonJS({ + "../../node_modules/prop-types/lib/has.js"(exports, module) { + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); + } + }); + + // ../../node_modules/prop-types/checkPropTypes.js + var require_checkPropTypes = __commonJS({ + "../../node_modules/prop-types/checkPropTypes.js"(exports, module) { + "use strict"; + var printWarning = function() { + }; + if (true) { + ReactPropTypesSecret = require_ReactPropTypesSecret(); + loggedTypeFailures = {}; + has = require_has(); + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x2) { + } + }; + } + var ReactPropTypesSecret; + var loggedTypeFailures; + var has; + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error( + (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." + ); + err.name = "Invariant Violation"; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + var stack = getStack ? getStack() : ""; + printWarning( + "Failed " + location + " type: " + error.message + (stack != null ? stack : "") + ); + } + } + } + } + } + checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } + }; + module.exports = checkPropTypes; + } + }); + + // ../../node_modules/prop-types/factoryWithTypeCheckers.js + var require_factoryWithTypeCheckers = __commonJS({ + "../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { + "use strict"; + var ReactIs = require_react_is(); + var assign = require_object_assign(); + var ReactPropTypesSecret = require_ReactPropTypesSecret(); + var has = require_has(); + var checkPropTypes = require_checkPropTypes(); + var printWarning = function() { + }; + if (true) { + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x2) { + } + }; + } + function emptyFunctionThatReturnsNull() { + return null; + } + module.exports = function(isValidElement, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === "function") { + return iteratorFn; + } + } + var ANONYMOUS = "<>"; + var ReactPropTypes = { + array: createPrimitiveTypeChecker("array"), + bigint: createPrimitiveTypeChecker("bigint"), + bool: createPrimitiveTypeChecker("boolean"), + func: createPrimitiveTypeChecker("function"), + number: createPrimitiveTypeChecker("number"), + object: createPrimitiveTypeChecker("object"), + string: createPrimitiveTypeChecker("string"), + symbol: createPrimitiveTypeChecker("symbol"), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + function is(x2, y) { + if (x2 === y) { + return x2 !== 0 || 1 / x2 === 1 / y; + } else { + return x2 !== x2 && y !== y; + } + } + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === "object" ? data : {}; + this.stack = ""; + } + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + var err = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" + ); + err.name = "Invariant Violation"; + throw err; + } else if (typeof console !== "undefined") { + var cacheKey = componentName + ":" + propName; + if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { + printWarning( + "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); + } + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), + { expectedType } + ); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); + } + for (var i2 = 0; i2 < propValue.length; i2++) { + var error = typeChecker(propValue, i2, componentName, location, propFullName + "[" + i2 + "]", ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." + ); + } else { + printWarning("Invalid argument supplied to oneOf, expected an array."); + } + } + return emptyFunctionThatReturnsNull; + } + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i2 = 0; i2 < expectedValues.length; i2++) { + if (is(propValue, expectedValues[i2])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === "symbol") { + return String(value); + } + return value; + }); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); + } + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; + return emptyFunctionThatReturnsNull; + } + for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { + var checker = arrayOfTypeCheckers[i2]; + if (typeof checker !== "function") { + printWarning( + "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "." + ); + return emptyFunctionThatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { + var expectedTypes = []; + for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) { + var checker2 = arrayOfTypeCheckers[i3]; + var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, "expectedType")) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError( + (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." + ); + } + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== "function") { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + } + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== "function") { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") + ); + } + var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function isNode(propValue) { + switch (typeof propValue) { + case "number": + case "string": + case "undefined": + return true; + case "boolean": + return !propValue; + case "object": + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + return true; + default: + return false; + } + } + function isSymbol(propType, propValue) { + if (propType === "symbol") { + return true; + } + if (!propValue) { + return false; + } + if (propValue["@@toStringTag"] === "Symbol") { + return true; + } + if (typeof Symbol === "function" && propValue instanceof Symbol) { + return true; + } + return false; + } + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return "array"; + } + if (propValue instanceof RegExp) { + return "object"; + } + if (isSymbol(propType, propValue)) { + return "symbol"; + } + return propType; + } + function getPreciseType(propValue) { + if (typeof propValue === "undefined" || propValue === null) { + return "" + propValue; + } + var propType = getPropType(propValue); + if (propType === "object") { + if (propValue instanceof Date) { + return "date"; + } else if (propValue instanceof RegExp) { + return "regexp"; + } + } + return propType; + } + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case "array": + case "object": + return "an " + type; + case "boolean": + case "date": + case "regexp": + return "a " + type; + default: + return type; + } + } + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; + } + }); + + // ../../node_modules/prop-types/index.js + var require_prop_types = __commonJS({ + "../../node_modules/prop-types/index.js"(exports, module) { + if (true) { + ReactIs = require_react_is(); + throwOnDirectAccess = true; + module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); + } else { + module.exports = null(); + } + var ReactIs; + var throwOnDirectAccess; + } + }); + + // ../../node_modules/attr-accept/dist/es/index.js + var require_es = __commonJS({ + "../../node_modules/attr-accept/dist/es/index.js"(exports) { + "use strict"; + exports.__esModule = true; + exports.default = function(file, acceptedFiles) { + if (file && acceptedFiles) { + var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(","); + var fileName = file.name || ""; + var mimeType = (file.type || "").toLowerCase(); + var baseMimeType = mimeType.replace(/\/.*$/, ""); + return acceptedFilesArray.some(function(type) { + var validType = type.trim().toLowerCase(); + if (validType.charAt(0) === ".") { + return fileName.toLowerCase().endsWith(validType); + } else if (validType.endsWith("/*")) { + return baseMimeType === validType.replace(/\/.*$/, ""); + } + return mimeType === validType; + }); + } + return true; + }; + } + }); + + // external-global:react-dom + var require_react_dom = __commonJS({ + "external-global:react-dom"(exports, module) { + module.exports = ReactDOM; + } + }); + + // ../../node_modules/axios/lib/helpers/bind.js + var require_bind = __commonJS({ + "../../node_modules/axios/lib/helpers/bind.js"(exports, module) { + "use strict"; + module.exports = function bind(fn3, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i2 = 0; i2 < args.length; i2++) { + args[i2] = arguments[i2]; + } + return fn3.apply(thisArg, args); + }; + }; + } + }); + + // ../../node_modules/axios/lib/utils.js + var require_utils = __commonJS({ + "../../node_modules/axios/lib/utils.js"(exports, module) { + "use strict"; + var bind = require_bind(); + var toString = Object.prototype.toString; + function isArray(val) { + return Array.isArray(val); + } + function isUndefined(val) { + return typeof val === "undefined"; + } + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val); + } + function isArrayBuffer(val) { + return toString.call(val) === "[object ArrayBuffer]"; + } + function isFormData(val) { + return toString.call(val) === "[object FormData]"; + } + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; + } + function isString(val) { + return typeof val === "string"; + } + function isNumber(val) { + return typeof val === "number"; + } + function isObject2(val) { + return val !== null && typeof val === "object"; + } + function isPlainObject2(val) { + if (toString.call(val) !== "[object Object]") { + return false; + } + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; + } + function isDate(val) { + return toString.call(val) === "[object Date]"; + } + function isFile(val) { + return toString.call(val) === "[object File]"; + } + function isBlob(val) { + return toString.call(val) === "[object Blob]"; + } + function isFunction(val) { + return toString.call(val) === "[object Function]"; + } + function isStream(val) { + return isObject2(val) && isFunction(val.pipe); + } + function isURLSearchParams(val) { + return toString.call(val) === "[object URLSearchParams]"; + } + function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ""); + } + function isStandardBrowserEnv() { + if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) { + return false; + } + return typeof window !== "undefined" && typeof document !== "undefined"; + } + function forEach(obj, fn3) { + if (obj === null || typeof obj === "undefined") { + return; + } + if (typeof obj !== "object") { + obj = [obj]; + } + if (isArray(obj)) { + for (var i2 = 0, l2 = obj.length; i2 < l2; i2++) { + fn3.call(null, obj[i2], i2, obj); + } + } else { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn3.call(null, obj[key], key, obj); + } + } + } + } + function merge() { + var result = {}; + function assignValue(val, key) { + if (isPlainObject2(result[key]) && isPlainObject2(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject2(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + for (var i2 = 0, l2 = arguments.length; i2 < l2; i2++) { + forEach(arguments[i2], assignValue); + } + return result; + } + function extend(a2, b2, thisArg) { + forEach(b2, function assignValue(val, key) { + if (thisArg && typeof val === "function") { + a2[key] = bind(val, thisArg); + } else { + a2[key] = val; + } + }); + return a2; + } + function stripBOM(content) { + if (content.charCodeAt(0) === 65279) { + content = content.slice(1); + } + return content; + } + module.exports = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isObject: isObject2, + isPlainObject: isPlainObject2, + isUndefined, + isDate, + isFile, + isBlob, + isFunction, + isStream, + isURLSearchParams, + isStandardBrowserEnv, + forEach, + merge, + extend, + trim, + stripBOM + }; + } + }); + + // ../../node_modules/axios/lib/helpers/buildURL.js + var require_buildURL = __commonJS({ + "../../node_modules/axios/lib/helpers/buildURL.js"(exports, module) { + "use strict"; + var utils = require_utils(); + function encode(val) { + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); + } + module.exports = function buildURL(url, params, paramsSerializer) { + if (!params) { + return url; + } + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === "undefined") { + return; + } + if (utils.isArray(val)) { + key = key + "[]"; + } else { + val = [val]; + } + utils.forEach(val, function parseValue(v2) { + if (utils.isDate(v2)) { + v2 = v2.toISOString(); + } else if (utils.isObject(v2)) { + v2 = JSON.stringify(v2); + } + parts.push(encode(key) + "=" + encode(v2)); + }); + }); + serializedParams = parts.join("&"); + } + if (serializedParams) { + var hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; + } + return url; + }; + } + }); + + // ../../node_modules/axios/lib/core/InterceptorManager.js + var require_InterceptorManager = __commonJS({ + "../../node_modules/axios/lib/core/InterceptorManager.js"(exports, module) { + "use strict"; + var utils = require_utils(); + function InterceptorManager() { + this.handlers = []; + } + InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + }; + InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + }; + InterceptorManager.prototype.forEach = function forEach(fn3) { + utils.forEach(this.handlers, function forEachHandler(h2) { + if (h2 !== null) { + fn3(h2); + } + }); + }; + module.exports = InterceptorManager; + } + }); + + // ../../node_modules/axios/lib/helpers/normalizeHeaderName.js + var require_normalizeHeaderName = __commonJS({ + "../../node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; + } + }); + + // ../../node_modules/axios/lib/core/enhanceError.js + var require_enhanceError = __commonJS({ + "../../node_modules/axios/lib/core/enhanceError.js"(exports, module) { + "use strict"; + module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + error.isAxiosError = true; + error.toJSON = function toJSON() { + return { + message: this.message, + name: this.name, + description: this.description, + number: this.number, + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + config: this.config, + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + }; + return error; + }; + } + }); + + // ../../node_modules/axios/lib/core/createError.js + var require_createError = __commonJS({ + "../../node_modules/axios/lib/core/createError.js"(exports, module) { + "use strict"; + var enhanceError = require_enhanceError(); + module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); + }; + } + }); + + // ../../node_modules/axios/lib/core/settle.js + var require_settle = __commonJS({ + "../../node_modules/axios/lib/core/settle.js"(exports, module) { + "use strict"; + var createError = require_createError(); + module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + "Request failed with status code " + response.status, + response.config, + null, + response.request, + response + )); + } + }; + } + }); + + // ../../node_modules/axios/lib/helpers/cookies.js + var require_cookies = __commonJS({ + "../../node_modules/axios/lib/helpers/cookies.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() { + return { + write: function write2(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + "=" + encodeURIComponent(value)); + if (utils.isNumber(expires)) { + cookie.push("expires=" + new Date(expires).toGMTString()); + } + if (utils.isString(path)) { + cookie.push("path=" + path); + } + if (utils.isString(domain)) { + cookie.push("domain=" + domain); + } + if (secure === true) { + cookie.push("secure"); + } + document.cookie = cookie.join("; "); + }, + read: function read2(name) { + var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); + return match ? decodeURIComponent(match[3]) : null; + }, + remove: function remove(name) { + this.write(name, "", Date.now() - 864e5); + } + }; + }() : function nonStandardBrowserEnv() { + return { + write: function write2() { + }, + read: function read2() { + return null; + }, + remove: function remove() { + } + }; + }(); + } + }); + + // ../../node_modules/axios/lib/helpers/isAbsoluteURL.js + var require_isAbsoluteURL = __commonJS({ + "../../node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module) { + "use strict"; + module.exports = function isAbsoluteURL(url) { + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); + }; + } + }); + + // ../../node_modules/axios/lib/helpers/combineURLs.js + var require_combineURLs = __commonJS({ + "../../node_modules/axios/lib/helpers/combineURLs.js"(exports, module) { + "use strict"; + module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; + }; + } + }); + + // ../../node_modules/axios/lib/core/buildFullPath.js + var require_buildFullPath = __commonJS({ + "../../node_modules/axios/lib/core/buildFullPath.js"(exports, module) { + "use strict"; + var isAbsoluteURL = require_isAbsoluteURL(); + var combineURLs = require_combineURLs(); + module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; + }; + } + }); + + // ../../node_modules/axios/lib/helpers/parseHeaders.js + var require_parseHeaders = __commonJS({ + "../../node_modules/axios/lib/helpers/parseHeaders.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var ignoreDuplicateOf = [ + "age", + "authorization", + "content-length", + "content-type", + "etag", + "expires", + "from", + "host", + "if-modified-since", + "if-unmodified-since", + "last-modified", + "location", + "max-forwards", + "proxy-authorization", + "referer", + "retry-after", + "user-agent" + ]; + module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i2; + if (!headers) { + return parsed; + } + utils.forEach(headers.split("\n"), function parser(line) { + i2 = line.indexOf(":"); + key = utils.trim(line.substr(0, i2)).toLowerCase(); + val = utils.trim(line.substr(i2 + 1)); + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === "set-cookie") { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + } + } + }); + return parsed; + }; + } + }); + + // ../../node_modules/axios/lib/helpers/isURLSameOrigin.js + var require_isURLSameOrigin = __commonJS({ + "../../node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = utils.isStandardBrowserEnv() ? function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement("a"); + var originURL; + function resolveURL(url) { + var href = url; + if (msie) { + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute("href", href); + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "", + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "", + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "", + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname + }; + } + originURL = resolveURL(window.location.href); + return function isURLSameOrigin(requestURL) { + var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); + } + }); + + // ../../node_modules/axios/lib/cancel/Cancel.js + var require_Cancel = __commonJS({ + "../../node_modules/axios/lib/cancel/Cancel.js"(exports, module) { + "use strict"; + function Cancel(message) { + this.message = message; + } + Cancel.prototype.toString = function toString() { + return "Cancel" + (this.message ? ": " + this.message : ""); + }; + Cancel.prototype.__CANCEL__ = true; + module.exports = Cancel; + } + }); + + // ../../node_modules/axios/lib/adapters/xhr.js + var require_xhr = __commonJS({ + "../../node_modules/axios/lib/adapters/xhr.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var settle = require_settle(); + var cookies = require_cookies(); + var buildURL = require_buildURL(); + var buildFullPath = require_buildFullPath(); + var parseHeaders = require_parseHeaders(); + var isURLSameOrigin = require_isURLSameOrigin(); + var createError = require_createError(); + var defaults = require_defaults(); + var Cancel = require_Cancel(); + module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + if (config.signal) { + config.signal.removeEventListener("abort", onCanceled); + } + } + if (utils.isFormData(requestData)) { + delete requestHeaders["Content-Type"]; + } + var request = new XMLHttpRequest(); + if (config.auth) { + var username = config.auth.username || ""; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ""; + requestHeaders.Authorization = "Basic " + btoa(username + ":" + password); + } + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + request.timeout = config.timeout; + function onloadend() { + if (!request) { + return; + } + var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + request = null; + } + if ("onloadend" in request) { + request.onloadend = onloadend; + } else { + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { + return; + } + setTimeout(onloadend); + }; + } + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(createError("Request aborted", config, "ECONNABORTED", request)); + request = null; + }; + request.onerror = function handleError() { + reject(createError("Network Error", config, null, request)); + request = null; + }; + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; + var transitional = config.transitional || defaults.transitional; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", + request + )); + request = null; + }; + if (utils.isStandardBrowserEnv()) { + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0; + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + if ("setRequestHeader" in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") { + delete requestHeaders[key]; + } else { + request.setRequestHeader(key, val); + } + }); + } + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + if (responseType && responseType !== "json") { + request.responseType = config.responseType; + } + if (typeof config.onDownloadProgress === "function") { + request.addEventListener("progress", config.onDownloadProgress); + } + if (typeof config.onUploadProgress === "function" && request.upload) { + request.upload.addEventListener("progress", config.onUploadProgress); + } + if (config.cancelToken || config.signal) { + onCanceled = function(cancel) { + if (!request) { + return; + } + reject(!cancel || cancel && cancel.type ? new Cancel("canceled") : cancel); + request.abort(); + request = null; + }; + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled); + } + } + if (!requestData) { + requestData = null; + } + request.send(requestData); + }); + }; + } + }); + + // ../../node_modules/axios/lib/defaults.js + var require_defaults = __commonJS({ + "../../node_modules/axios/lib/defaults.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var normalizeHeaderName = require_normalizeHeaderName(); + var enhanceError = require_enhanceError(); + var DEFAULT_CONTENT_TYPE = { + "Content-Type": "application/x-www-form-urlencoded" + }; + function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) { + headers["Content-Type"] = value; + } + } + function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== "undefined") { + adapter = require_xhr(); + } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") { + adapter = require_xhr(); + } + return adapter; + } + function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e2) { + if (e2.name !== "SyntaxError") { + throw e2; + } + } + } + return (encoder || JSON.stringify)(rawValue); + } + var defaults = { + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + adapter: getDefaultAdapter(), + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, "Accept"); + normalizeHeaderName(headers, "Content-Type"); + if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8"); + return data.toString(); + } + if (utils.isObject(data) || headers && headers["Content-Type"] === "application/json") { + setContentTypeIfUnset(headers, "application/json"); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === "json"; + if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) { + try { + return JSON.parse(data); + } catch (e2) { + if (strictJSONParsing) { + if (e2.name === "SyntaxError") { + throw enhanceError(e2, this, "E_JSON_PARSE"); + } + throw e2; + } + } + } + return data; + }], + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + "Accept": "application/json, text/plain, */*" + } + } + }; + utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); + }); + module.exports = defaults; + } + }); + + // ../../node_modules/axios/lib/core/transformData.js + var require_transformData = __commonJS({ + "../../node_modules/axios/lib/core/transformData.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var defaults = require_defaults(); + module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + utils.forEach(fns, function transform(fn3) { + data = fn3.call(context, data, headers); + }); + return data; + }; + } + }); + + // ../../node_modules/axios/lib/cancel/isCancel.js + var require_isCancel = __commonJS({ + "../../node_modules/axios/lib/cancel/isCancel.js"(exports, module) { + "use strict"; + module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; + } + }); + + // ../../node_modules/axios/lib/core/dispatchRequest.js + var require_dispatchRequest = __commonJS({ + "../../node_modules/axios/lib/core/dispatchRequest.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var transformData = require_transformData(); + var isCancel = require_isCancel(); + var defaults = require_defaults(); + var Cancel = require_Cancel(); + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + if (config.signal && config.signal.aborted) { + throw new Cancel("canceled"); + } + } + module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = config.headers || {}; + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + utils.forEach( + ["delete", "get", "head", "post", "put", "patch", "common"], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + var adapter = config.adapter || defaults.adapter; + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + return Promise.reject(reason); + }); + }; + } + }); + + // ../../node_modules/axios/lib/core/mergeConfig.js + var require_mergeConfig = __commonJS({ + "../../node_modules/axios/lib/core/mergeConfig.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = function mergeConfig2(config1, config2) { + config2 = config2 || {}; + var config = {}; + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(void 0, config1[prop]); + } + } + function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(void 0, config2[prop]); + } + } + function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(void 0, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(void 0, config1[prop]); + } + } + function mergeDirectKeys(prop) { + if (prop in config2) { + return getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + return getMergedValue(void 0, config1[prop]); + } + } + var mergeMap = { + "url": valueFromConfig2, + "method": valueFromConfig2, + "data": valueFromConfig2, + "baseURL": defaultToConfig2, + "transformRequest": defaultToConfig2, + "transformResponse": defaultToConfig2, + "paramsSerializer": defaultToConfig2, + "timeout": defaultToConfig2, + "timeoutMessage": defaultToConfig2, + "withCredentials": defaultToConfig2, + "adapter": defaultToConfig2, + "responseType": defaultToConfig2, + "xsrfCookieName": defaultToConfig2, + "xsrfHeaderName": defaultToConfig2, + "onUploadProgress": defaultToConfig2, + "onDownloadProgress": defaultToConfig2, + "decompress": defaultToConfig2, + "maxContentLength": defaultToConfig2, + "maxBodyLength": defaultToConfig2, + "transport": defaultToConfig2, + "httpAgent": defaultToConfig2, + "httpsAgent": defaultToConfig2, + "cancelToken": defaultToConfig2, + "socketPath": defaultToConfig2, + "responseEncoding": defaultToConfig2, + "validateStatus": mergeDirectKeys + }; + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(prop); + utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; + }; + } + }); + + // ../../node_modules/axios/lib/env/data.js + var require_data = __commonJS({ + "../../node_modules/axios/lib/env/data.js"(exports, module) { + module.exports = { + "version": "0.25.0" + }; + } + }); + + // ../../node_modules/axios/lib/helpers/validator.js + var require_validator = __commonJS({ + "../../node_modules/axios/lib/helpers/validator.js"(exports, module) { + "use strict"; + var VERSION = require_data().version; + var validators = {}; + ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i2) { + validators[type] = function validator(thing) { + return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type; + }; + }); + var deprecatedWarnings = {}; + validators.transitional = function transitional(validator, version, message) { + function formatMessage3(opt, desc) { + return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); + } + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage3(opt, " has been removed" + (version ? " in " + version : ""))); + } + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + console.warn( + formatMessage3( + opt, + " has been deprecated since v" + version + " and will be removed in the near future" + ) + ); + } + return validator ? validator(value, opt, opts) : true; + }; + }; + function assertOptions(options, schema, allowUnknown) { + if (typeof options !== "object") { + throw new TypeError("options must be an object"); + } + var keys = Object.keys(options); + var i2 = keys.length; + while (i2-- > 0) { + var opt = keys[i2]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === void 0 || validator(value, opt, options); + if (result !== true) { + throw new TypeError("option " + opt + " must be " + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error("Unknown option " + opt); + } + } + } + module.exports = { + assertOptions, + validators + }; + } + }); + + // ../../node_modules/axios/lib/core/Axios.js + var require_Axios = __commonJS({ + "../../node_modules/axios/lib/core/Axios.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var buildURL = require_buildURL(); + var InterceptorManager = require_InterceptorManager(); + var dispatchRequest = require_dispatchRequest(); + var mergeConfig2 = require_mergeConfig(); + var validator = require_validator(); + var validators = validator.validators; + function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + Axios.prototype.request = function request(configOrUrl, config) { + if (typeof configOrUrl === "string") { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + if (!config.url) { + throw new Error("Provided config url is not valid"); + } + config = mergeConfig2(this.defaults, config); + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = "get"; + } + var transitional = config.transitional; + if (transitional !== void 0) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + var promise; + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, void 0]; + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + return promise; + } + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + return promise; + }; + Axios.prototype.getUri = function getUri(config) { + if (!config.url) { + throw new Error("Provided config url is not valid"); + } + config = mergeConfig2(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ""); + }; + utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig2(config || {}, { + method, + url, + data: (config || {}).data + })); + }; + }); + utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig2(config || {}, { + method, + url, + data + })); + }; + }); + module.exports = Axios; + } + }); + + // ../../node_modules/axios/lib/cancel/CancelToken.js + var require_CancelToken = __commonJS({ + "../../node_modules/axios/lib/cancel/CancelToken.js"(exports, module) { + "use strict"; + var Cancel = require_Cancel(); + function CancelToken(executor) { + if (typeof executor !== "function") { + throw new TypeError("executor must be a function."); + } + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + var token = this; + this.promise.then(function(cancel) { + if (!token._listeners) + return; + var i2; + var l2 = token._listeners.length; + for (i2 = 0; i2 < l2; i2++) { + token._listeners[i2](cancel); + } + token._listeners = null; + }); + this.promise.then = function(onfulfilled) { + var _resolve; + var promise = new Promise(function(resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message) { + if (token.reason) { + return; + } + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); + } + CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + }; + CancelToken.prototype.subscribe = function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + }; + CancelToken.prototype.unsubscribe = function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index2 = this._listeners.indexOf(listener); + if (index2 !== -1) { + this._listeners.splice(index2, 1); + } + }; + CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c2) { + cancel = c2; + }); + return { + token, + cancel + }; + }; + module.exports = CancelToken; + } + }); + + // ../../node_modules/axios/lib/helpers/spread.js + var require_spread = __commonJS({ + "../../node_modules/axios/lib/helpers/spread.js"(exports, module) { + "use strict"; + module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; + } + }); + + // ../../node_modules/axios/lib/helpers/isAxiosError.js + var require_isAxiosError = __commonJS({ + "../../node_modules/axios/lib/helpers/isAxiosError.js"(exports, module) { + "use strict"; + var utils = require_utils(); + module.exports = function isAxiosError(payload) { + return utils.isObject(payload) && payload.isAxiosError === true; + }; + } + }); + + // ../../node_modules/axios/lib/axios.js + var require_axios = __commonJS({ + "../../node_modules/axios/lib/axios.js"(exports, module) { + "use strict"; + var utils = require_utils(); + var bind = require_bind(); + var Axios = require_Axios(); + var mergeConfig2 = require_mergeConfig(); + var defaults = require_defaults(); + function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + utils.extend(instance, Axios.prototype, context); + utils.extend(instance, context); + instance.create = function create2(instanceConfig) { + return createInstance(mergeConfig2(defaultConfig, instanceConfig)); + }; + return instance; + } + var axios = createInstance(defaults); + axios.Axios = Axios; + axios.Cancel = require_Cancel(); + axios.CancelToken = require_CancelToken(); + axios.isCancel = require_isCancel(); + axios.VERSION = require_data().version; + axios.all = function all(promises) { + return Promise.all(promises); + }; + axios.spread = require_spread(); + axios.isAxiosError = require_isAxiosError(); + module.exports = axios; + module.exports.default = axios; + } + }); + + // ../../node_modules/axios/index.js + var require_axios2 = __commonJS({ + "../../node_modules/axios/index.js"(exports, module) { + module.exports = require_axios(); + } + }); + + // ../../node_modules/react-modal/lib/helpers/tabbable.js + var require_tabbable = __commonJS({ + "../../node_modules/react-modal/lib/helpers/tabbable.js"(exports, module) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = findTabbableDescendants; + var tabbableNode = /input|select|textarea|button|object|iframe/; + function hidesContents(element) { + var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; + if (zeroSize && !element.innerHTML) + return true; + try { + var style = window.getComputedStyle(element); + return zeroSize ? style.getPropertyValue("overflow") !== "visible" || element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue("display") == "none"; + } catch (exception) { + console.warn("Failed to inspect element style"); + return false; + } + } + function visible(element) { + var parentElement = element; + var rootNode = element.getRootNode && element.getRootNode(); + while (parentElement) { + if (parentElement === document.body) + break; + if (rootNode && parentElement === rootNode) + parentElement = rootNode.host.parentNode; + if (hidesContents(parentElement)) + return false; + parentElement = parentElement.parentNode; + } + return true; + } + function focusable(element, isTabIndexNotNaN) { + var nodeName = element.nodeName.toLowerCase(); + var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN); + return res && visible(element); + } + function tabbable(element) { + var tabIndex = element.getAttribute("tabindex"); + if (tabIndex === null) + tabIndex = void 0; + var isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); + } + function findTabbableDescendants(element) { + var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function(finished, el) { + return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot)); + }, []); + return descendants.filter(tabbable); + } + module.exports = exports["default"]; + } + }); + + // ../../node_modules/react-modal/lib/helpers/focusManager.js + var require_focusManager = __commonJS({ + "../../node_modules/react-modal/lib/helpers/focusManager.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.resetState = resetState; + exports.log = log; + exports.handleBlur = handleBlur; + exports.handleFocus = handleFocus; + exports.markForFocusLater = markForFocusLater; + exports.returnFocus = returnFocus; + exports.popWithoutFocus = popWithoutFocus; + exports.setupScopedFocus = setupScopedFocus; + exports.teardownScopedFocus = teardownScopedFocus; + var _tabbable = require_tabbable(); + var _tabbable2 = _interopRequireDefault(_tabbable); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var focusLaterElements = []; + var modalElement = null; + var needToFocus = false; + function resetState() { + focusLaterElements = []; + } + function log() { + if (true) { + console.log("focusManager ----------"); + focusLaterElements.forEach(function(f4) { + var check = f4 || {}; + console.log(check.nodeName, check.className, check.id); + }); + console.log("end focusManager ----------"); + } + } + function handleBlur() { + needToFocus = true; + } + function handleFocus() { + if (needToFocus) { + needToFocus = false; + if (!modalElement) { + return; + } + setTimeout(function() { + if (modalElement.contains(document.activeElement)) { + return; + } + var el = (0, _tabbable2.default)(modalElement)[0] || modalElement; + el.focus(); + }, 0); + } + } + function markForFocusLater() { + focusLaterElements.push(document.activeElement); + } + function returnFocus() { + var preventScroll = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var toFocus = null; + try { + if (focusLaterElements.length !== 0) { + toFocus = focusLaterElements.pop(); + toFocus.focus({ preventScroll }); + } + return; + } catch (e2) { + console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" ")); + } + } + function popWithoutFocus() { + focusLaterElements.length > 0 && focusLaterElements.pop(); + } + function setupScopedFocus(element) { + modalElement = element; + if (window.addEventListener) { + window.addEventListener("blur", handleBlur, false); + document.addEventListener("focus", handleFocus, true); + } else { + window.attachEvent("onBlur", handleBlur); + document.attachEvent("onFocus", handleFocus); + } + } + function teardownScopedFocus() { + modalElement = null; + if (window.addEventListener) { + window.removeEventListener("blur", handleBlur); + document.removeEventListener("focus", handleFocus); + } else { + window.detachEvent("onBlur", handleBlur); + document.detachEvent("onFocus", handleFocus); + } + } + } + }); + + // ../../node_modules/react-modal/lib/helpers/scopeTab.js + var require_scopeTab = __commonJS({ + "../../node_modules/react-modal/lib/helpers/scopeTab.js"(exports, module) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = scopeTab; + var _tabbable = require_tabbable(); + var _tabbable2 = _interopRequireDefault(_tabbable); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function getActiveElement() { + var el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document; + return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement; + } + function scopeTab(node, event) { + var tabbable = (0, _tabbable2.default)(node); + if (!tabbable.length) { + event.preventDefault(); + return; + } + var target = void 0; + var shiftKey = event.shiftKey; + var head = tabbable[0]; + var tail = tabbable[tabbable.length - 1]; + var activeElement = getActiveElement(); + if (node === activeElement) { + if (!shiftKey) + return; + target = tail; + } + if (tail === activeElement && !shiftKey) { + target = head; + } + if (head === activeElement && shiftKey) { + target = tail; + } + if (target) { + event.preventDefault(); + target.focus(); + return; + } + var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent); + var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null; + if (!isSafariDesktop) + return; + var x2 = tabbable.indexOf(activeElement); + if (x2 > -1) { + x2 += shiftKey ? -1 : 1; + } + target = tabbable[x2]; + if (typeof target === "undefined") { + event.preventDefault(); + target = shiftKey ? tail : head; + target.focus(); + return; + } + event.preventDefault(); + target.focus(); + } + module.exports = exports["default"]; + } + }); + + // ../../node_modules/warning/warning.js + var require_warning = __commonJS({ + "../../node_modules/warning/warning.js"(exports, module) { + "use strict"; + var __DEV__ = true; + var warning = function() { + }; + if (__DEV__) { + printWarning = function printWarning2(format2, args) { + var len = arguments.length; + args = new Array(len > 1 ? len - 1 : 0); + for (var key = 1; key < len; key++) { + args[key - 1] = arguments[key]; + } + var argIndex = 0; + var message = "Warning: " + format2.replace(/%s/g, function() { + return args[argIndex++]; + }); + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x2) { + } + }; + warning = function(condition, format2, args) { + var len = arguments.length; + args = new Array(len > 2 ? len - 2 : 0); + for (var key = 2; key < len; key++) { + args[key - 2] = arguments[key]; + } + if (format2 === void 0) { + throw new Error( + "`warning(condition, format, ...args)` requires a warning message argument" + ); + } + if (!condition) { + printWarning.apply(null, [format2].concat(args)); + } + }; + } + var printWarning; + module.exports = warning; + } + }); + + // ../../node_modules/exenv/index.js + var require_exenv = __commonJS({ + "../../node_modules/exenv/index.js"(exports, module) { + (function() { + "use strict"; + var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); + var ExecutionEnvironment = { + canUseDOM, + canUseWorkers: typeof Worker !== "undefined", + canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + canUseViewport: canUseDOM && !!window.screen + }; + if (typeof define === "function" && typeof define.amd === "object" && define.amd) { + define(function() { + return ExecutionEnvironment; + }); + } else if (typeof module !== "undefined" && module.exports) { + module.exports = ExecutionEnvironment; + } else { + window.ExecutionEnvironment = ExecutionEnvironment; + } + })(); + } + }); + + // ../../node_modules/react-modal/lib/helpers/safeHTMLElement.js + var require_safeHTMLElement = __commonJS({ + "../../node_modules/react-modal/lib/helpers/safeHTMLElement.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = void 0; + var _exenv = require_exenv(); + var _exenv2 = _interopRequireDefault(_exenv); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var EE = _exenv2.default; + var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {}; + var SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {}; + var SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {}; + var canUseDOM = exports.canUseDOM = EE.canUseDOM; + exports.default = SafeHTMLElement; + } + }); + + // ../../node_modules/react-modal/lib/helpers/ariaAppHider.js + var require_ariaAppHider = __commonJS({ + "../../node_modules/react-modal/lib/helpers/ariaAppHider.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.resetState = resetState; + exports.log = log; + exports.assertNodeList = assertNodeList; + exports.setElement = setElement; + exports.validateElement = validateElement; + exports.hide = hide2; + exports.show = show; + exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting; + var _warning = require_warning(); + var _warning2 = _interopRequireDefault(_warning); + var _safeHTMLElement = require_safeHTMLElement(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var globalElement = null; + function resetState() { + if (globalElement) { + if (globalElement.removeAttribute) { + globalElement.removeAttribute("aria-hidden"); + } else if (globalElement.length != null) { + globalElement.forEach(function(element) { + return element.removeAttribute("aria-hidden"); + }); + } else { + document.querySelectorAll(globalElement).forEach(function(element) { + return element.removeAttribute("aria-hidden"); + }); + } + } + globalElement = null; + } + function log() { + if (true) { + var check = globalElement || {}; + console.log("ariaAppHider ----------"); + console.log(check.nodeName, check.className, check.id); + console.log("end ariaAppHider ----------"); + } + } + function assertNodeList(nodeList, selector) { + if (!nodeList || !nodeList.length) { + throw new Error("react-modal: No elements were found for selector " + selector + "."); + } + } + function setElement(element) { + var useElement = element; + if (typeof useElement === "string" && _safeHTMLElement.canUseDOM) { + var el = document.querySelectorAll(useElement); + assertNodeList(el, useElement); + useElement = el; + } + globalElement = useElement || globalElement; + return globalElement; + } + function validateElement(appElement) { + var el = appElement || globalElement; + if (el) { + return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el]; + } else { + (0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")); + return []; + } + } + function hide2(appElement) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var el = _step.value; + el.setAttribute("aria-hidden", "true"); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + function show(appElement) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var el = _step2.value; + el.removeAttribute("aria-hidden"); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + function documentNotReadyOrSSRTesting() { + globalElement = null; + } + } + }); + + // ../../node_modules/react-modal/lib/helpers/classList.js + var require_classList = __commonJS({ + "../../node_modules/react-modal/lib/helpers/classList.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.resetState = resetState; + exports.log = log; + var htmlClassList = {}; + var docBodyClassList = {}; + function removeClass(at, cls) { + at.classList.remove(cls); + } + function resetState() { + var htmlElement = document.getElementsByTagName("html")[0]; + for (var cls in htmlClassList) { + removeClass(htmlElement, htmlClassList[cls]); + } + var body = document.body; + for (var _cls in docBodyClassList) { + removeClass(body, docBodyClassList[_cls]); + } + htmlClassList = {}; + docBodyClassList = {}; + } + function log() { + if (true) { + var classes = document.getElementsByTagName("html")[0].className; + var buffer = "Show tracked classes:\n\n"; + buffer += " (" + classes + "):\n "; + for (var x2 in htmlClassList) { + buffer += " " + x2 + " " + htmlClassList[x2] + "\n "; + } + classes = document.body.className; + buffer += "\n\ndoc.body (" + classes + "):\n "; + for (var _x in docBodyClassList) { + buffer += " " + _x + " " + docBodyClassList[_x] + "\n "; + } + buffer += "\n"; + console.log(buffer); + } + } + var incrementReference = function incrementReference2(poll, className) { + if (!poll[className]) { + poll[className] = 0; + } + poll[className] += 1; + return className; + }; + var decrementReference = function decrementReference2(poll, className) { + if (poll[className]) { + poll[className] -= 1; + } + return className; + }; + var trackClass = function trackClass2(classListRef, poll, classes) { + classes.forEach(function(className) { + incrementReference(poll, className); + classListRef.add(className); + }); + }; + var untrackClass = function untrackClass2(classListRef, poll, classes) { + classes.forEach(function(className) { + decrementReference(poll, className); + poll[className] === 0 && classListRef.remove(className); + }); + }; + var add = exports.add = function add2(element, classString) { + return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" ")); + }; + var remove = exports.remove = function remove2(element, classString) { + return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" ")); + }; + } + }); + + // ../../node_modules/react-modal/lib/helpers/portalOpenInstances.js + var require_portalOpenInstances = __commonJS({ + "../../node_modules/react-modal/lib/helpers/portalOpenInstances.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.log = log; + exports.resetState = resetState; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var PortalOpenInstances = function PortalOpenInstances2() { + var _this = this; + _classCallCheck(this, PortalOpenInstances2); + this.register = function(openInstance) { + if (_this.openInstances.indexOf(openInstance) !== -1) { + if (true) { + console.warn("React-Modal: Cannot register modal instance that's already open"); + } + return; + } + _this.openInstances.push(openInstance); + _this.emit("register"); + }; + this.deregister = function(openInstance) { + var index2 = _this.openInstances.indexOf(openInstance); + if (index2 === -1) { + if (true) { + console.warn("React-Modal: Unable to deregister " + openInstance + " as it was never registered"); + } + return; + } + _this.openInstances.splice(index2, 1); + _this.emit("deregister"); + }; + this.subscribe = function(callback) { + _this.subscribers.push(callback); + }; + this.emit = function(eventType) { + _this.subscribers.forEach(function(subscriber) { + return subscriber( + eventType, + _this.openInstances.slice() + ); + }); + }; + this.openInstances = []; + this.subscribers = []; + }; + var portalOpenInstances = new PortalOpenInstances(); + function log() { + console.log("portalOpenInstances ----------"); + console.log(portalOpenInstances.openInstances.length); + portalOpenInstances.openInstances.forEach(function(p2) { + return console.log(p2); + }); + console.log("end portalOpenInstances ----------"); + } + function resetState() { + portalOpenInstances = new PortalOpenInstances(); + } + exports.default = portalOpenInstances; + } + }); + + // ../../node_modules/react-modal/lib/helpers/bodyTrap.js + var require_bodyTrap = __commonJS({ + "../../node_modules/react-modal/lib/helpers/bodyTrap.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.resetState = resetState; + exports.log = log; + var _portalOpenInstances = require_portalOpenInstances(); + var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var before = void 0; + var after = void 0; + var instances = []; + function resetState() { + var _arr = [before, after]; + for (var _i = 0; _i < _arr.length; _i++) { + var item = _arr[_i]; + if (!item) + continue; + item.parentNode && item.parentNode.removeChild(item); + } + before = after = null; + instances = []; + } + function log() { + console.log("bodyTrap ----------"); + console.log(instances.length); + var _arr2 = [before, after]; + for (var _i2 = 0; _i2 < _arr2.length; _i2++) { + var item = _arr2[_i2]; + var check = item || {}; + console.log(check.nodeName, check.className, check.id); + } + console.log("edn bodyTrap ----------"); + } + function focusContent() { + if (instances.length === 0) { + if (true) { + console.warn("React-Modal: Open instances > 0 expected"); + } + return; + } + instances[instances.length - 1].focusContent(); + } + function bodyTrap(eventType, openInstances) { + if (!before && !after) { + before = document.createElement("div"); + before.setAttribute("data-react-modal-body-trap", ""); + before.style.position = "absolute"; + before.style.opacity = "0"; + before.setAttribute("tabindex", "0"); + before.addEventListener("focus", focusContent); + after = before.cloneNode(); + after.addEventListener("focus", focusContent); + } + instances = openInstances; + if (instances.length > 0) { + if (document.body.firstChild !== before) { + document.body.insertBefore(before, document.body.firstChild); + } + if (document.body.lastChild !== after) { + document.body.appendChild(after); + } + } else { + if (before.parentElement) { + before.parentElement.removeChild(before); + } + if (after.parentElement) { + after.parentElement.removeChild(after); + } + } + } + _portalOpenInstances2.default.subscribe(bodyTrap); + } + }); + + // ../../node_modules/react-modal/lib/components/ModalPortal.js + var require_ModalPortal = __commonJS({ + "../../node_modules/react-modal/lib/components/ModalPortal.js"(exports, module) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _extends2 = Object.assign || function(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = arguments[i2]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { + return typeof obj; + } : function(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + var _createClass = function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + var _react = require_react(); + var _propTypes = require_prop_types(); + var _propTypes2 = _interopRequireDefault(_propTypes); + var _focusManager = require_focusManager(); + var focusManager2 = _interopRequireWildcard(_focusManager); + var _scopeTab = require_scopeTab(); + var _scopeTab2 = _interopRequireDefault(_scopeTab); + var _ariaAppHider = require_ariaAppHider(); + var ariaAppHider = _interopRequireWildcard(_ariaAppHider); + var _classList = require_classList(); + var classList = _interopRequireWildcard(_classList); + var _safeHTMLElement = require_safeHTMLElement(); + var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); + var _portalOpenInstances = require_portalOpenInstances(); + var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances); + require_bodyTrap(); + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) + newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _possibleConstructorReturn(self2, call) { + if (!self2) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self2; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var CLASS_NAMES = { + overlay: "ReactModal__Overlay", + content: "ReactModal__Content" + }; + var TAB_KEY = 9; + var ESC_KEY = 27; + var ariaHiddenInstances = 0; + var ModalPortal = function(_Component) { + _inherits(ModalPortal2, _Component); + function ModalPortal2(props) { + _classCallCheck(this, ModalPortal2); + var _this = _possibleConstructorReturn(this, (ModalPortal2.__proto__ || Object.getPrototypeOf(ModalPortal2)).call(this, props)); + _this.setOverlayRef = function(overlay) { + _this.overlay = overlay; + _this.props.overlayRef && _this.props.overlayRef(overlay); + }; + _this.setContentRef = function(content) { + _this.content = content; + _this.props.contentRef && _this.props.contentRef(content); + }; + _this.afterClose = function() { + var _this$props = _this.props, appElement = _this$props.appElement, ariaHideApp = _this$props.ariaHideApp, htmlOpenClassName = _this$props.htmlOpenClassName, bodyOpenClassName = _this$props.bodyOpenClassName; + bodyOpenClassName && classList.remove(document.body, bodyOpenClassName); + htmlOpenClassName && classList.remove(document.getElementsByTagName("html")[0], htmlOpenClassName); + if (ariaHideApp && ariaHiddenInstances > 0) { + ariaHiddenInstances -= 1; + if (ariaHiddenInstances === 0) { + ariaAppHider.show(appElement); + } + } + if (_this.props.shouldFocusAfterRender) { + if (_this.props.shouldReturnFocusAfterClose) { + focusManager2.returnFocus(_this.props.preventScroll); + focusManager2.teardownScopedFocus(); + } else { + focusManager2.popWithoutFocus(); + } + } + if (_this.props.onAfterClose) { + _this.props.onAfterClose(); + } + _portalOpenInstances2.default.deregister(_this); + }; + _this.open = function() { + _this.beforeOpen(); + if (_this.state.afterOpen && _this.state.beforeClose) { + clearTimeout(_this.closeTimer); + _this.setState({ beforeClose: false }); + } else { + if (_this.props.shouldFocusAfterRender) { + focusManager2.setupScopedFocus(_this.node); + focusManager2.markForFocusLater(); + } + _this.setState({ isOpen: true }, function() { + _this.openAnimationFrame = requestAnimationFrame(function() { + _this.setState({ afterOpen: true }); + if (_this.props.isOpen && _this.props.onAfterOpen) { + _this.props.onAfterOpen({ + overlayEl: _this.overlay, + contentEl: _this.content + }); + } + }); + }); + } + }; + _this.close = function() { + if (_this.props.closeTimeoutMS > 0) { + _this.closeWithTimeout(); + } else { + _this.closeWithoutTimeout(); + } + }; + _this.focusContent = function() { + return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true }); + }; + _this.closeWithTimeout = function() { + var closesAt = Date.now() + _this.props.closeTimeoutMS; + _this.setState({ beforeClose: true, closesAt }, function() { + _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now()); + }); + }; + _this.closeWithoutTimeout = function() { + _this.setState({ + beforeClose: false, + isOpen: false, + afterOpen: false, + closesAt: null + }, _this.afterClose); + }; + _this.handleKeyDown = function(event) { + if (event.keyCode === TAB_KEY) { + (0, _scopeTab2.default)(_this.content, event); + } + if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) { + event.stopPropagation(); + _this.requestClose(event); + } + }; + _this.handleOverlayOnClick = function(event) { + if (_this.shouldClose === null) { + _this.shouldClose = true; + } + if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) { + if (_this.ownerHandlesClose()) { + _this.requestClose(event); + } else { + _this.focusContent(); + } + } + _this.shouldClose = null; + }; + _this.handleContentOnMouseUp = function() { + _this.shouldClose = false; + }; + _this.handleOverlayOnMouseDown = function(event) { + if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) { + event.preventDefault(); + } + }; + _this.handleContentOnClick = function() { + _this.shouldClose = false; + }; + _this.handleContentOnMouseDown = function() { + _this.shouldClose = false; + }; + _this.requestClose = function(event) { + return _this.ownerHandlesClose() && _this.props.onRequestClose(event); + }; + _this.ownerHandlesClose = function() { + return _this.props.onRequestClose; + }; + _this.shouldBeClosed = function() { + return !_this.state.isOpen && !_this.state.beforeClose; + }; + _this.contentHasFocus = function() { + return document.activeElement === _this.content || _this.content.contains(document.activeElement); + }; + _this.buildClassName = function(which, additional) { + var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : { + base: CLASS_NAMES[which], + afterOpen: CLASS_NAMES[which] + "--after-open", + beforeClose: CLASS_NAMES[which] + "--before-close" + }; + var className = classNames.base; + if (_this.state.afterOpen) { + className = className + " " + classNames.afterOpen; + } + if (_this.state.beforeClose) { + className = className + " " + classNames.beforeClose; + } + return typeof additional === "string" && additional ? className + " " + additional : className; + }; + _this.attributesFromObject = function(prefix, items) { + return Object.keys(items).reduce(function(acc, name) { + acc[prefix + "-" + name] = items[name]; + return acc; + }, {}); + }; + _this.state = { + afterOpen: false, + beforeClose: false + }; + _this.shouldClose = null; + _this.moveFromContentToOverlay = null; + return _this; + } + _createClass(ModalPortal2, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (this.props.isOpen) { + this.open(); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + if (true) { + if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) { + console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'); + } + if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) { + console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'); + } + } + if (this.props.isOpen && !prevProps.isOpen) { + this.open(); + } else if (!this.props.isOpen && prevProps.isOpen) { + this.close(); + } + if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) { + this.focusContent(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.state.isOpen) { + this.afterClose(); + } + clearTimeout(this.closeTimer); + cancelAnimationFrame(this.openAnimationFrame); + } + }, { + key: "beforeOpen", + value: function beforeOpen() { + var _props = this.props, appElement = _props.appElement, ariaHideApp = _props.ariaHideApp, htmlOpenClassName = _props.htmlOpenClassName, bodyOpenClassName = _props.bodyOpenClassName; + bodyOpenClassName && classList.add(document.body, bodyOpenClassName); + htmlOpenClassName && classList.add(document.getElementsByTagName("html")[0], htmlOpenClassName); + if (ariaHideApp) { + ariaHiddenInstances += 1; + ariaAppHider.hide(appElement); + } + _portalOpenInstances2.default.register(this); + } + }, { + key: "render", + value: function render2() { + var _props2 = this.props, id = _props2.id, className = _props2.className, overlayClassName = _props2.overlayClassName, defaultStyles = _props2.defaultStyles, children = _props2.children; + var contentStyles = className ? {} : defaultStyles.content; + var overlayStyles = overlayClassName ? {} : defaultStyles.overlay; + if (this.shouldBeClosed()) { + return null; + } + var overlayProps = { + ref: this.setOverlayRef, + className: this.buildClassName("overlay", overlayClassName), + style: _extends2({}, overlayStyles, this.props.style.overlay), + onClick: this.handleOverlayOnClick, + onMouseDown: this.handleOverlayOnMouseDown + }; + var contentProps = _extends2({ + id, + ref: this.setContentRef, + style: _extends2({}, contentStyles, this.props.style.content), + className: this.buildClassName("content", className), + tabIndex: "-1", + onKeyDown: this.handleKeyDown, + onMouseDown: this.handleContentOnMouseDown, + onMouseUp: this.handleContentOnMouseUp, + onClick: this.handleContentOnClick, + role: this.props.role, + "aria-label": this.props.contentLabel + }, this.attributesFromObject("aria", _extends2({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), { + "data-testid": this.props.testId + }); + var contentElement = this.props.contentElement(contentProps, children); + return this.props.overlayElement(overlayProps, contentElement); + } + }]); + return ModalPortal2; + }(_react.Component); + ModalPortal.defaultProps = { + style: { + overlay: {}, + content: {} + }, + defaultStyles: {} + }; + ModalPortal.propTypes = { + isOpen: _propTypes2.default.bool.isRequired, + defaultStyles: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + style: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + bodyOpenClassName: _propTypes2.default.string, + htmlOpenClassName: _propTypes2.default.string, + ariaHideApp: _propTypes2.default.bool, + appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]), + onAfterOpen: _propTypes2.default.func, + onAfterClose: _propTypes2.default.func, + onRequestClose: _propTypes2.default.func, + closeTimeoutMS: _propTypes2.default.number, + shouldFocusAfterRender: _propTypes2.default.bool, + shouldCloseOnOverlayClick: _propTypes2.default.bool, + shouldReturnFocusAfterClose: _propTypes2.default.bool, + preventScroll: _propTypes2.default.bool, + role: _propTypes2.default.string, + contentLabel: _propTypes2.default.string, + aria: _propTypes2.default.object, + data: _propTypes2.default.object, + children: _propTypes2.default.node, + shouldCloseOnEsc: _propTypes2.default.bool, + overlayRef: _propTypes2.default.func, + contentRef: _propTypes2.default.func, + id: _propTypes2.default.string, + overlayElement: _propTypes2.default.func, + contentElement: _propTypes2.default.func, + testId: _propTypes2.default.string + }; + exports.default = ModalPortal; + module.exports = exports["default"]; + } + }); + + // ../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js + var react_lifecycles_compat_es_exports = {}; + __export(react_lifecycles_compat_es_exports, { + polyfill: () => polyfill + }); + function componentWillMount() { + var state = this.constructor.getDerivedStateFromProps(this.props, this.state); + if (state !== null && state !== void 0) { + this.setState(state); + } + } + function componentWillReceiveProps(nextProps) { + function updater(prevState) { + var state = this.constructor.getDerivedStateFromProps(nextProps, prevState); + return state !== null && state !== void 0 ? state : null; + } + this.setState(updater.bind(this)); + } + function componentWillUpdate(nextProps, nextState) { + try { + var prevProps = this.props; + var prevState = this.state; + this.props = nextProps; + this.state = nextState; + this.__reactInternalSnapshotFlag = true; + this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate( + prevProps, + prevState + ); + } finally { + this.props = prevProps; + this.state = prevState; + } + } + function polyfill(Component2) { + var prototype = Component2.prototype; + if (!prototype || !prototype.isReactComponent) { + throw new Error("Can only polyfill class components"); + } + if (typeof Component2.getDerivedStateFromProps !== "function" && typeof prototype.getSnapshotBeforeUpdate !== "function") { + return Component2; + } + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + if (typeof prototype.componentWillMount === "function") { + foundWillMountName = "componentWillMount"; + } else if (typeof prototype.UNSAFE_componentWillMount === "function") { + foundWillMountName = "UNSAFE_componentWillMount"; + } + if (typeof prototype.componentWillReceiveProps === "function") { + foundWillReceivePropsName = "componentWillReceiveProps"; + } else if (typeof prototype.UNSAFE_componentWillReceiveProps === "function") { + foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; + } + if (typeof prototype.componentWillUpdate === "function") { + foundWillUpdateName = "componentWillUpdate"; + } else if (typeof prototype.UNSAFE_componentWillUpdate === "function") { + foundWillUpdateName = "UNSAFE_componentWillUpdate"; + } + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var componentName = Component2.displayName || Component2.name; + var newApiName = typeof Component2.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; + throw Error( + "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + componentName + " uses " + newApiName + " but also contains the following legacy lifecycles:" + (foundWillMountName !== null ? "\n " + foundWillMountName : "") + (foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "") + (foundWillUpdateName !== null ? "\n " + foundWillUpdateName : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks" + ); + } + if (typeof Component2.getDerivedStateFromProps === "function") { + prototype.componentWillMount = componentWillMount; + prototype.componentWillReceiveProps = componentWillReceiveProps; + } + if (typeof prototype.getSnapshotBeforeUpdate === "function") { + if (typeof prototype.componentDidUpdate !== "function") { + throw new Error( + "Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype" + ); + } + prototype.componentWillUpdate = componentWillUpdate; + var componentDidUpdate = prototype.componentDidUpdate; + prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) { + var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot; + componentDidUpdate.call(this, prevProps, prevState, snapshot); + }; + } + return Component2; + } + var init_react_lifecycles_compat_es = __esm({ + "../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js"() { + componentWillMount.__suppressDeprecationWarning = true; + componentWillReceiveProps.__suppressDeprecationWarning = true; + componentWillUpdate.__suppressDeprecationWarning = true; + } + }); + + // ../../node_modules/react-modal/lib/components/Modal.js + var require_Modal = __commonJS({ + "../../node_modules/react-modal/lib/components/Modal.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bodyOpenClassName = exports.portalClassName = void 0; + var _extends2 = Object.assign || function(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = arguments[i2]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + var _createClass = function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function(Constructor, protoProps, staticProps) { + if (protoProps) + defineProperties(Constructor.prototype, protoProps); + if (staticProps) + defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + var _react = require_react(); + var _react2 = _interopRequireDefault(_react); + var _reactDom = require_react_dom(); + var _reactDom2 = _interopRequireDefault(_reactDom); + var _propTypes = require_prop_types(); + var _propTypes2 = _interopRequireDefault(_propTypes); + var _ModalPortal = require_ModalPortal(); + var _ModalPortal2 = _interopRequireDefault(_ModalPortal); + var _ariaAppHider = require_ariaAppHider(); + var ariaAppHider = _interopRequireWildcard(_ariaAppHider); + var _safeHTMLElement = require_safeHTMLElement(); + var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); + var _reactLifecyclesCompat = (init_react_lifecycles_compat_es(), __toCommonJS(react_lifecycles_compat_es_exports)); + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) + newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _possibleConstructorReturn(self2, call) { + if (!self2) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return call && (typeof call === "object" || typeof call === "function") ? call : self2; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); + if (superClass) + Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + var portalClassName = exports.portalClassName = "ReactModalPortal"; + var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open"; + var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== void 0; + var createHTMLElement = function createHTMLElement2(name) { + return document.createElement(name); + }; + var getCreatePortal = function getCreatePortal2() { + return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer; + }; + function getParentElement(parentSelector) { + return parentSelector(); + } + var Modal = function(_Component) { + _inherits(Modal2, _Component); + function Modal2() { + var _ref; + var _temp, _this, _ret; + _classCallCheck(this, Modal2); + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal2.__proto__ || Object.getPrototypeOf(Modal2)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function() { + !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node); + var parent = getParentElement(_this.props.parentSelector); + if (parent && parent.contains(_this.node)) { + parent.removeChild(_this.node); + } else { + console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.'); + } + }, _this.portalRef = function(ref) { + _this.portal = ref; + }, _this.renderPortal = function(props) { + var createPortal2 = getCreatePortal(); + var portal = createPortal2(_this, _react2.default.createElement(_ModalPortal2.default, _extends2({ defaultStyles: Modal2.defaultStyles }, props)), _this.node); + _this.portalRef(portal); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + _createClass(Modal2, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (!_safeHTMLElement.canUseDOM) + return; + if (!isReact16) { + this.node = createHTMLElement("div"); + } + this.node.className = this.props.portalClassName; + var parent = getParentElement(this.props.parentSelector); + parent.appendChild(this.node); + !isReact16 && this.renderPortal(this.props); + } + }, { + key: "getSnapshotBeforeUpdate", + value: function getSnapshotBeforeUpdate(prevProps) { + var prevParent = getParentElement(prevProps.parentSelector); + var nextParent = getParentElement(this.props.parentSelector); + return { prevParent, nextParent }; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, _2, snapshot) { + if (!_safeHTMLElement.canUseDOM) + return; + var _props = this.props, isOpen = _props.isOpen, portalClassName2 = _props.portalClassName; + if (prevProps.portalClassName !== portalClassName2) { + this.node.className = portalClassName2; + } + var prevParent = snapshot.prevParent, nextParent = snapshot.nextParent; + if (nextParent !== prevParent) { + prevParent.removeChild(this.node); + nextParent.appendChild(this.node); + } + if (!prevProps.isOpen && !isOpen) + return; + !isReact16 && this.renderPortal(this.props); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) + return; + var state = this.portal.state; + var now2 = Date.now(); + var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now2 + this.props.closeTimeoutMS); + if (closesAt) { + if (!state.beforeClose) { + this.portal.closeWithTimeout(); + } + setTimeout(this.removePortal, closesAt - now2); + } else { + this.removePortal(); + } + } + }, { + key: "render", + value: function render2() { + if (!_safeHTMLElement.canUseDOM || !isReact16) { + return null; + } + if (!this.node && isReact16) { + this.node = createHTMLElement("div"); + } + var createPortal2 = getCreatePortal(); + return createPortal2(_react2.default.createElement(_ModalPortal2.default, _extends2({ + ref: this.portalRef, + defaultStyles: Modal2.defaultStyles + }, this.props)), this.node); + } + }], [{ + key: "setAppElement", + value: function setAppElement(element) { + ariaAppHider.setElement(element); + } + }]); + return Modal2; + }(_react.Component); + Modal.propTypes = { + isOpen: _propTypes2.default.bool.isRequired, + style: _propTypes2.default.shape({ + content: _propTypes2.default.object, + overlay: _propTypes2.default.object + }), + portalClassName: _propTypes2.default.string, + bodyOpenClassName: _propTypes2.default.string, + htmlOpenClassName: _propTypes2.default.string, + className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ + base: _propTypes2.default.string.isRequired, + afterOpen: _propTypes2.default.string.isRequired, + beforeClose: _propTypes2.default.string.isRequired + })]), + overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ + base: _propTypes2.default.string.isRequired, + afterOpen: _propTypes2.default.string.isRequired, + beforeClose: _propTypes2.default.string.isRequired + })]), + appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]), + onAfterOpen: _propTypes2.default.func, + onRequestClose: _propTypes2.default.func, + closeTimeoutMS: _propTypes2.default.number, + ariaHideApp: _propTypes2.default.bool, + shouldFocusAfterRender: _propTypes2.default.bool, + shouldCloseOnOverlayClick: _propTypes2.default.bool, + shouldReturnFocusAfterClose: _propTypes2.default.bool, + preventScroll: _propTypes2.default.bool, + parentSelector: _propTypes2.default.func, + aria: _propTypes2.default.object, + data: _propTypes2.default.object, + role: _propTypes2.default.string, + contentLabel: _propTypes2.default.string, + shouldCloseOnEsc: _propTypes2.default.bool, + overlayRef: _propTypes2.default.func, + contentRef: _propTypes2.default.func, + id: _propTypes2.default.string, + overlayElement: _propTypes2.default.func, + contentElement: _propTypes2.default.func + }; + Modal.defaultProps = { + isOpen: false, + portalClassName, + bodyOpenClassName, + role: "dialog", + ariaHideApp: true, + closeTimeoutMS: 0, + shouldFocusAfterRender: true, + shouldCloseOnEsc: true, + shouldCloseOnOverlayClick: true, + shouldReturnFocusAfterClose: true, + preventScroll: false, + parentSelector: function parentSelector() { + return document.body; + }, + overlayElement: function overlayElement(props, contentEl) { + return _react2.default.createElement( + "div", + props, + contentEl + ); + }, + contentElement: function contentElement(props, children) { + return _react2.default.createElement( + "div", + props, + children + ); + } + }; + Modal.defaultStyles = { + overlay: { + position: "fixed", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: "rgba(255, 255, 255, 0.75)" + }, + content: { + position: "absolute", + top: "40px", + left: "40px", + right: "40px", + bottom: "40px", + border: "1px solid #ccc", + background: "#fff", + overflow: "auto", + WebkitOverflowScrolling: "touch", + borderRadius: "4px", + outline: "none", + padding: "20px" + } + }; + (0, _reactLifecyclesCompat.polyfill)(Modal); + if (true) { + Modal.setCreateHTMLElement = function(fn3) { + return createHTMLElement = fn3; + }; + } + exports.default = Modal; + } + }); + + // ../../node_modules/react-modal/lib/index.js + var require_lib = __commonJS({ + "../../node_modules/react-modal/lib/index.js"(exports, module) { + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _Modal = require_Modal(); + var _Modal2 = _interopRequireDefault(_Modal); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + exports.default = _Modal2.default; + module.exports = exports["default"]; + } + }); + + // src/index.tsx + var src_exports = {}; + __export(src_exports, { + BlockImage: () => Image_default, + BlockImageInitialData: () => initialData, + UploadImage: () => UploadImage, + default: () => src_default + }); + + // src/Image/index.tsx + var import_blocks_editor2 = __toESM(require_blocks_editor()); + var import_react13 = __toESM(require_react()); + + // ../../node_modules/tslib/modules/index.js + var import_tslib = __toESM(require_tslib(), 1); + var { + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __exportStar, + __createBinding, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn + } = import_tslib.default; + + // ../../node_modules/react-intl/lib/src/components/createFormattedComponent.js + var React5 = __toESM(require_react()); + + // ../../node_modules/react-intl/lib/src/components/useIntl.js + var React4 = __toESM(require_react()); + + // ../../node_modules/react-intl/lib/src/components/injectIntl.js + var React3 = __toESM(require_react()); + var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs()); + + // ../../node_modules/react-intl/lib/src/utils.js + var React2 = __toESM(require_react()); + + // ../../node_modules/@formatjs/ecma402-abstract/lib/utils.js + function invariant(condition, message, Err) { + if (Err === void 0) { + Err = Error; + } + if (!condition) { + throw new Err(message); + } + } + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js + var ErrorKind; + (function(ErrorKind2) { + ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; + ErrorKind2[ErrorKind2["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; + ErrorKind2[ErrorKind2["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; + ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; + ErrorKind2[ErrorKind2["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; + ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; + ErrorKind2[ErrorKind2["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; + ErrorKind2[ErrorKind2["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; + ErrorKind2[ErrorKind2["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; + ErrorKind2[ErrorKind2["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; + ErrorKind2[ErrorKind2["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; + ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; + ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; + ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; + ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; + ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; + ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; + ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; + ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; + ErrorKind2[ErrorKind2["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; + ErrorKind2[ErrorKind2["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; + ErrorKind2[ErrorKind2["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; + ErrorKind2[ErrorKind2["INVALID_TAG"] = 23] = "INVALID_TAG"; + ErrorKind2[ErrorKind2["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; + ErrorKind2[ErrorKind2["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; + ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; + })(ErrorKind || (ErrorKind = {})); + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js + var TYPE; + (function(TYPE2) { + TYPE2[TYPE2["literal"] = 0] = "literal"; + TYPE2[TYPE2["argument"] = 1] = "argument"; + TYPE2[TYPE2["number"] = 2] = "number"; + TYPE2[TYPE2["date"] = 3] = "date"; + TYPE2[TYPE2["time"] = 4] = "time"; + TYPE2[TYPE2["select"] = 5] = "select"; + TYPE2[TYPE2["plural"] = 6] = "plural"; + TYPE2[TYPE2["pound"] = 7] = "pound"; + TYPE2[TYPE2["tag"] = 8] = "tag"; + })(TYPE || (TYPE = {})); + var SKELETON_TYPE; + (function(SKELETON_TYPE2) { + SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number"; + SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime"; + })(SKELETON_TYPE || (SKELETON_TYPE = {})); + function isLiteralElement(el) { + return el.type === TYPE.literal; + } + function isArgumentElement(el) { + return el.type === TYPE.argument; + } + function isNumberElement(el) { + return el.type === TYPE.number; + } + function isDateElement(el) { + return el.type === TYPE.date; + } + function isTimeElement(el) { + return el.type === TYPE.time; + } + function isSelectElement(el) { + return el.type === TYPE.select; + } + function isPluralElement(el) { + return el.type === TYPE.plural; + } + function isPoundElement(el) { + return el.type === TYPE.pound; + } + function isTagElement(el) { + return el.type === TYPE.tag; + } + function isNumberSkeleton(el) { + return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number); + } + function isDateTimeSkeleton(el) { + return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime); + } + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js + var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; + + // ../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js + var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; + function parseDateTimeSkeleton(skeleton) { + var result = {}; + skeleton.replace(DATE_TIME_REGEX, function(match) { + var len = match.length; + switch (match[0]) { + case "G": + result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; + break; + case "y": + result.year = len === 2 ? "2-digit" : "numeric"; + break; + case "Y": + case "u": + case "U": + case "r": + throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); + case "q": + case "Q": + throw new RangeError("`q/Q` (quarter) patterns are not supported"); + case "M": + case "L": + result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1]; + break; + case "w": + case "W": + throw new RangeError("`w/W` (week) patterns are not supported"); + case "d": + result.day = ["numeric", "2-digit"][len - 1]; + break; + case "D": + case "F": + case "g": + throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); + case "E": + result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short"; + break; + case "e": + if (len < 4) { + throw new RangeError("`e..eee` (weekday) patterns are not supported"); + } + result.weekday = ["short", "long", "narrow", "short"][len - 4]; + break; + case "c": + if (len < 4) { + throw new RangeError("`c..ccc` (weekday) patterns are not supported"); + } + result.weekday = ["short", "long", "narrow", "short"][len - 4]; + break; + case "a": + result.hour12 = true; + break; + case "b": + case "B": + throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); + case "h": + result.hourCycle = "h12"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "H": + result.hourCycle = "h23"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "K": + result.hourCycle = "h11"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "k": + result.hourCycle = "h24"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "j": + case "J": + case "C": + throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); + case "m": + result.minute = ["numeric", "2-digit"][len - 1]; + break; + case "s": + result.second = ["numeric", "2-digit"][len - 1]; + break; + case "S": + case "A": + throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); + case "z": + result.timeZoneName = len < 4 ? "short" : "long"; + break; + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": + throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); + } + return ""; + }); + return result; + } + + // ../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js + var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; + + // ../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js + function parseNumberSkeletonFromString(skeleton) { + if (skeleton.length === 0) { + throw new Error("Number skeleton cannot be empty"); + } + var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x2) { + return x2.length > 0; + }); + var tokens = []; + for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) { + var stringToken = stringTokens_1[_i]; + var stemAndOptions = stringToken.split("/"); + if (stemAndOptions.length === 0) { + throw new Error("Invalid number skeleton"); + } + var stem = stemAndOptions[0], options = stemAndOptions.slice(1); + for (var _a2 = 0, options_1 = options; _a2 < options_1.length; _a2++) { + var option = options_1[_a2]; + if (option.length === 0) { + throw new Error("Invalid number skeleton"); + } + } + tokens.push({ stem, options }); + } + return tokens; + } + function icuUnitToEcma(unit) { + return unit.replace(/^(.*?)-/, ""); + } + var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; + var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; + var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; + var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; + function parseSignificantPrecision(str) { + var result = {}; + if (str[str.length - 1] === "r") { + result.roundingPriority = "morePrecision"; + } else if (str[str.length - 1] === "s") { + result.roundingPriority = "lessPrecision"; + } + str.replace(SIGNIFICANT_PRECISION_REGEX, function(_2, g1, g22) { + if (typeof g22 !== "string") { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length; + } else if (g22 === "+") { + result.minimumSignificantDigits = g1.length; + } else if (g1[0] === "#") { + result.maximumSignificantDigits = g1.length; + } else { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length + (typeof g22 === "string" ? g22.length : 0); + } + return ""; + }); + return result; + } + function parseSign(str) { + switch (str) { + case "sign-auto": + return { + signDisplay: "auto" + }; + case "sign-accounting": + case "()": + return { + currencySign: "accounting" + }; + case "sign-always": + case "+!": + return { + signDisplay: "always" + }; + case "sign-accounting-always": + case "()!": + return { + signDisplay: "always", + currencySign: "accounting" + }; + case "sign-except-zero": + case "+?": + return { + signDisplay: "exceptZero" + }; + case "sign-accounting-except-zero": + case "()?": + return { + signDisplay: "exceptZero", + currencySign: "accounting" + }; + case "sign-never": + case "+_": + return { + signDisplay: "never" + }; + } + } + function parseConciseScientificAndEngineeringStem(stem) { + var result; + if (stem[0] === "E" && stem[1] === "E") { + result = { + notation: "engineering" + }; + stem = stem.slice(2); + } else if (stem[0] === "E") { + result = { + notation: "scientific" + }; + stem = stem.slice(1); + } + if (result) { + var signDisplay = stem.slice(0, 2); + if (signDisplay === "+!") { + result.signDisplay = "always"; + stem = stem.slice(2); + } else if (signDisplay === "+?") { + result.signDisplay = "exceptZero"; + stem = stem.slice(2); + } + if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) { + throw new Error("Malformed concise eng/scientific notation"); + } + result.minimumIntegerDigits = stem.length; + } + return result; + } + function parseNotationOptions(opt) { + var result = {}; + var signOpts = parseSign(opt); + if (signOpts) { + return signOpts; + } + return result; + } + function parseNumberSkeleton(tokens) { + var result = {}; + for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { + var token = tokens_1[_i]; + switch (token.stem) { + case "percent": + case "%": + result.style = "percent"; + continue; + case "%x100": + result.style = "percent"; + result.scale = 100; + continue; + case "currency": + result.style = "currency"; + result.currency = token.options[0]; + continue; + case "group-off": + case ",_": + result.useGrouping = false; + continue; + case "precision-integer": + case ".": + result.maximumFractionDigits = 0; + continue; + case "measure-unit": + case "unit": + result.style = "unit"; + result.unit = icuUnitToEcma(token.options[0]); + continue; + case "compact-short": + case "K": + result.notation = "compact"; + result.compactDisplay = "short"; + continue; + case "compact-long": + case "KK": + result.notation = "compact"; + result.compactDisplay = "long"; + continue; + case "scientific": + result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) { + return __assign(__assign({}, all), parseNotationOptions(opt2)); + }, {})); + continue; + case "engineering": + result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) { + return __assign(__assign({}, all), parseNotationOptions(opt2)); + }, {})); + continue; + case "notation-simple": + result.notation = "standard"; + continue; + case "unit-width-narrow": + result.currencyDisplay = "narrowSymbol"; + result.unitDisplay = "narrow"; + continue; + case "unit-width-short": + result.currencyDisplay = "code"; + result.unitDisplay = "short"; + continue; + case "unit-width-full-name": + result.currencyDisplay = "name"; + result.unitDisplay = "long"; + continue; + case "unit-width-iso-code": + result.currencyDisplay = "symbol"; + continue; + case "scale": + result.scale = parseFloat(token.options[0]); + continue; + case "integer-width": + if (token.options.length > 1) { + throw new RangeError("integer-width stems only accept a single optional option"); + } + token.options[0].replace(INTEGER_WIDTH_REGEX, function(_2, g1, g22, g3, g4, g5) { + if (g1) { + result.minimumIntegerDigits = g22.length; + } else if (g3 && g4) { + throw new Error("We currently do not support maximum integer digits"); + } else if (g5) { + throw new Error("We currently do not support exact integer digits"); + } + return ""; + }); + continue; + } + if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { + result.minimumIntegerDigits = token.stem.length; + continue; + } + if (FRACTION_PRECISION_REGEX.test(token.stem)) { + if (token.options.length > 1) { + throw new RangeError("Fraction-precision stems only accept a single optional option"); + } + token.stem.replace(FRACTION_PRECISION_REGEX, function(_2, g1, g22, g3, g4, g5) { + if (g22 === "*") { + result.minimumFractionDigits = g1.length; + } else if (g3 && g3[0] === "#") { + result.maximumFractionDigits = g3.length; + } else if (g4 && g5) { + result.minimumFractionDigits = g4.length; + result.maximumFractionDigits = g4.length + g5.length; + } else { + result.minimumFractionDigits = g1.length; + result.maximumFractionDigits = g1.length; + } + return ""; + }); + var opt = token.options[0]; + if (opt === "w") { + result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" }); + } else if (opt) { + result = __assign(__assign({}, result), parseSignificantPrecision(opt)); + } + continue; + } + if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { + result = __assign(__assign({}, result), parseSignificantPrecision(token.stem)); + continue; + } + var signOpts = parseSign(token.stem); + if (signOpts) { + result = __assign(__assign({}, result), signOpts); + } + var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); + if (conciseScientificAndEngineeringOpts) { + result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts); + } + } + return result; + } + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js + var timeData = { + "AX": [ + "H" + ], + "BQ": [ + "H" + ], + "CP": [ + "H" + ], + "CZ": [ + "H" + ], + "DK": [ + "H" + ], + "FI": [ + "H" + ], + "ID": [ + "H" + ], + "IS": [ + "H" + ], + "ML": [ + "H" + ], + "NE": [ + "H" + ], + "RU": [ + "H" + ], + "SE": [ + "H" + ], + "SJ": [ + "H" + ], + "SK": [ + "H" + ], + "AS": [ + "h", + "H" + ], + "BT": [ + "h", + "H" + ], + "DJ": [ + "h", + "H" + ], + "ER": [ + "h", + "H" + ], + "GH": [ + "h", + "H" + ], + "IN": [ + "h", + "H" + ], + "LS": [ + "h", + "H" + ], + "PG": [ + "h", + "H" + ], + "PW": [ + "h", + "H" + ], + "SO": [ + "h", + "H" + ], + "TO": [ + "h", + "H" + ], + "VU": [ + "h", + "H" + ], + "WS": [ + "h", + "H" + ], + "001": [ + "H", + "h" + ], + "AL": [ + "h", + "H", + "hB" + ], + "TD": [ + "h", + "H", + "hB" + ], + "ca-ES": [ + "H", + "h", + "hB" + ], + "CF": [ + "H", + "h", + "hB" + ], + "CM": [ + "H", + "h", + "hB" + ], + "fr-CA": [ + "H", + "h", + "hB" + ], + "gl-ES": [ + "H", + "h", + "hB" + ], + "it-CH": [ + "H", + "h", + "hB" + ], + "it-IT": [ + "H", + "h", + "hB" + ], + "LU": [ + "H", + "h", + "hB" + ], + "NP": [ + "H", + "h", + "hB" + ], + "PF": [ + "H", + "h", + "hB" + ], + "SC": [ + "H", + "h", + "hB" + ], + "SM": [ + "H", + "h", + "hB" + ], + "SN": [ + "H", + "h", + "hB" + ], + "TF": [ + "H", + "h", + "hB" + ], + "VA": [ + "H", + "h", + "hB" + ], + "CY": [ + "h", + "H", + "hb", + "hB" + ], + "GR": [ + "h", + "H", + "hb", + "hB" + ], + "CO": [ + "h", + "H", + "hB", + "hb" + ], + "DO": [ + "h", + "H", + "hB", + "hb" + ], + "KP": [ + "h", + "H", + "hB", + "hb" + ], + "KR": [ + "h", + "H", + "hB", + "hb" + ], + "NA": [ + "h", + "H", + "hB", + "hb" + ], + "PA": [ + "h", + "H", + "hB", + "hb" + ], + "PR": [ + "h", + "H", + "hB", + "hb" + ], + "VE": [ + "h", + "H", + "hB", + "hb" + ], + "AC": [ + "H", + "h", + "hb", + "hB" + ], + "AI": [ + "H", + "h", + "hb", + "hB" + ], + "BW": [ + "H", + "h", + "hb", + "hB" + ], + "BZ": [ + "H", + "h", + "hb", + "hB" + ], + "CC": [ + "H", + "h", + "hb", + "hB" + ], + "CK": [ + "H", + "h", + "hb", + "hB" + ], + "CX": [ + "H", + "h", + "hb", + "hB" + ], + "DG": [ + "H", + "h", + "hb", + "hB" + ], + "FK": [ + "H", + "h", + "hb", + "hB" + ], + "GB": [ + "H", + "h", + "hb", + "hB" + ], + "GG": [ + "H", + "h", + "hb", + "hB" + ], + "GI": [ + "H", + "h", + "hb", + "hB" + ], + "IE": [ + "H", + "h", + "hb", + "hB" + ], + "IM": [ + "H", + "h", + "hb", + "hB" + ], + "IO": [ + "H", + "h", + "hb", + "hB" + ], + "JE": [ + "H", + "h", + "hb", + "hB" + ], + "LT": [ + "H", + "h", + "hb", + "hB" + ], + "MK": [ + "H", + "h", + "hb", + "hB" + ], + "MN": [ + "H", + "h", + "hb", + "hB" + ], + "MS": [ + "H", + "h", + "hb", + "hB" + ], + "NF": [ + "H", + "h", + "hb", + "hB" + ], + "NG": [ + "H", + "h", + "hb", + "hB" + ], + "NR": [ + "H", + "h", + "hb", + "hB" + ], + "NU": [ + "H", + "h", + "hb", + "hB" + ], + "PN": [ + "H", + "h", + "hb", + "hB" + ], + "SH": [ + "H", + "h", + "hb", + "hB" + ], + "SX": [ + "H", + "h", + "hb", + "hB" + ], + "TA": [ + "H", + "h", + "hb", + "hB" + ], + "ZA": [ + "H", + "h", + "hb", + "hB" + ], + "af-ZA": [ + "H", + "h", + "hB", + "hb" + ], + "AR": [ + "H", + "h", + "hB", + "hb" + ], + "CL": [ + "H", + "h", + "hB", + "hb" + ], + "CR": [ + "H", + "h", + "hB", + "hb" + ], + "CU": [ + "H", + "h", + "hB", + "hb" + ], + "EA": [ + "H", + "h", + "hB", + "hb" + ], + "es-BO": [ + "H", + "h", + "hB", + "hb" + ], + "es-BR": [ + "H", + "h", + "hB", + "hb" + ], + "es-EC": [ + "H", + "h", + "hB", + "hb" + ], + "es-ES": [ + "H", + "h", + "hB", + "hb" + ], + "es-GQ": [ + "H", + "h", + "hB", + "hb" + ], + "es-PE": [ + "H", + "h", + "hB", + "hb" + ], + "GT": [ + "H", + "h", + "hB", + "hb" + ], + "HN": [ + "H", + "h", + "hB", + "hb" + ], + "IC": [ + "H", + "h", + "hB", + "hb" + ], + "KG": [ + "H", + "h", + "hB", + "hb" + ], + "KM": [ + "H", + "h", + "hB", + "hb" + ], + "LK": [ + "H", + "h", + "hB", + "hb" + ], + "MA": [ + "H", + "h", + "hB", + "hb" + ], + "MX": [ + "H", + "h", + "hB", + "hb" + ], + "NI": [ + "H", + "h", + "hB", + "hb" + ], + "PY": [ + "H", + "h", + "hB", + "hb" + ], + "SV": [ + "H", + "h", + "hB", + "hb" + ], + "UY": [ + "H", + "h", + "hB", + "hb" + ], + "JP": [ + "H", + "h", + "K" + ], + "AD": [ + "H", + "hB" + ], + "AM": [ + "H", + "hB" + ], + "AO": [ + "H", + "hB" + ], + "AT": [ + "H", + "hB" + ], + "AW": [ + "H", + "hB" + ], + "BE": [ + "H", + "hB" + ], + "BF": [ + "H", + "hB" + ], + "BJ": [ + "H", + "hB" + ], + "BL": [ + "H", + "hB" + ], + "BR": [ + "H", + "hB" + ], + "CG": [ + "H", + "hB" + ], + "CI": [ + "H", + "hB" + ], + "CV": [ + "H", + "hB" + ], + "DE": [ + "H", + "hB" + ], + "EE": [ + "H", + "hB" + ], + "FR": [ + "H", + "hB" + ], + "GA": [ + "H", + "hB" + ], + "GF": [ + "H", + "hB" + ], + "GN": [ + "H", + "hB" + ], + "GP": [ + "H", + "hB" + ], + "GW": [ + "H", + "hB" + ], + "HR": [ + "H", + "hB" + ], + "IL": [ + "H", + "hB" + ], + "IT": [ + "H", + "hB" + ], + "KZ": [ + "H", + "hB" + ], + "MC": [ + "H", + "hB" + ], + "MD": [ + "H", + "hB" + ], + "MF": [ + "H", + "hB" + ], + "MQ": [ + "H", + "hB" + ], + "MZ": [ + "H", + "hB" + ], + "NC": [ + "H", + "hB" + ], + "NL": [ + "H", + "hB" + ], + "PM": [ + "H", + "hB" + ], + "PT": [ + "H", + "hB" + ], + "RE": [ + "H", + "hB" + ], + "RO": [ + "H", + "hB" + ], + "SI": [ + "H", + "hB" + ], + "SR": [ + "H", + "hB" + ], + "ST": [ + "H", + "hB" + ], + "TG": [ + "H", + "hB" + ], + "TR": [ + "H", + "hB" + ], + "WF": [ + "H", + "hB" + ], + "YT": [ + "H", + "hB" + ], + "BD": [ + "h", + "hB", + "H" + ], + "PK": [ + "h", + "hB", + "H" + ], + "AZ": [ + "H", + "hB", + "h" + ], + "BA": [ + "H", + "hB", + "h" + ], + "BG": [ + "H", + "hB", + "h" + ], + "CH": [ + "H", + "hB", + "h" + ], + "GE": [ + "H", + "hB", + "h" + ], + "LI": [ + "H", + "hB", + "h" + ], + "ME": [ + "H", + "hB", + "h" + ], + "RS": [ + "H", + "hB", + "h" + ], + "UA": [ + "H", + "hB", + "h" + ], + "UZ": [ + "H", + "hB", + "h" + ], + "XK": [ + "H", + "hB", + "h" + ], + "AG": [ + "h", + "hb", + "H", + "hB" + ], + "AU": [ + "h", + "hb", + "H", + "hB" + ], + "BB": [ + "h", + "hb", + "H", + "hB" + ], + "BM": [ + "h", + "hb", + "H", + "hB" + ], + "BS": [ + "h", + "hb", + "H", + "hB" + ], + "CA": [ + "h", + "hb", + "H", + "hB" + ], + "DM": [ + "h", + "hb", + "H", + "hB" + ], + "en-001": [ + "h", + "hb", + "H", + "hB" + ], + "FJ": [ + "h", + "hb", + "H", + "hB" + ], + "FM": [ + "h", + "hb", + "H", + "hB" + ], + "GD": [ + "h", + "hb", + "H", + "hB" + ], + "GM": [ + "h", + "hb", + "H", + "hB" + ], + "GU": [ + "h", + "hb", + "H", + "hB" + ], + "GY": [ + "h", + "hb", + "H", + "hB" + ], + "JM": [ + "h", + "hb", + "H", + "hB" + ], + "KI": [ + "h", + "hb", + "H", + "hB" + ], + "KN": [ + "h", + "hb", + "H", + "hB" + ], + "KY": [ + "h", + "hb", + "H", + "hB" + ], + "LC": [ + "h", + "hb", + "H", + "hB" + ], + "LR": [ + "h", + "hb", + "H", + "hB" + ], + "MH": [ + "h", + "hb", + "H", + "hB" + ], + "MP": [ + "h", + "hb", + "H", + "hB" + ], + "MW": [ + "h", + "hb", + "H", + "hB" + ], + "NZ": [ + "h", + "hb", + "H", + "hB" + ], + "SB": [ + "h", + "hb", + "H", + "hB" + ], + "SG": [ + "h", + "hb", + "H", + "hB" + ], + "SL": [ + "h", + "hb", + "H", + "hB" + ], + "SS": [ + "h", + "hb", + "H", + "hB" + ], + "SZ": [ + "h", + "hb", + "H", + "hB" + ], + "TC": [ + "h", + "hb", + "H", + "hB" + ], + "TT": [ + "h", + "hb", + "H", + "hB" + ], + "UM": [ + "h", + "hb", + "H", + "hB" + ], + "US": [ + "h", + "hb", + "H", + "hB" + ], + "VC": [ + "h", + "hb", + "H", + "hB" + ], + "VG": [ + "h", + "hb", + "H", + "hB" + ], + "VI": [ + "h", + "hb", + "H", + "hB" + ], + "ZM": [ + "h", + "hb", + "H", + "hB" + ], + "BO": [ + "H", + "hB", + "h", + "hb" + ], + "EC": [ + "H", + "hB", + "h", + "hb" + ], + "ES": [ + "H", + "hB", + "h", + "hb" + ], + "GQ": [ + "H", + "hB", + "h", + "hb" + ], + "PE": [ + "H", + "hB", + "h", + "hb" + ], + "AE": [ + "h", + "hB", + "hb", + "H" + ], + "ar-001": [ + "h", + "hB", + "hb", + "H" + ], + "BH": [ + "h", + "hB", + "hb", + "H" + ], + "DZ": [ + "h", + "hB", + "hb", + "H" + ], + "EG": [ + "h", + "hB", + "hb", + "H" + ], + "EH": [ + "h", + "hB", + "hb", + "H" + ], + "HK": [ + "h", + "hB", + "hb", + "H" + ], + "IQ": [ + "h", + "hB", + "hb", + "H" + ], + "JO": [ + "h", + "hB", + "hb", + "H" + ], + "KW": [ + "h", + "hB", + "hb", + "H" + ], + "LB": [ + "h", + "hB", + "hb", + "H" + ], + "LY": [ + "h", + "hB", + "hb", + "H" + ], + "MO": [ + "h", + "hB", + "hb", + "H" + ], + "MR": [ + "h", + "hB", + "hb", + "H" + ], + "OM": [ + "h", + "hB", + "hb", + "H" + ], + "PH": [ + "h", + "hB", + "hb", + "H" + ], + "PS": [ + "h", + "hB", + "hb", + "H" + ], + "QA": [ + "h", + "hB", + "hb", + "H" + ], + "SA": [ + "h", + "hB", + "hb", + "H" + ], + "SD": [ + "h", + "hB", + "hb", + "H" + ], + "SY": [ + "h", + "hB", + "hb", + "H" + ], + "TN": [ + "h", + "hB", + "hb", + "H" + ], + "YE": [ + "h", + "hB", + "hb", + "H" + ], + "AF": [ + "H", + "hb", + "hB", + "h" + ], + "LA": [ + "H", + "hb", + "hB", + "h" + ], + "CN": [ + "H", + "hB", + "hb", + "h" + ], + "LV": [ + "H", + "hB", + "hb", + "h" + ], + "TL": [ + "H", + "hB", + "hb", + "h" + ], + "zu-ZA": [ + "H", + "hB", + "hb", + "h" + ], + "CD": [ + "hB", + "H" + ], + "IR": [ + "hB", + "H" + ], + "hi-IN": [ + "hB", + "h", + "H" + ], + "kn-IN": [ + "hB", + "h", + "H" + ], + "ml-IN": [ + "hB", + "h", + "H" + ], + "te-IN": [ + "hB", + "h", + "H" + ], + "KH": [ + "hB", + "h", + "H", + "hb" + ], + "ta-IN": [ + "hB", + "h", + "hb", + "H" + ], + "BN": [ + "hb", + "hB", + "h", + "H" + ], + "MY": [ + "hb", + "hB", + "h", + "H" + ], + "ET": [ + "hB", + "hb", + "h", + "H" + ], + "gu-IN": [ + "hB", + "hb", + "h", + "H" + ], + "mr-IN": [ + "hB", + "hb", + "h", + "H" + ], + "pa-IN": [ + "hB", + "hb", + "h", + "H" + ], + "TW": [ + "hB", + "hb", + "h", + "H" + ], + "KE": [ + "hB", + "hb", + "H", + "h" + ], + "MM": [ + "hB", + "hb", + "H", + "h" + ], + "TZ": [ + "hB", + "hb", + "H", + "h" + ], + "UG": [ + "hB", + "hb", + "H", + "h" + ] + }; + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js + function getBestPattern(skeleton, locale2) { + var skeletonCopy = ""; + for (var patternPos = 0; patternPos < skeleton.length; patternPos++) { + var patternChar = skeleton.charAt(patternPos); + if (patternChar === "j") { + var extraLength = 0; + while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) { + extraLength++; + patternPos++; + } + var hourLen = 1 + (extraLength & 1); + var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); + var dayPeriodChar = "a"; + var hourChar = getDefaultHourSymbolFromLocale(locale2); + if (hourChar == "H" || hourChar == "k") { + dayPeriodLen = 0; + } + while (dayPeriodLen-- > 0) { + skeletonCopy += dayPeriodChar; + } + while (hourLen-- > 0) { + skeletonCopy = hourChar + skeletonCopy; + } + } else if (patternChar === "J") { + skeletonCopy += "H"; + } else { + skeletonCopy += patternChar; + } + } + return skeletonCopy; + } + function getDefaultHourSymbolFromLocale(locale2) { + var hourCycle = locale2.hourCycle; + if (hourCycle === void 0 && locale2.hourCycles && locale2.hourCycles.length) { + hourCycle = locale2.hourCycles[0]; + } + if (hourCycle) { + switch (hourCycle) { + case "h24": + return "k"; + case "h23": + return "H"; + case "h12": + return "h"; + case "h11": + return "K"; + default: + throw new Error("Invalid hourCycle"); + } + } + var languageTag = locale2.language; + var regionTag; + if (languageTag !== "root") { + regionTag = locale2.maximize().region; + } + var hourCycles = timeData[regionTag || ""] || timeData[languageTag || ""] || timeData["".concat(languageTag, "-001")] || timeData["001"]; + return hourCycles[0]; + } + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js + var _a; + var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")); + var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); + function createLocation(start2, end2) { + return { start: start2, end: end2 }; + } + var hasNativeStartsWith = !!String.prototype.startsWith; + var hasNativeFromCodePoint = !!String.fromCodePoint; + var hasNativeFromEntries = !!Object.fromEntries; + var hasNativeCodePointAt = !!String.prototype.codePointAt; + var hasTrimStart = !!String.prototype.trimStart; + var hasTrimEnd = !!String.prototype.trimEnd; + var hasNativeIsSafeInteger = !!Number.isSafeInteger; + var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n4) { + return typeof n4 === "number" && isFinite(n4) && Math.floor(n4) === n4 && Math.abs(n4) <= 9007199254740991; + }; + var REGEX_SUPPORTS_U_AND_Y = true; + try { + re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a"; + } catch (_2) { + REGEX_SUPPORTS_U_AND_Y = false; + } + var re; + var startsWith = hasNativeStartsWith ? function startsWith2(s2, search, position) { + return s2.startsWith(search, position); + } : function startsWith3(s2, search, position) { + return s2.slice(position, position + search.length) === search; + }; + var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : function fromCodePoint2() { + var codePoints = []; + for (var _i = 0; _i < arguments.length; _i++) { + codePoints[_i] = arguments[_i]; + } + var elements = ""; + var length = codePoints.length; + var i2 = 0; + var code; + while (length > i2) { + code = codePoints[i2++]; + if (code > 1114111) + throw RangeError(code + " is not a valid code point"); + elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320); + } + return elements; + }; + var fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries2(entries) { + var obj = {}; + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { + var _a2 = entries_1[_i], k2 = _a2[0], v2 = _a2[1]; + obj[k2] = v2; + } + return obj; + }; + var codePointAt = hasNativeCodePointAt ? function codePointAt2(s2, index2) { + return s2.codePointAt(index2); + } : function codePointAt3(s2, index2) { + var size = s2.length; + if (index2 < 0 || index2 >= size) { + return void 0; + } + var first = s2.charCodeAt(index2); + var second; + return first < 55296 || first > 56319 || index2 + 1 === size || (second = s2.charCodeAt(index2 + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536; + }; + var trimStart = hasTrimStart ? function trimStart2(s2) { + return s2.trimStart(); + } : function trimStart3(s2) { + return s2.replace(SPACE_SEPARATOR_START_REGEX, ""); + }; + var trimEnd = hasTrimEnd ? function trimEnd2(s2) { + return s2.trimEnd(); + } : function trimEnd3(s2) { + return s2.replace(SPACE_SEPARATOR_END_REGEX, ""); + }; + function RE(s2, flag) { + return new RegExp(s2, flag); + } + var matchIdentifierAtIndex; + if (REGEX_SUPPORTS_U_AND_Y) { + IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + matchIdentifierAtIndex = function matchIdentifierAtIndex2(s2, index2) { + var _a2; + IDENTIFIER_PREFIX_RE_1.lastIndex = index2; + var match = IDENTIFIER_PREFIX_RE_1.exec(s2); + return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : ""; + }; + } else { + matchIdentifierAtIndex = function matchIdentifierAtIndex2(s2, index2) { + var match = []; + while (true) { + var c2 = codePointAt(s2, index2); + if (c2 === void 0 || _isWhiteSpace(c2) || _isPatternSyntax(c2)) { + break; + } + match.push(c2); + index2 += c2 >= 65536 ? 2 : 1; + } + return fromCodePoint.apply(void 0, match); + }; + } + var IDENTIFIER_PREFIX_RE_1; + var Parser = function() { + function Parser2(message, options) { + if (options === void 0) { + options = {}; + } + this.message = message; + this.position = { offset: 0, line: 1, column: 1 }; + this.ignoreTag = !!options.ignoreTag; + this.locale = options.locale; + this.requiresOtherClause = !!options.requiresOtherClause; + this.shouldParseSkeletons = !!options.shouldParseSkeletons; + } + Parser2.prototype.parse = function() { + if (this.offset() !== 0) { + throw Error("parser can only be used once"); + } + return this.parseMessage(0, "", false); + }; + Parser2.prototype.parseMessage = function(nestingLevel, parentArgType, expectingCloseTag) { + var elements = []; + while (!this.isEOF()) { + var char = this.char(); + if (char === 123) { + var result = this.parseArgument(nestingLevel, expectingCloseTag); + if (result.err) { + return result; + } + elements.push(result.val); + } else if (char === 125 && nestingLevel > 0) { + break; + } else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { + var position = this.clonePosition(); + this.bump(); + elements.push({ + type: TYPE.pound, + location: createLocation(position, this.clonePosition()) + }); + } else if (char === 60 && !this.ignoreTag && this.peek() === 47) { + if (expectingCloseTag) { + break; + } else { + return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition())); + } + } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { + var result = this.parseTag(nestingLevel, parentArgType); + if (result.err) { + return result; + } + elements.push(result.val); + } else { + var result = this.parseLiteral(nestingLevel, parentArgType); + if (result.err) { + return result; + } + elements.push(result.val); + } + } + return { val: elements, err: null }; + }; + Parser2.prototype.parseTag = function(nestingLevel, parentArgType) { + var startPosition = this.clonePosition(); + this.bump(); + var tagName = this.parseTagName(); + this.bumpSpace(); + if (this.bumpIf("/>")) { + return { + val: { + type: TYPE.literal, + value: "<".concat(tagName, "/>"), + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + } else if (this.bumpIf(">")) { + var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); + if (childrenResult.err) { + return childrenResult; + } + var children = childrenResult.val; + var endTagStartPosition = this.clonePosition(); + if (this.bumpIf("")) { + return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition())); + } + return { + val: { + type: TYPE.tag, + value: tagName, + children, + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + } else { + return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition())); + } + } else { + return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition())); + } + }; + Parser2.prototype.parseTagName = function() { + var startOffset = this.offset(); + this.bump(); + while (!this.isEOF() && _isPotentialElementNameChar(this.char())) { + this.bump(); + } + return this.message.slice(startOffset, this.offset()); + }; + Parser2.prototype.parseLiteral = function(nestingLevel, parentArgType) { + var start2 = this.clonePosition(); + var value = ""; + while (true) { + var parseQuoteResult = this.tryParseQuote(parentArgType); + if (parseQuoteResult) { + value += parseQuoteResult; + continue; + } + var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); + if (parseUnquotedResult) { + value += parseUnquotedResult; + continue; + } + var parseLeftAngleResult = this.tryParseLeftAngleBracket(); + if (parseLeftAngleResult) { + value += parseLeftAngleResult; + continue; + } + break; + } + var location = createLocation(start2, this.clonePosition()); + return { + val: { type: TYPE.literal, value, location }, + err: null + }; + }; + Parser2.prototype.tryParseLeftAngleBracket = function() { + if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) { + this.bump(); + return "<"; + } + return null; + }; + Parser2.prototype.tryParseQuote = function(parentArgType) { + if (this.isEOF() || this.char() !== 39) { + return null; + } + switch (this.peek()) { + case 39: + this.bump(); + this.bump(); + return "'"; + case 123: + case 60: + case 62: + case 125: + break; + case 35: + if (parentArgType === "plural" || parentArgType === "selectordinal") { + break; + } + return null; + default: + return null; + } + this.bump(); + var codePoints = [this.char()]; + this.bump(); + while (!this.isEOF()) { + var ch = this.char(); + if (ch === 39) { + if (this.peek() === 39) { + codePoints.push(39); + this.bump(); + } else { + this.bump(); + break; + } + } else { + codePoints.push(ch); + } + this.bump(); + } + return fromCodePoint.apply(void 0, codePoints); + }; + Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) { + if (this.isEOF()) { + return null; + } + var ch = this.char(); + if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) { + return null; + } else { + this.bump(); + return fromCodePoint(ch); + } + }; + Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) { + var openingBracePosition = this.clonePosition(); + this.bump(); + this.bumpSpace(); + if (this.isEOF()) { + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); + } + if (this.char() === 125) { + this.bump(); + return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); + } + var value = this.parseIdentifierIfPossible().value; + if (!value) { + return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); + } + this.bumpSpace(); + if (this.isEOF()) { + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); + } + switch (this.char()) { + case 125: { + this.bump(); + return { + val: { + type: TYPE.argument, + value, + location: createLocation(openingBracePosition, this.clonePosition()) + }, + err: null + }; + } + case 44: { + this.bump(); + this.bumpSpace(); + if (this.isEOF()) { + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); + } + return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); + } + default: + return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); + } + }; + Parser2.prototype.parseIdentifierIfPossible = function() { + var startingPosition = this.clonePosition(); + var startOffset = this.offset(); + var value = matchIdentifierAtIndex(this.message, startOffset); + var endOffset = startOffset + value.length; + this.bumpTo(endOffset); + var endPosition = this.clonePosition(); + var location = createLocation(startingPosition, endPosition); + return { value, location }; + }; + Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) { + var _a2; + var typeStartPosition = this.clonePosition(); + var argType = this.parseIdentifierIfPossible().value; + var typeEndPosition = this.clonePosition(); + switch (argType) { + case "": + return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); + case "number": + case "date": + case "time": { + this.bumpSpace(); + var styleAndLocation = null; + if (this.bumpIf(",")) { + this.bumpSpace(); + var styleStartPosition = this.clonePosition(); + var result = this.parseSimpleArgStyleIfPossible(); + if (result.err) { + return result; + } + var style = trimEnd(result.val); + if (style.length === 0) { + return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition())); + } + var styleLocation = createLocation(styleStartPosition, this.clonePosition()); + styleAndLocation = { style, styleLocation }; + } + var argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) { + return argCloseResult; + } + var location_1 = createLocation(openingBracePosition, this.clonePosition()); + if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, "::", 0)) { + var skeleton = trimStart(styleAndLocation.style.slice(2)); + if (argType === "number") { + var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); + if (result.err) { + return result; + } + return { + val: { type: TYPE.number, value, location: location_1, style: result.val }, + err: null + }; + } else { + if (skeleton.length === 0) { + return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1); + } + var dateTimePattern = skeleton; + if (this.locale) { + dateTimePattern = getBestPattern(skeleton, this.locale); + } + var style = { + type: SKELETON_TYPE.dateTime, + pattern: dateTimePattern, + location: styleAndLocation.styleLocation, + parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} + }; + var type = argType === "date" ? TYPE.date : TYPE.time; + return { + val: { type, value, location: location_1, style }, + err: null + }; + } + } + return { + val: { + type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time, + value, + location: location_1, + style: (_a2 = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a2 !== void 0 ? _a2 : null + }, + err: null + }; + } + case "plural": + case "selectordinal": + case "select": { + var typeEndPosition_1 = this.clonePosition(); + this.bumpSpace(); + if (!this.bumpIf(",")) { + return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1))); + } + this.bumpSpace(); + var identifierAndLocation = this.parseIdentifierIfPossible(); + var pluralOffset = 0; + if (argType !== "select" && identifierAndLocation.value === "offset") { + if (!this.bumpIf(":")) { + return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition())); + } + this.bumpSpace(); + var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); + if (result.err) { + return result; + } + this.bumpSpace(); + identifierAndLocation = this.parseIdentifierIfPossible(); + pluralOffset = result.val; + } + var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); + if (optionsResult.err) { + return optionsResult; + } + var argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) { + return argCloseResult; + } + var location_2 = createLocation(openingBracePosition, this.clonePosition()); + if (argType === "select") { + return { + val: { + type: TYPE.select, + value, + options: fromEntries(optionsResult.val), + location: location_2 + }, + err: null + }; + } else { + return { + val: { + type: TYPE.plural, + value, + options: fromEntries(optionsResult.val), + offset: pluralOffset, + pluralType: argType === "plural" ? "cardinal" : "ordinal", + location: location_2 + }, + err: null + }; + } + } + default: + return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); + } + }; + Parser2.prototype.tryParseArgumentClose = function(openingBracePosition) { + if (this.isEOF() || this.char() !== 125) { + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); + } + this.bump(); + return { val: true, err: null }; + }; + Parser2.prototype.parseSimpleArgStyleIfPossible = function() { + var nestedBraces = 0; + var startPosition = this.clonePosition(); + while (!this.isEOF()) { + var ch = this.char(); + switch (ch) { + case 39: { + this.bump(); + var apostrophePosition = this.clonePosition(); + if (!this.bumpUntil("'")) { + return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition())); + } + this.bump(); + break; + } + case 123: { + nestedBraces += 1; + this.bump(); + break; + } + case 125: { + if (nestedBraces > 0) { + nestedBraces -= 1; + } else { + return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + } + break; + } + default: + this.bump(); + break; + } + } + return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + }; + Parser2.prototype.parseNumberSkeletonFromString = function(skeleton, location) { + var tokens = []; + try { + tokens = parseNumberSkeletonFromString(skeleton); + } catch (e2) { + return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location); + } + return { + val: { + type: SKELETON_TYPE.number, + tokens, + location, + parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} + }, + err: null + }; + }; + Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { + var _a2; + var hasOtherClause = false; + var options = []; + var parsedSelectors = /* @__PURE__ */ new Set(); + var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location; + while (true) { + if (selector.length === 0) { + var startPosition = this.clonePosition(); + if (parentArgType !== "select" && this.bumpIf("=")) { + var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR); + if (result.err) { + return result; + } + selectorLocation = createLocation(startPosition, this.clonePosition()); + selector = this.message.slice(startPosition.offset, this.offset()); + } else { + break; + } + } + if (parsedSelectors.has(selector)) { + return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation); + } + if (selector === "other") { + hasOtherClause = true; + } + this.bumpSpace(); + var openingBracePosition = this.clonePosition(); + if (!this.bumpIf("{")) { + return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); + } + var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); + if (fragmentResult.err) { + return fragmentResult; + } + var argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) { + return argCloseResult; + } + options.push([ + selector, + { + value: fragmentResult.val, + location: createLocation(openingBracePosition, this.clonePosition()) + } + ]); + parsedSelectors.add(selector); + this.bumpSpace(); + _a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location; + } + if (options.length === 0) { + return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())); + } + if (this.requiresOtherClause && !hasOtherClause) { + return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())); + } + return { val: options, err: null }; + }; + Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) { + var sign = 1; + var startingPosition = this.clonePosition(); + if (this.bumpIf("+")) { + } else if (this.bumpIf("-")) { + sign = -1; + } + var hasDigits = false; + var decimal = 0; + while (!this.isEOF()) { + var ch = this.char(); + if (ch >= 48 && ch <= 57) { + hasDigits = true; + decimal = decimal * 10 + (ch - 48); + this.bump(); + } else { + break; + } + } + var location = createLocation(startingPosition, this.clonePosition()); + if (!hasDigits) { + return this.error(expectNumberError, location); + } + decimal *= sign; + if (!isSafeInteger(decimal)) { + return this.error(invalidNumberError, location); + } + return { val: decimal, err: null }; + }; + Parser2.prototype.offset = function() { + return this.position.offset; + }; + Parser2.prototype.isEOF = function() { + return this.offset() === this.message.length; + }; + Parser2.prototype.clonePosition = function() { + return { + offset: this.position.offset, + line: this.position.line, + column: this.position.column + }; + }; + Parser2.prototype.char = function() { + var offset2 = this.position.offset; + if (offset2 >= this.message.length) { + throw Error("out of bound"); + } + var code = codePointAt(this.message, offset2); + if (code === void 0) { + throw Error("Offset ".concat(offset2, " is at invalid UTF-16 code unit boundary")); + } + return code; + }; + Parser2.prototype.error = function(kind, location) { + return { + val: null, + err: { + kind, + message: this.message, + location + } + }; + }; + Parser2.prototype.bump = function() { + if (this.isEOF()) { + return; + } + var code = this.char(); + if (code === 10) { + this.position.line += 1; + this.position.column = 1; + this.position.offset += 1; + } else { + this.position.column += 1; + this.position.offset += code < 65536 ? 1 : 2; + } + }; + Parser2.prototype.bumpIf = function(prefix) { + if (startsWith(this.message, prefix, this.offset())) { + for (var i2 = 0; i2 < prefix.length; i2++) { + this.bump(); + } + return true; + } + return false; + }; + Parser2.prototype.bumpUntil = function(pattern) { + var currentOffset = this.offset(); + var index2 = this.message.indexOf(pattern, currentOffset); + if (index2 >= 0) { + this.bumpTo(index2); + return true; + } else { + this.bumpTo(this.message.length); + return false; + } + }; + Parser2.prototype.bumpTo = function(targetOffset) { + if (this.offset() > targetOffset) { + throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset())); + } + targetOffset = Math.min(targetOffset, this.message.length); + while (true) { + var offset2 = this.offset(); + if (offset2 === targetOffset) { + break; + } + if (offset2 > targetOffset) { + throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary")); + } + this.bump(); + if (this.isEOF()) { + break; + } + } + }; + Parser2.prototype.bumpSpace = function() { + while (!this.isEOF() && _isWhiteSpace(this.char())) { + this.bump(); + } + }; + Parser2.prototype.peek = function() { + if (this.isEOF()) { + return null; + } + var code = this.char(); + var offset2 = this.offset(); + var nextCode = this.message.charCodeAt(offset2 + (code >= 65536 ? 2 : 1)); + return nextCode !== null && nextCode !== void 0 ? nextCode : null; + }; + return Parser2; + }(); + function _isAlpha(codepoint) { + return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; + } + function _isAlphaOrSlash(codepoint) { + return _isAlpha(codepoint) || codepoint === 47; + } + function _isPotentialElementNameChar(c2) { + return c2 === 45 || c2 === 46 || c2 >= 48 && c2 <= 57 || c2 === 95 || c2 >= 97 && c2 <= 122 || c2 >= 65 && c2 <= 90 || c2 == 183 || c2 >= 192 && c2 <= 214 || c2 >= 216 && c2 <= 246 || c2 >= 248 && c2 <= 893 || c2 >= 895 && c2 <= 8191 || c2 >= 8204 && c2 <= 8205 || c2 >= 8255 && c2 <= 8256 || c2 >= 8304 && c2 <= 8591 || c2 >= 11264 && c2 <= 12271 || c2 >= 12289 && c2 <= 55295 || c2 >= 63744 && c2 <= 64975 || c2 >= 65008 && c2 <= 65533 || c2 >= 65536 && c2 <= 983039; + } + function _isWhiteSpace(c2) { + return c2 >= 9 && c2 <= 13 || c2 === 32 || c2 === 133 || c2 >= 8206 && c2 <= 8207 || c2 === 8232 || c2 === 8233; + } + function _isPatternSyntax(c2) { + return c2 >= 33 && c2 <= 35 || c2 === 36 || c2 >= 37 && c2 <= 39 || c2 === 40 || c2 === 41 || c2 === 42 || c2 === 43 || c2 === 44 || c2 === 45 || c2 >= 46 && c2 <= 47 || c2 >= 58 && c2 <= 59 || c2 >= 60 && c2 <= 62 || c2 >= 63 && c2 <= 64 || c2 === 91 || c2 === 92 || c2 === 93 || c2 === 94 || c2 === 96 || c2 === 123 || c2 === 124 || c2 === 125 || c2 === 126 || c2 === 161 || c2 >= 162 && c2 <= 165 || c2 === 166 || c2 === 167 || c2 === 169 || c2 === 171 || c2 === 172 || c2 === 174 || c2 === 176 || c2 === 177 || c2 === 182 || c2 === 187 || c2 === 191 || c2 === 215 || c2 === 247 || c2 >= 8208 && c2 <= 8213 || c2 >= 8214 && c2 <= 8215 || c2 === 8216 || c2 === 8217 || c2 === 8218 || c2 >= 8219 && c2 <= 8220 || c2 === 8221 || c2 === 8222 || c2 === 8223 || c2 >= 8224 && c2 <= 8231 || c2 >= 8240 && c2 <= 8248 || c2 === 8249 || c2 === 8250 || c2 >= 8251 && c2 <= 8254 || c2 >= 8257 && c2 <= 8259 || c2 === 8260 || c2 === 8261 || c2 === 8262 || c2 >= 8263 && c2 <= 8273 || c2 === 8274 || c2 === 8275 || c2 >= 8277 && c2 <= 8286 || c2 >= 8592 && c2 <= 8596 || c2 >= 8597 && c2 <= 8601 || c2 >= 8602 && c2 <= 8603 || c2 >= 8604 && c2 <= 8607 || c2 === 8608 || c2 >= 8609 && c2 <= 8610 || c2 === 8611 || c2 >= 8612 && c2 <= 8613 || c2 === 8614 || c2 >= 8615 && c2 <= 8621 || c2 === 8622 || c2 >= 8623 && c2 <= 8653 || c2 >= 8654 && c2 <= 8655 || c2 >= 8656 && c2 <= 8657 || c2 === 8658 || c2 === 8659 || c2 === 8660 || c2 >= 8661 && c2 <= 8691 || c2 >= 8692 && c2 <= 8959 || c2 >= 8960 && c2 <= 8967 || c2 === 8968 || c2 === 8969 || c2 === 8970 || c2 === 8971 || c2 >= 8972 && c2 <= 8991 || c2 >= 8992 && c2 <= 8993 || c2 >= 8994 && c2 <= 9e3 || c2 === 9001 || c2 === 9002 || c2 >= 9003 && c2 <= 9083 || c2 === 9084 || c2 >= 9085 && c2 <= 9114 || c2 >= 9115 && c2 <= 9139 || c2 >= 9140 && c2 <= 9179 || c2 >= 9180 && c2 <= 9185 || c2 >= 9186 && c2 <= 9254 || c2 >= 9255 && c2 <= 9279 || c2 >= 9280 && c2 <= 9290 || c2 >= 9291 && c2 <= 9311 || c2 >= 9472 && c2 <= 9654 || c2 === 9655 || c2 >= 9656 && c2 <= 9664 || c2 === 9665 || c2 >= 9666 && c2 <= 9719 || c2 >= 9720 && c2 <= 9727 || c2 >= 9728 && c2 <= 9838 || c2 === 9839 || c2 >= 9840 && c2 <= 10087 || c2 === 10088 || c2 === 10089 || c2 === 10090 || c2 === 10091 || c2 === 10092 || c2 === 10093 || c2 === 10094 || c2 === 10095 || c2 === 10096 || c2 === 10097 || c2 === 10098 || c2 === 10099 || c2 === 10100 || c2 === 10101 || c2 >= 10132 && c2 <= 10175 || c2 >= 10176 && c2 <= 10180 || c2 === 10181 || c2 === 10182 || c2 >= 10183 && c2 <= 10213 || c2 === 10214 || c2 === 10215 || c2 === 10216 || c2 === 10217 || c2 === 10218 || c2 === 10219 || c2 === 10220 || c2 === 10221 || c2 === 10222 || c2 === 10223 || c2 >= 10224 && c2 <= 10239 || c2 >= 10240 && c2 <= 10495 || c2 >= 10496 && c2 <= 10626 || c2 === 10627 || c2 === 10628 || c2 === 10629 || c2 === 10630 || c2 === 10631 || c2 === 10632 || c2 === 10633 || c2 === 10634 || c2 === 10635 || c2 === 10636 || c2 === 10637 || c2 === 10638 || c2 === 10639 || c2 === 10640 || c2 === 10641 || c2 === 10642 || c2 === 10643 || c2 === 10644 || c2 === 10645 || c2 === 10646 || c2 === 10647 || c2 === 10648 || c2 >= 10649 && c2 <= 10711 || c2 === 10712 || c2 === 10713 || c2 === 10714 || c2 === 10715 || c2 >= 10716 && c2 <= 10747 || c2 === 10748 || c2 === 10749 || c2 >= 10750 && c2 <= 11007 || c2 >= 11008 && c2 <= 11055 || c2 >= 11056 && c2 <= 11076 || c2 >= 11077 && c2 <= 11078 || c2 >= 11079 && c2 <= 11084 || c2 >= 11085 && c2 <= 11123 || c2 >= 11124 && c2 <= 11125 || c2 >= 11126 && c2 <= 11157 || c2 === 11158 || c2 >= 11159 && c2 <= 11263 || c2 >= 11776 && c2 <= 11777 || c2 === 11778 || c2 === 11779 || c2 === 11780 || c2 === 11781 || c2 >= 11782 && c2 <= 11784 || c2 === 11785 || c2 === 11786 || c2 === 11787 || c2 === 11788 || c2 === 11789 || c2 >= 11790 && c2 <= 11798 || c2 === 11799 || c2 >= 11800 && c2 <= 11801 || c2 === 11802 || c2 === 11803 || c2 === 11804 || c2 === 11805 || c2 >= 11806 && c2 <= 11807 || c2 === 11808 || c2 === 11809 || c2 === 11810 || c2 === 11811 || c2 === 11812 || c2 === 11813 || c2 === 11814 || c2 === 11815 || c2 === 11816 || c2 === 11817 || c2 >= 11818 && c2 <= 11822 || c2 === 11823 || c2 >= 11824 && c2 <= 11833 || c2 >= 11834 && c2 <= 11835 || c2 >= 11836 && c2 <= 11839 || c2 === 11840 || c2 === 11841 || c2 === 11842 || c2 >= 11843 && c2 <= 11855 || c2 >= 11856 && c2 <= 11857 || c2 === 11858 || c2 >= 11859 && c2 <= 11903 || c2 >= 12289 && c2 <= 12291 || c2 === 12296 || c2 === 12297 || c2 === 12298 || c2 === 12299 || c2 === 12300 || c2 === 12301 || c2 === 12302 || c2 === 12303 || c2 === 12304 || c2 === 12305 || c2 >= 12306 && c2 <= 12307 || c2 === 12308 || c2 === 12309 || c2 === 12310 || c2 === 12311 || c2 === 12312 || c2 === 12313 || c2 === 12314 || c2 === 12315 || c2 === 12316 || c2 === 12317 || c2 >= 12318 && c2 <= 12319 || c2 === 12320 || c2 === 12336 || c2 === 64830 || c2 === 64831 || c2 >= 65093 && c2 <= 65094; + } + + // ../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js + function pruneLocation(els) { + els.forEach(function(el) { + delete el.location; + if (isSelectElement(el) || isPluralElement(el)) { + for (var k2 in el.options) { + delete el.options[k2].location; + pruneLocation(el.options[k2].value); + } + } else if (isNumberElement(el) && isNumberSkeleton(el.style)) { + delete el.style.location; + } else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) { + delete el.style.location; + } else if (isTagElement(el)) { + pruneLocation(el.children); + } + }); + } + function parse(message, opts) { + if (opts === void 0) { + opts = {}; + } + opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts); + var result = new Parser(message, opts).parse(); + if (result.err) { + var error = SyntaxError(ErrorKind[result.err.kind]); + error.location = result.err.location; + error.originalMessage = result.err.message; + throw error; + } + if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) { + pruneLocation(result.val); + } + return result.val; + } + + // ../../node_modules/@formatjs/fast-memoize/lib/index.js + function memoize(fn3, options) { + var cache = options && options.cache ? options.cache : cacheDefault; + var serializer = options && options.serializer ? options.serializer : serializerDefault; + var strategy = options && options.strategy ? options.strategy : strategyDefault; + return strategy(fn3, { + cache, + serializer + }); + } + function isPrimitive(value) { + return value == null || typeof value === "number" || typeof value === "boolean"; + } + function monadic(fn3, cache, serializer, arg) { + var cacheKey = isPrimitive(arg) ? arg : serializer(arg); + var computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn3.call(this, arg); + cache.set(cacheKey, computedValue); + } + return computedValue; + } + function variadic(fn3, cache, serializer) { + var args = Array.prototype.slice.call(arguments, 3); + var cacheKey = serializer(args); + var computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn3.apply(this, args); + cache.set(cacheKey, computedValue); + } + return computedValue; + } + function assemble(fn3, context, strategy, cache, serialize) { + return strategy.bind(context, fn3, cache, serialize); + } + function strategyDefault(fn3, options) { + var strategy = fn3.length === 1 ? monadic : variadic; + return assemble(fn3, this, strategy, options.cache.create(), options.serializer); + } + function strategyVariadic(fn3, options) { + return assemble(fn3, this, variadic, options.cache.create(), options.serializer); + } + function strategyMonadic(fn3, options) { + return assemble(fn3, this, monadic, options.cache.create(), options.serializer); + } + var serializerDefault = function() { + return JSON.stringify(arguments); + }; + function ObjectWithoutPrototypeCache() { + this.cache = /* @__PURE__ */ Object.create(null); + } + ObjectWithoutPrototypeCache.prototype.get = function(key) { + return this.cache[key]; + }; + ObjectWithoutPrototypeCache.prototype.set = function(key, value) { + this.cache[key] = value; + }; + var cacheDefault = { + create: function create() { + return new ObjectWithoutPrototypeCache(); + } + }; + var strategies = { + variadic: strategyVariadic, + monadic: strategyMonadic + }; + + // ../../node_modules/intl-messageformat/lib/src/error.js + var ErrorCode; + (function(ErrorCode2) { + ErrorCode2["MISSING_VALUE"] = "MISSING_VALUE"; + ErrorCode2["INVALID_VALUE"] = "INVALID_VALUE"; + ErrorCode2["MISSING_INTL_API"] = "MISSING_INTL_API"; + })(ErrorCode || (ErrorCode = {})); + var FormatError = function(_super) { + __extends(FormatError2, _super); + function FormatError2(msg, code, originalMessage) { + var _this = _super.call(this, msg) || this; + _this.code = code; + _this.originalMessage = originalMessage; + return _this; + } + FormatError2.prototype.toString = function() { + return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); + }; + return FormatError2; + }(Error); + var InvalidValueError = function(_super) { + __extends(InvalidValueError2, _super); + function InvalidValueError2(variableId, value, options, originalMessage) { + return _super.call(this, 'Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options).join('", "'), '"'), ErrorCode.INVALID_VALUE, originalMessage) || this; + } + return InvalidValueError2; + }(FormatError); + var InvalidValueTypeError = function(_super) { + __extends(InvalidValueTypeError2, _super); + function InvalidValueTypeError2(value, type, originalMessage) { + return _super.call(this, 'Value for "'.concat(value, '" must be of type ').concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this; + } + return InvalidValueTypeError2; + }(FormatError); + var MissingValueError = function(_super) { + __extends(MissingValueError2, _super); + function MissingValueError2(variableId, originalMessage) { + return _super.call(this, 'The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), ErrorCode.MISSING_VALUE, originalMessage) || this; + } + return MissingValueError2; + }(FormatError); + + // ../../node_modules/intl-messageformat/lib/src/formatters.js + var PART_TYPE; + (function(PART_TYPE2) { + PART_TYPE2[PART_TYPE2["literal"] = 0] = "literal"; + PART_TYPE2[PART_TYPE2["object"] = 1] = "object"; + })(PART_TYPE || (PART_TYPE = {})); + function mergeLiteral(parts) { + if (parts.length < 2) { + return parts; + } + return parts.reduce(function(all, part) { + var lastPart = all[all.length - 1]; + if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) { + all.push(part); + } else { + lastPart.value += part.value; + } + return all; + }, []); + } + function isFormatXMLElementFn(el) { + return typeof el === "function"; + } + function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { + if (els.length === 1 && isLiteralElement(els[0])) { + return [ + { + type: PART_TYPE.literal, + value: els[0].value + } + ]; + } + var result = []; + for (var _i = 0, els_1 = els; _i < els_1.length; _i++) { + var el = els_1[_i]; + if (isLiteralElement(el)) { + result.push({ + type: PART_TYPE.literal, + value: el.value + }); + continue; + } + if (isPoundElement(el)) { + if (typeof currentPluralValue === "number") { + result.push({ + type: PART_TYPE.literal, + value: formatters.getNumberFormat(locales).format(currentPluralValue) + }); + } + continue; + } + var varName = el.value; + if (!(values && varName in values)) { + throw new MissingValueError(varName, originalMessage); + } + var value = values[varName]; + if (isArgumentElement(el)) { + if (!value || typeof value === "string" || typeof value === "number") { + value = typeof value === "string" || typeof value === "number" ? String(value) : ""; + } + result.push({ + type: typeof value === "string" ? PART_TYPE.literal : PART_TYPE.object, + value + }); + continue; + } + if (isDateElement(el)) { + var style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; + result.push({ + type: PART_TYPE.literal, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isTimeElement(el)) { + var style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; + result.push({ + type: PART_TYPE.literal, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isNumberElement(el)) { + var style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; + if (style && style.scale) { + value = value * (style.scale || 1); + } + result.push({ + type: PART_TYPE.literal, + value: formatters.getNumberFormat(locales, style).format(value) + }); + continue; + } + if (isTagElement(el)) { + var children = el.children, value_1 = el.value; + var formatFn = values[value_1]; + if (!isFormatXMLElementFn(formatFn)) { + throw new InvalidValueTypeError(value_1, "function", originalMessage); + } + var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue); + var chunks = formatFn(parts.map(function(p2) { + return p2.value; + })); + if (!Array.isArray(chunks)) { + chunks = [chunks]; + } + result.push.apply(result, chunks.map(function(c2) { + return { + type: typeof c2 === "string" ? PART_TYPE.literal : PART_TYPE.object, + value: c2 + }; + })); + } + if (isSelectElement(el)) { + var opt = el.options[value] || el.options.other; + if (!opt) { + throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + } + result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values)); + continue; + } + if (isPluralElement(el)) { + var opt = el.options["=".concat(value)]; + if (!opt) { + if (!Intl.PluralRules) { + throw new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', ErrorCode.MISSING_INTL_API, originalMessage); + } + var rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0)); + opt = el.options[rule] || el.options.other; + } + if (!opt) { + throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + } + result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0))); + continue; + } + } + return mergeLiteral(result); + } + + // ../../node_modules/intl-messageformat/lib/src/core.js + function mergeConfig(c1, c2) { + if (!c2) { + return c1; + } + return __assign(__assign(__assign({}, c1 || {}), c2 || {}), Object.keys(c1).reduce(function(all, k2) { + all[k2] = __assign(__assign({}, c1[k2]), c2[k2] || {}); + return all; + }, {})); + } + function mergeConfigs(defaultConfig, configs) { + if (!configs) { + return defaultConfig; + } + return Object.keys(defaultConfig).reduce(function(all, k2) { + all[k2] = mergeConfig(defaultConfig[k2], configs[k2]); + return all; + }, __assign({}, defaultConfig)); + } + function createFastMemoizeCache(store) { + return { + create: function() { + return { + get: function(key) { + return store[key]; + }, + set: function(key, value) { + store[key] = value; + } + }; + } + }; + } + function createDefaultFormatters(cache) { + if (cache === void 0) { + cache = { + number: {}, + dateTime: {}, + pluralRules: {} + }; + } + return { + getNumberFormat: memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache(cache.number), + strategy: strategies.variadic + }), + getDateTimeFormat: memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache(cache.dateTime), + strategy: strategies.variadic + }), + getPluralRules: memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache(cache.pluralRules), + strategy: strategies.variadic + }) + }; + } + var IntlMessageFormat = function() { + function IntlMessageFormat2(message, locales, overrideFormats, opts) { + var _this = this; + if (locales === void 0) { + locales = IntlMessageFormat2.defaultLocale; + } + this.formatterCache = { + number: {}, + dateTime: {}, + pluralRules: {} + }; + this.format = function(values) { + var parts = _this.formatToParts(values); + if (parts.length === 1) { + return parts[0].value; + } + var result = parts.reduce(function(all, part) { + if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") { + all.push(part.value); + } else { + all[all.length - 1] += part.value; + } + return all; + }, []); + if (result.length <= 1) { + return result[0] || ""; + } + return result; + }; + this.formatToParts = function(values) { + return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message); + }; + this.resolvedOptions = function() { + var _a2; + return { + locale: ((_a2 = _this.resolvedLocale) === null || _a2 === void 0 ? void 0 : _a2.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0] + }; + }; + this.getAst = function() { + return _this.ast; + }; + this.locales = locales; + this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales); + if (typeof message === "string") { + this.message = message; + if (!IntlMessageFormat2.__parse) { + throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); + } + this.ast = IntlMessageFormat2.__parse(message, { + ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag, + locale: this.resolvedLocale + }); + } else { + this.ast = message; + } + if (!Array.isArray(this.ast)) { + throw new TypeError("A message must be provided as a String or AST."); + } + this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats); + this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); + } + Object.defineProperty(IntlMessageFormat2, "defaultLocale", { + get: function() { + if (!IntlMessageFormat2.memoizedDefaultLocale) { + IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; + } + return IntlMessageFormat2.memoizedDefaultLocale; + }, + enumerable: false, + configurable: true + }); + IntlMessageFormat2.memoizedDefaultLocale = null; + IntlMessageFormat2.resolveLocale = function(locales) { + if (typeof Intl.Locale === "undefined") { + return; + } + var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); + if (supportedLocales.length > 0) { + return new Intl.Locale(supportedLocales[0]); + } + return new Intl.Locale(typeof locales === "string" ? locales : locales[0]); + }; + IntlMessageFormat2.__parse = parse; + IntlMessageFormat2.formats = { + number: { + integer: { + maximumFractionDigits: 0 + }, + currency: { + style: "currency" + }, + percent: { + style: "percent" + } + }, + date: { + short: { + month: "numeric", + day: "numeric", + year: "2-digit" + }, + medium: { + month: "short", + day: "numeric", + year: "numeric" + }, + long: { + month: "long", + day: "numeric", + year: "numeric" + }, + full: { + weekday: "long", + month: "long", + day: "numeric", + year: "numeric" + } + }, + time: { + short: { + hour: "numeric", + minute: "numeric" + }, + medium: { + hour: "numeric", + minute: "numeric", + second: "numeric" + }, + long: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + }, + full: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + } + } + }; + return IntlMessageFormat2; + }(); + + // ../../node_modules/@formatjs/intl/lib/src/error.js + var IntlErrorCode; + (function(IntlErrorCode2) { + IntlErrorCode2["FORMAT_ERROR"] = "FORMAT_ERROR"; + IntlErrorCode2["UNSUPPORTED_FORMATTER"] = "UNSUPPORTED_FORMATTER"; + IntlErrorCode2["INVALID_CONFIG"] = "INVALID_CONFIG"; + IntlErrorCode2["MISSING_DATA"] = "MISSING_DATA"; + IntlErrorCode2["MISSING_TRANSLATION"] = "MISSING_TRANSLATION"; + })(IntlErrorCode || (IntlErrorCode = {})); + var IntlError = function(_super) { + __extends(IntlError2, _super); + function IntlError2(code, message, exception) { + var _this = this; + var err = exception ? exception instanceof Error ? exception : new Error(String(exception)) : void 0; + _this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, "\n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : "")) || this; + _this.code = code; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(_this, IntlError2); + } + return _this; + } + return IntlError2; + }(Error); + var UnsupportedFormatterError = function(_super) { + __extends(UnsupportedFormatterError2, _super); + function UnsupportedFormatterError2(message, exception) { + return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this; + } + return UnsupportedFormatterError2; + }(IntlError); + var InvalidConfigError = function(_super) { + __extends(InvalidConfigError2, _super); + function InvalidConfigError2(message, exception) { + return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this; + } + return InvalidConfigError2; + }(IntlError); + var MissingDataError = function(_super) { + __extends(MissingDataError2, _super); + function MissingDataError2(message, exception) { + return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this; + } + return MissingDataError2; + }(IntlError); + var IntlFormatError = function(_super) { + __extends(IntlFormatError2, _super); + function IntlFormatError2(message, locale2, exception) { + return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, "\nLocale: ").concat(locale2, "\n"), exception) || this; + } + return IntlFormatError2; + }(IntlError); + var MessageFormatError = function(_super) { + __extends(MessageFormatError2, _super); + function MessageFormatError2(message, locale2, descriptor, exception) { + var _this = _super.call(this, "".concat(message, "\nMessageID: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, "\nDefault Message: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, "\nDescription: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, "\n"), locale2, exception) || this; + _this.descriptor = descriptor; + return _this; + } + return MessageFormatError2; + }(IntlFormatError); + var MissingTranslationError = function(_super) { + __extends(MissingTranslationError2, _super); + function MissingTranslationError2(descriptor, locale2) { + var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, 'Missing message: "'.concat(descriptor.id, '" for locale "').concat(locale2, '", using ').concat(descriptor.defaultMessage ? "default message (".concat(typeof descriptor.defaultMessage === "string" ? descriptor.defaultMessage : descriptor.defaultMessage.map(function(e2) { + var _a2; + return (_a2 = e2.value) !== null && _a2 !== void 0 ? _a2 : JSON.stringify(e2); + }).join(), ")") : "id", " as fallback.")) || this; + _this.descriptor = descriptor; + return _this; + } + return MissingTranslationError2; + }(IntlError); + + // ../../node_modules/@formatjs/intl/lib/src/utils.js + function filterProps(props, allowlist, defaults) { + if (defaults === void 0) { + defaults = {}; + } + return allowlist.reduce(function(filtered, name) { + if (name in props) { + filtered[name] = props[name]; + } else if (name in defaults) { + filtered[name] = defaults[name]; + } + return filtered; + }, {}); + } + var defaultErrorHandler = function(error) { + if (true) { + console.error(error); + } + }; + var defaultWarnHandler = function(warning) { + if (true) { + console.warn(warning); + } + }; + var DEFAULT_INTL_CONFIG = { + formats: {}, + messages: {}, + timeZone: void 0, + defaultLocale: "en", + defaultFormats: {}, + fallbackOnEmptyString: true, + onError: defaultErrorHandler, + onWarn: defaultWarnHandler + }; + function createIntlCache() { + return { + dateTime: {}, + number: {}, + message: {}, + relativeTime: {}, + pluralRules: {}, + list: {}, + displayNames: {} + }; + } + function createFastMemoizeCache2(store) { + return { + create: function() { + return { + get: function(key) { + return store[key]; + }, + set: function(key, value) { + store[key] = value; + } + }; + } + }; + } + function createFormatters(cache) { + if (cache === void 0) { + cache = createIntlCache(); + } + var RelativeTimeFormat = Intl.RelativeTimeFormat; + var ListFormat = Intl.ListFormat; + var DisplayNames = Intl.DisplayNames; + var getDateTimeFormat = memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.dateTime), + strategy: strategies.variadic + }); + var getNumberFormat = memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.number), + strategy: strategies.variadic + }); + var getPluralRules = memoize(function() { + var _a2; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.pluralRules), + strategy: strategies.variadic + }); + return { + getDateTimeFormat, + getNumberFormat, + getMessageFormat: memoize(function(message, locales, overrideFormats, opts) { + return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: { + getNumberFormat, + getDateTimeFormat, + getPluralRules + } }, opts || {})); + }, { + cache: createFastMemoizeCache2(cache.message), + strategy: strategies.variadic + }), + getRelativeTimeFormat: memoize(function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.relativeTime), + strategy: strategies.variadic + }), + getPluralRules, + getListFormat: memoize(function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.list), + strategy: strategies.variadic + }), + getDisplayNames: memoize(function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))(); + }, { + cache: createFastMemoizeCache2(cache.displayNames), + strategy: strategies.variadic + }) + }; + } + function getNamedFormat(formats, type, name, onError) { + var formatType = formats && formats[type]; + var format2; + if (formatType) { + format2 = formatType[name]; + } + if (format2) { + return format2; + } + onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name))); + } + + // ../../node_modules/@formatjs/intl/lib/src/message.js + function setTimeZoneInOptions(opts, timeZone) { + return Object.keys(opts).reduce(function(all, k2) { + all[k2] = __assign({ timeZone }, opts[k2]); + return all; + }, {}); + } + function deepMergeOptions(opts1, opts2) { + var keys = Object.keys(__assign(__assign({}, opts1), opts2)); + return keys.reduce(function(all, k2) { + all[k2] = __assign(__assign({}, opts1[k2] || {}), opts2[k2] || {}); + return all; + }, {}); + } + function deepMergeFormatsAndSetTimeZone(f1, timeZone) { + if (!timeZone) { + return f1; + } + var mfFormats = IntlMessageFormat.formats; + return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) }); + } + var formatMessage = function(_a2, state, messageDescriptor, values, opts) { + var locale2 = _a2.locale, formats = _a2.formats, messages2 = _a2.messages, defaultLocale = _a2.defaultLocale, defaultFormats = _a2.defaultFormats, fallbackOnEmptyString = _a2.fallbackOnEmptyString, onError = _a2.onError, timeZone = _a2.timeZone, defaultRichTextElements = _a2.defaultRichTextElements; + if (messageDescriptor === void 0) { + messageDescriptor = { id: "" }; + } + var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage; + invariant(!!msgId, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue"); + var id = String(msgId); + var message = messages2 && Object.prototype.hasOwnProperty.call(messages2, id) && messages2[id]; + if (Array.isArray(message) && message.length === 1 && message[0].type === TYPE.literal) { + return message[0].value; + } + if (!values && message && typeof message === "string" && !defaultRichTextElements) { + return message.replace(/'\{(.*?)\}'/gi, "{$1}"); + } + values = __assign(__assign({}, defaultRichTextElements), values || {}); + formats = deepMergeFormatsAndSetTimeZone(formats, timeZone); + defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone); + if (!message) { + if (fallbackOnEmptyString === false && message === "") { + return message; + } + if (!defaultMessage || locale2 && locale2.toLowerCase() !== defaultLocale.toLowerCase()) { + onError(new MissingTranslationError(messageDescriptor, locale2)); + } + if (defaultMessage) { + try { + var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts); + return formatter.format(values); + } catch (e2) { + onError(new MessageFormatError('Error formatting default message for: "'.concat(id, '", rendering default message verbatim'), locale2, messageDescriptor, e2)); + return typeof defaultMessage === "string" ? defaultMessage : id; + } + } + return id; + } + try { + var formatter = state.getMessageFormat(message, locale2, formats, __assign({ formatters: state }, opts || {})); + return formatter.format(values); + } catch (e2) { + onError(new MessageFormatError('Error formatting message: "'.concat(id, '", using ').concat(defaultMessage ? "default message" : "id", " as fallback."), locale2, messageDescriptor, e2)); + } + if (defaultMessage) { + try { + var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts); + return formatter.format(values); + } catch (e2) { + onError(new MessageFormatError('Error formatting the default message for: "'.concat(id, '", rendering message verbatim'), locale2, messageDescriptor, e2)); + } + } + if (typeof message === "string") { + return message; + } + if (typeof defaultMessage === "string") { + return defaultMessage; + } + return id; + }; + + // ../../node_modules/@formatjs/intl/lib/src/dateTime.js + var DATE_TIME_FORMAT_OPTIONS = [ + "formatMatcher", + "timeZone", + "hour12", + "weekday", + "era", + "year", + "month", + "day", + "hour", + "minute", + "second", + "timeZoneName", + "hourCycle", + "dateStyle", + "timeStyle", + "calendar", + "numberingSystem", + "fractionalSecondDigits" + ]; + function getFormatter(_a2, type, getDateTimeFormat, options) { + var locale2 = _a2.locale, formats = _a2.formats, onError = _a2.onError, timeZone = _a2.timeZone; + if (options === void 0) { + options = {}; + } + var format2 = options.format; + var defaults = __assign(__assign({}, timeZone && { timeZone }), format2 && getNamedFormat(formats, type, format2, onError)); + var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults); + if (type === "time" && !filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second && !filteredOptions.timeStyle && !filteredOptions.dateStyle) { + filteredOptions = __assign(__assign({}, filteredOptions), { hour: "numeric", minute: "numeric" }); + } + return getDateTimeFormat(locale2, filteredOptions); + } + function formatDate(config, getDateTimeFormat) { + var _a2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + _a2[_i - 2] = arguments[_i]; + } + var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b; + var date = typeof value === "string" ? new Date(value || 0) : value; + try { + return getFormatter(config, "date", getDateTimeFormat, options).format(date); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting date.", e2)); + } + return String(date); + } + function formatTime(config, getDateTimeFormat) { + var _a2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + _a2[_i - 2] = arguments[_i]; + } + var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b; + var date = typeof value === "string" ? new Date(value || 0) : value; + try { + return getFormatter(config, "time", getDateTimeFormat, options).format(date); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting time.", e2)); + } + return String(date); + } + function formatDateTimeRange(config, getDateTimeFormat) { + var _a2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + _a2[_i - 2] = arguments[_i]; + } + var from = _a2[0], to = _a2[1], _b = _a2[2], options = _b === void 0 ? {} : _b; + var timeZone = config.timeZone, locale2 = config.locale, onError = config.onError; + var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone } : {}); + try { + return getDateTimeFormat(locale2, filteredOptions).formatRange(from, to); + } catch (e2) { + onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting date time range.", e2)); + } + return String(from); + } + function formatDateToParts(config, getDateTimeFormat) { + var _a2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + _a2[_i - 2] = arguments[_i]; + } + var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b; + var date = typeof value === "string" ? new Date(value || 0) : value; + try { + return getFormatter(config, "date", getDateTimeFormat, options).formatToParts(date); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting date.", e2)); + } + return []; + } + function formatTimeToParts(config, getDateTimeFormat) { + var _a2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + _a2[_i - 2] = arguments[_i]; + } + var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b; + var date = typeof value === "string" ? new Date(value || 0) : value; + try { + return getFormatter(config, "time", getDateTimeFormat, options).formatToParts(date); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting time.", e2)); + } + return []; + } + + // ../../node_modules/@formatjs/intl/lib/src/displayName.js + var DISPLAY_NAMES_OPTONS = [ + "style", + "type", + "fallback" + ]; + function formatDisplayName(_a2, getDisplayNames, value, options) { + var locale2 = _a2.locale, onError = _a2.onError; + var DisplayNames = Intl.DisplayNames; + if (!DisplayNames) { + onError(new FormatError('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n', ErrorCode.MISSING_INTL_API)); + } + var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS); + try { + return getDisplayNames(locale2, filteredOptions).of(value); + } catch (e2) { + onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting display name.", e2)); + } + } + + // ../../node_modules/@formatjs/intl/lib/src/list.js + var LIST_FORMAT_OPTIONS = [ + "type", + "style" + ]; + var now = Date.now(); + function generateToken(i2) { + return "".concat(now, "_").concat(i2, "_").concat(now); + } + function formatList(opts, getListFormat, values, options) { + if (options === void 0) { + options = {}; + } + var results = formatListToParts(opts, getListFormat, values, options).reduce(function(all, el) { + var val = el.value; + if (typeof val !== "string") { + all.push(val); + } else if (typeof all[all.length - 1] === "string") { + all[all.length - 1] += val; + } else { + all.push(val); + } + return all; + }, []); + return results.length === 1 ? results[0] : results; + } + function formatListToParts(_a2, getListFormat, values, options) { + var locale2 = _a2.locale, onError = _a2.onError; + if (options === void 0) { + options = {}; + } + var ListFormat = Intl.ListFormat; + if (!ListFormat) { + onError(new FormatError('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n', ErrorCode.MISSING_INTL_API)); + } + var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS); + try { + var richValues_1 = {}; + var serializedValues = values.map(function(v2, i2) { + if (typeof v2 === "object") { + var id = generateToken(i2); + richValues_1[id] = v2; + return id; + } + return String(v2); + }); + return getListFormat(locale2, filteredOptions).formatToParts(serializedValues).map(function(part) { + return part.type === "literal" ? part : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value }); + }); + } catch (e2) { + onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting list.", e2)); + } + return values; + } + + // ../../node_modules/@formatjs/intl/lib/src/plural.js + var PLURAL_FORMAT_OPTIONS = ["type"]; + function formatPlural(_a2, getPluralRules, value, options) { + var locale2 = _a2.locale, onError = _a2.onError; + if (options === void 0) { + options = {}; + } + if (!Intl.PluralRules) { + onError(new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', ErrorCode.MISSING_INTL_API)); + } + var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS); + try { + return getPluralRules(locale2, filteredOptions).select(value); + } catch (e2) { + onError(new IntlFormatError("Error formatting plural.", locale2, e2)); + } + return "other"; + } + + // ../../node_modules/@formatjs/intl/lib/src/relativeTime.js + var RELATIVE_TIME_FORMAT_OPTIONS = ["numeric", "style"]; + function getFormatter2(_a2, getRelativeTimeFormat, options) { + var locale2 = _a2.locale, formats = _a2.formats, onError = _a2.onError; + if (options === void 0) { + options = {}; + } + var format2 = options.format; + var defaults = !!format2 && getNamedFormat(formats, "relative", format2, onError) || {}; + var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults); + return getRelativeTimeFormat(locale2, filteredOptions); + } + function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) { + if (options === void 0) { + options = {}; + } + if (!unit) { + unit = "second"; + } + var RelativeTimeFormat = Intl.RelativeTimeFormat; + if (!RelativeTimeFormat) { + config.onError(new FormatError('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n', ErrorCode.MISSING_INTL_API)); + } + try { + return getFormatter2(config, getRelativeTimeFormat, options).format(value, unit); + } catch (e2) { + config.onError(new IntlFormatError("Error formatting relative time.", config.locale, e2)); + } + return String(value); + } + + // ../../node_modules/@formatjs/intl/lib/src/number.js + var NUMBER_FORMAT_OPTIONS = [ + "style", + "currency", + "currencyDisplay", + "unit", + "unitDisplay", + "useGrouping", + "minimumIntegerDigits", + "minimumFractionDigits", + "maximumFractionDigits", + "minimumSignificantDigits", + "maximumSignificantDigits", + "compactDisplay", + "currencyDisplay", + "currencySign", + "notation", + "signDisplay", + "unit", + "unitDisplay", + "numberingSystem" + ]; + function getFormatter3(_a2, getNumberFormat, options) { + var locale2 = _a2.locale, formats = _a2.formats, onError = _a2.onError; + if (options === void 0) { + options = {}; + } + var format2 = options.format; + var defaults = format2 && getNamedFormat(formats, "number", format2, onError) || {}; + var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults); + return getNumberFormat(locale2, filteredOptions); + } + function formatNumber(config, getNumberFormat, value, options) { + if (options === void 0) { + options = {}; + } + try { + return getFormatter3(config, getNumberFormat, options).format(value); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting number.", e2)); + } + return String(value); + } + function formatNumberToParts(config, getNumberFormat, value, options) { + if (options === void 0) { + options = {}; + } + try { + return getFormatter3(config, getNumberFormat, options).formatToParts(value); + } catch (e2) { + config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, "Error formatting number.", e2)); + } + return []; + } + + // ../../node_modules/@formatjs/intl/lib/src/create-intl.js + function messagesContainString(messages2) { + var firstMessage = messages2 ? messages2[Object.keys(messages2)[0]] : void 0; + return typeof firstMessage === "string"; + } + function verifyConfigMessages(config) { + if (config.onWarn && config.defaultRichTextElements && messagesContainString(config.messages || {})) { + config.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution'); + } + } + function createIntl(config, cache) { + var formatters = createFormatters(cache); + var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config); + var locale2 = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError; + if (!locale2) { + if (onError) { + onError(new InvalidConfigError('"locale" was not configured, using "'.concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))); + } + resolvedConfig.locale = resolvedConfig.defaultLocale || "en"; + } else if (!Intl.NumberFormat.supportedLocalesOf(locale2).length && onError) { + onError(new MissingDataError('Missing locale data for locale: "'.concat(locale2, '" in Intl.NumberFormat. Using default locale: "').concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))); + } else if (!Intl.DateTimeFormat.supportedLocalesOf(locale2).length && onError) { + onError(new MissingDataError('Missing locale data for locale: "'.concat(locale2, '" in Intl.DateTimeFormat. Using default locale: "').concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))); + } + verifyConfigMessages(resolvedConfig); + return __assign(__assign({}, resolvedConfig), { formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) }); + } + + // ../../node_modules/react-intl/lib/src/utils.js + function invariantIntlContext(intl) { + invariant(intl, "[React Intl] Could not find required `intl` object. needs to exist in the component ancestry."); + } + var DEFAULT_INTL_CONFIG2 = __assign(__assign({}, DEFAULT_INTL_CONFIG), { textComponent: React2.Fragment }); + function assignUniqueKeysToParts(formatXMLElementFn) { + return function(parts) { + return formatXMLElementFn(React2.Children.toArray(parts)); + }; + } + function shallowEqual(objA, objB) { + if (objA === objB) { + return true; + } + if (!objA || !objB) { + return false; + } + var aKeys = Object.keys(objA); + var bKeys = Object.keys(objB); + var len = aKeys.length; + if (bKeys.length !== len) { + return false; + } + for (var i2 = 0; i2 < len; i2++) { + var key = aKeys[i2]; + if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) { + return false; + } + } + return true; + } + + // ../../node_modules/react-intl/lib/src/components/injectIntl.js + var IntlContext = React3.createContext(null); + var IntlConsumer = IntlContext.Consumer; + var IntlProvider = IntlContext.Provider; + var Provider = IntlProvider; + var Context = IntlContext; + + // ../../node_modules/react-intl/lib/src/components/useIntl.js + function useIntl() { + var intl = React4.useContext(Context); + invariantIntlContext(intl); + return intl; + } + + // ../../node_modules/react-intl/lib/src/components/createFormattedComponent.js + var DisplayName; + (function(DisplayName2) { + DisplayName2["formatDate"] = "FormattedDate"; + DisplayName2["formatTime"] = "FormattedTime"; + DisplayName2["formatNumber"] = "FormattedNumber"; + DisplayName2["formatList"] = "FormattedList"; + DisplayName2["formatDisplayName"] = "FormattedDisplayName"; + })(DisplayName || (DisplayName = {})); + var DisplayNameParts; + (function(DisplayNameParts2) { + DisplayNameParts2["formatDate"] = "FormattedDateParts"; + DisplayNameParts2["formatTime"] = "FormattedTimeParts"; + DisplayNameParts2["formatNumber"] = "FormattedNumberParts"; + DisplayNameParts2["formatList"] = "FormattedListParts"; + })(DisplayNameParts || (DisplayNameParts = {})); + var FormattedNumberParts = function(props) { + var intl = useIntl(); + var value = props.value, children = props.children, formatProps = __rest(props, ["value", "children"]); + return children(intl.formatNumberToParts(value, formatProps)); + }; + FormattedNumberParts.displayName = "FormattedNumberParts"; + FormattedNumberParts.displayName = "FormattedNumberParts"; + function createFormattedDateTimePartsComponent(name) { + var ComponentParts = function(props) { + var intl = useIntl(); + var value = props.value, children = props.children, formatProps = __rest(props, ["value", "children"]); + var date = typeof value === "string" ? new Date(value || 0) : value; + var formattedParts = name === "formatDate" ? intl.formatDateToParts(date, formatProps) : intl.formatTimeToParts(date, formatProps); + return children(formattedParts); + }; + ComponentParts.displayName = DisplayNameParts[name]; + return ComponentParts; + } + function createFormattedComponent(name) { + var Component2 = function(props) { + var intl = useIntl(); + var value = props.value, children = props.children, formatProps = __rest( + props, + ["value", "children"] + ); + var formattedValue = intl[name](value, formatProps); + if (typeof children === "function") { + return children(formattedValue); + } + var Text = intl.textComponent || React5.Fragment; + return React5.createElement(Text, null, formattedValue); + }; + Component2.displayName = DisplayName[name]; + return Component2; + } + + // ../../node_modules/react-intl/lib/src/components/provider.js + var React6 = __toESM(require_react()); + function processIntlConfig(config) { + return { + locale: config.locale, + timeZone: config.timeZone, + fallbackOnEmptyString: config.fallbackOnEmptyString, + formats: config.formats, + textComponent: config.textComponent, + messages: config.messages, + defaultLocale: config.defaultLocale, + defaultFormats: config.defaultFormats, + onError: config.onError, + onWarn: config.onWarn, + wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment, + defaultRichTextElements: config.defaultRichTextElements + }; + } + function assignUniqueKeysToFormatXMLElementFnArgument(values) { + if (!values) { + return values; + } + return Object.keys(values).reduce(function(acc, k2) { + var v2 = values[k2]; + acc[k2] = isFormatXMLElementFn(v2) ? assignUniqueKeysToParts(v2) : v2; + return acc; + }, {}); + } + var formatMessage2 = function(config, formatters, descriptor, rawValues) { + var rest = []; + for (var _i = 4; _i < arguments.length; _i++) { + rest[_i - 4] = arguments[_i]; + } + var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues); + var chunks = formatMessage.apply(void 0, __spreadArray([ + config, + formatters, + descriptor, + values + ], rest, false)); + if (Array.isArray(chunks)) { + return React6.Children.toArray(chunks); + } + return chunks; + }; + var createIntl2 = function(_a2, cache) { + var rawDefaultRichTextElements = _a2.defaultRichTextElements, config = __rest(_a2, ["defaultRichTextElements"]); + var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements); + var coreIntl = createIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG2), config), { defaultRichTextElements }), cache); + var resolvedConfig = { + locale: coreIntl.locale, + timeZone: coreIntl.timeZone, + fallbackOnEmptyString: coreIntl.fallbackOnEmptyString, + formats: coreIntl.formats, + defaultLocale: coreIntl.defaultLocale, + defaultFormats: coreIntl.defaultFormats, + messages: coreIntl.messages, + onError: coreIntl.onError, + defaultRichTextElements + }; + return __assign(__assign({}, coreIntl), { formatMessage: formatMessage2.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage2.bind(null, resolvedConfig, coreIntl.formatters) }); + }; + var IntlProvider2 = function(_super) { + __extends(IntlProvider3, _super); + function IntlProvider3() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.cache = createIntlCache(); + _this.state = { + cache: _this.cache, + intl: createIntl2(processIntlConfig(_this.props), _this.cache), + prevConfig: processIntlConfig(_this.props) + }; + return _this; + } + IntlProvider3.getDerivedStateFromProps = function(props, _a2) { + var prevConfig = _a2.prevConfig, cache = _a2.cache; + var config = processIntlConfig(props); + if (!shallowEqual(prevConfig, config)) { + return { + intl: createIntl2(config, cache), + prevConfig: config + }; + } + return null; + }; + IntlProvider3.prototype.render = function() { + invariantIntlContext(this.state.intl); + return React6.createElement(Provider, { value: this.state.intl }, this.props.children); + }; + IntlProvider3.displayName = "IntlProvider"; + IntlProvider3.defaultProps = DEFAULT_INTL_CONFIG2; + return IntlProvider3; + }(React6.PureComponent); + var provider_default = IntlProvider2; + + // ../../node_modules/react-intl/lib/index.js + var FormattedDate = createFormattedComponent("formatDate"); + var FormattedTime = createFormattedComponent("formatTime"); + var FormattedNumber = createFormattedComponent("formatNumber"); + var FormattedList = createFormattedComponent("formatList"); + var FormattedDisplayName = createFormattedComponent("formatDisplayName"); + var FormattedDateParts = createFormattedDateTimePartsComponent("formatDate"); + var FormattedTimeParts = createFormattedDateTimePartsComponent("formatTime"); + + // src/Image/assets/image.svg + var React7 = __toESM(require_react()); + var SvgImage = (props) => /* @__PURE__ */ React7.createElement("svg", { + width: 20, + height: 20, + viewBox: "0 0 20 20", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React7.createElement("path", { + d: "M19.86 15.26V2.47C19.8574 1.814 19.5949 1.18577 19.1301 0.722836C18.6653 0.259906 18.036 -5.33299e-06 17.38 0H2.5C2.16847 0.00126416 1.84048 0.068193 1.53497 0.196922C1.22945 0.32565 0.952464 0.513628 0.72 0.75C0.268046 1.20961 0.0102384 1.82548 1.31138e-09 2.47V17.38C-1.06443e-05 17.7074 0.0647931 18.0315 0.190674 18.3337C0.316554 18.6359 0.50102 18.9102 0.733432 19.1407C0.965844 19.3713 1.2416 19.5535 1.5448 19.677C1.848 19.8004 2.17264 19.8626 2.5 19.86H17.38C18.0369 19.8574 18.6662 19.5952 19.1307 19.1307C19.5952 18.6662 19.8574 18.0369 19.86 17.38V15.38V15.25V15.26ZM15.61 13.04L18.7 15.52L18.79 15.6V17.38C18.7821 17.7478 18.6298 18.0978 18.3659 18.3541C18.1021 18.6105 17.7479 18.7527 17.38 18.75H2.5C2.31454 18.7508 2.13075 18.715 1.95916 18.6446C1.78756 18.5743 1.63153 18.4707 1.5 18.34C1.36742 18.2098 1.26271 18.0541 1.19222 17.8821C1.12174 17.7102 1.08696 17.5258 1.09 17.34V16.47L1.18 16.39L6.25 12.14C6.39167 12.0175 6.5727 11.95 6.76 11.95C6.95222 11.9494 7.13771 12.0208 7.28 12.15L9.8 14.75C10.1157 15.0571 10.5305 15.2414 10.97 15.27C11.4102 15.304 11.8476 15.176 12.2 14.91L14.66 13C14.7961 12.8988 14.9604 12.8428 15.13 12.84C15.2999 12.8407 15.4649 12.8969 15.6 13L15.61 13.04ZM18.78 13.67V14.19L18.38 13.86L16.26 12.18C15.9416 11.9269 15.5468 11.7891 15.14 11.7891C14.7332 11.7891 14.3384 11.9269 14.02 12.18L11.56 13.97C11.4214 14.0831 11.2489 14.1465 11.07 14.15C10.8861 14.1476 10.7091 14.0803 10.57 13.96L8.02 11.44C7.6917 11.1055 7.24813 10.9089 6.77983 10.8904C6.31152 10.8718 5.85377 11.0326 5.5 11.34L1.5 14.75L1.09 15.1V2.47C1.09 2.28531 1.12654 2.10243 1.19752 1.93192C1.2685 1.76141 1.37252 1.60663 1.50358 1.4765C1.63464 1.34636 1.79016 1.24345 1.96117 1.17368C2.13218 1.10392 2.31531 1.06868 2.5 1.07H17.38C17.5658 1.06696 17.7502 1.10174 17.9221 1.17222C18.0941 1.24271 18.2498 1.34742 18.38 1.48C18.5107 1.61153 18.6143 1.76756 18.6846 1.93916C18.755 2.11075 18.7908 2.29454 18.79 2.48L18.78 13.67Z", + fill: "#333333" + }), /* @__PURE__ */ React7.createElement("path", { + d: "M14.0707 4.37993C13.5919 4.18009 13.0647 4.12687 12.5557 4.22701C12.0467 4.32715 11.5788 4.57613 11.2115 4.94241C10.8441 5.30869 10.5938 5.77578 10.4922 6.28449C10.3905 6.7932 10.4422 7.32062 10.6407 7.79993C10.8466 8.2856 11.1953 8.69714 11.6407 8.97992C12.1453 9.31662 12.7511 9.46778 13.3547 9.4076C13.9584 9.34742 14.5224 9.07963 14.9507 8.64992C15.2546 8.34523 15.4788 7.97034 15.6035 7.5584C15.7281 7.14646 15.7494 6.71016 15.6654 6.28805C15.5813 5.86595 15.3946 5.47104 15.1217 5.13824C14.8488 4.80544 14.4981 4.545 14.1007 4.37993H14.0707ZM14.3507 7.65992C14.1855 7.91702 13.9443 8.11626 13.6607 8.22992C13.3763 8.34874 13.0629 8.38007 12.7607 8.31992C12.4597 8.25811 12.1824 8.11251 11.9607 7.89992C11.7994 7.73572 11.6763 7.53809 11.5999 7.32101C11.5235 7.10393 11.4958 6.87271 11.5187 6.64373C11.5416 6.41475 11.6146 6.1936 11.7324 5.99594C11.8502 5.79828 12.0101 5.62895 12.2007 5.49993C12.4548 5.32915 12.7544 5.23857 13.0607 5.23992C13.4736 5.24265 13.8687 5.40791 14.1607 5.69992C14.3062 5.84383 14.4217 6.01513 14.5007 6.20392C14.5796 6.39272 14.6204 6.59528 14.6207 6.79993C14.6216 7.10759 14.5273 7.40801 14.3507 7.65992Z", + fill: "#333333" + })); + + // src/Image/assets/download.svg + var React8 = __toESM(require_react()); + var SvgDownload = (props) => /* @__PURE__ */ React8.createElement("svg", { + width: 28, + height: 26, + viewBox: "0 0 26 25", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React8.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M13 25C19.9036 25 25.5 19.4036 25.5 12.5C25.5 5.59644 19.9036 0 13 0C6.09644 0 0.5 5.59644 0.5 12.5C0.5 19.4036 6.09644 25 13 25ZM17.6328 15.9581L13.5555 19.9162C13.4826 19.9868 13.396 20.0428 13.3006 20.081C13.2053 20.1193 13.1031 20.1389 12.9998 20.1389C12.8966 20.1389 12.7944 20.1191 12.6991 20.0808C12.6038 20.0426 12.5172 19.9865 12.4444 19.9158L8.36709 15.9578C8.22042 15.8153 8.13834 15.6225 8.13889 15.4216C8.13944 15.2207 8.22258 15.0282 8.37002 14.8865C8.51747 14.7449 8.71713 14.6656 8.92509 14.6661C9.13305 14.6666 9.33228 14.7469 9.47894 14.8894L12.2162 17.5465V5.61856C12.2162 5.41767 12.2988 5.22501 12.4459 5.08296C12.5929 4.94091 12.7924 4.86111 13.0003 4.86111C13.2083 4.86111 13.4077 4.94091 13.5548 5.08296C13.7018 5.22501 13.7844 5.41767 13.7844 5.61856L13.7844 17.5465L16.5209 14.8894C16.5936 14.8189 16.6799 14.7628 16.7749 14.7245C16.87 14.6862 16.9719 14.6664 17.0749 14.6662C17.1779 14.6659 17.2799 14.6853 17.3752 14.7231C17.4704 14.761 17.557 14.8166 17.63 14.8867C17.703 14.9569 17.761 15.0403 17.8007 15.1321C17.8403 15.2239 17.8609 15.3224 17.8611 15.4219C17.8614 15.5214 17.8413 15.6199 17.8022 15.7119C17.763 15.804 17.7054 15.8876 17.6328 15.9581Z", + fill: "#222222" + })); + + // src/Image/assets/mediatheque.svg + var React9 = __toESM(require_react()); + var SvgMediatheque = (props) => /* @__PURE__ */ React9.createElement("svg", { + width: 28, + height: 26, + viewBox: "0 0 28 26", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React9.createElement("path", { + d: "M7.25281 20.4814C5.42678 20.4814 3.80262 19.3023 3.21296 17.5469L3.17304 17.4146C3.03389 16.9499 2.97572 16.5588 2.97572 16.1677V8.32471L0.20873 17.6401C-0.147124 19.0102 0.663812 20.4308 2.0245 20.8093L19.6609 25.5728C19.8811 25.6303 20.1012 25.6579 20.3179 25.6579C21.4539 25.6579 22.4918 24.8976 22.7826 23.7771L23.8103 20.4814H7.25281Z", + fill: "#222222" + }), /* @__PURE__ */ React9.createElement("path", { + d: "M10.3885 8.40309C11.6466 8.40309 12.6696 7.37124 12.6696 6.10242C12.6696 4.83361 11.6466 3.80176 10.3885 3.80176C9.1305 3.80176 8.10742 4.83361 8.10742 6.10242C8.10742 7.37124 9.1305 8.40309 10.3885 8.40309Z", + fill: "#222222" + }), /* @__PURE__ */ React9.createElement("path", { + d: "M24.6453 0.350098H7.53694C5.96525 0.350098 4.68555 1.64077 4.68555 3.22593V15.8796C4.68555 17.4648 5.96525 18.7554 7.53694 18.7554H24.6453C26.217 18.7554 27.4967 17.4648 27.4967 15.8796V3.22593C27.4967 1.64077 26.217 0.350098 24.6453 0.350098ZM7.53694 2.65076H24.6453C24.9601 2.65076 25.2156 2.90844 25.2156 3.22593V11.3921L21.6126 7.15202C21.2305 6.69994 20.6773 6.45837 20.0831 6.44456C19.4923 6.44801 18.938 6.71259 18.5593 7.17042L14.3233 12.2986L12.9432 10.9102C12.163 10.1233 10.8936 10.1233 10.1146 10.9102L6.96666 14.0839V3.22593C6.96666 2.90844 7.22215 2.65076 7.53694 2.65076Z", + fill: "#222222" + })); + + // src/utils/intl.ts + var getLocale = () => document.documentElement.lang || navigator.languages && navigator.languages[0] || navigator.language || "en"; + var locale = getLocale(); + var messages = { + fr: { + BlockImage__DOWNLOAD: "T\xE9l\xE9charger une image", + BlockImage__OR_DROP: "ou glisser-d\xE9poser une image", + BlockImage__SELECT_BUTTON: "S\xE9lectionner une image", + BlockImage__SELECT: "depuis votre m\xE9diath\xE8que", + BlockImage__TITLE: "Titre de l'image", + BlockImage__LINK: "Lien de l'image", + BlockImage__HEIGHT: "Hauteur de l'image", + BlockImage__WIDTH: "Largeur de l'image", + BlockImage__HEIGHT__PLACEHOLDER: "Indiquez la hauteur de l'image (ex: 100px, 50%, auto)", + BlockImage__WIDTH__PLACEHOLDER: "Indiquez la largeur de l'image (ex: 100px, 50%, auto)", + BlockImage__LINK_PLACEHOLDER: "Lien au clic sur l'image", + BlockImage__LIBRARY_MODAL_TITLE: "Rechercher une image", + BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: "Uploader une image", + BlockImage__LIBRARY_MODAL_SEARCH: "Rechercher dans la m\xE9diath\xE8que", + BlockImage__LIBRARY_MODAL_TAG_FILTER: "Filtrer par tag", + BlockImage__LIBRARY_LOADING: "Chargement de la librairie...", + BlockImage__TOAST_WRONG_FILE_TYPE: "Votre image n'a pas pu \xEAtre t\xE9l\xE9charg\xE9e. Veuillez v\xE9rifier que votre fichier est bien une image.", + BlockImage__TOAST_MAX_FILE: "Veuillez uploader une seule image.", + BlockImage__DROP_TO_UPLOAD: "Relacher pour uploader votre image", + BlockImage__LIBRARY_NO_CONTENT: "Aucune image trouv\xE9e", + BlockImage__LIBRARY_SEARCHING: "Recherche en cours...", + BlockImage__LIBRARY_IMAGE_TAG_CONFIG: "Configuration des tags de", + BlockImage__LIBRARY_IMAGE_ADD_TAG: "Ajouter un ou plusieurs tag", + BlockImage__LIBRARY_IMAGE_SELECT_TAG: "S\xE9lectionnez un ou plusieurs tag", + REPLACE: "Remplacer", + REPLACE_IMAGE: "Remplacer l'image", + OPTIONAL: "Optionnel", + CANCEL: "Annuler", + DELETE: "Supprimer", + SEARCH_BY: "R\xE9f\xE9rence, nom, ...", + LOADING: "Chargement...", + DOWNLOADING: "T\xE9l\xE9chargement...", + ALL_TAGS: "Tous les tags", + CHOOSE: "Choisir" + }, + en: { + BlockImage__DOWNLOAD: "Download an image", + BlockImage__OR_DROP: "or drop an image", + BlockImage__SELECT_BUTTON: "Select an image", + BlockImage__SELECT: "from your library", + BlockImage__TITLE: "Image title", + BlockImage__LINK: "Image link", + BlockImage__HEIGHT: "Image height", + BlockImage__WIDTH: "Image width", + BlockImage__HEIGHT__PLACEHOLDER: "Indicate the height of the image (ex: 100px, 50%, auto)", + BlockImage__WIDTH__PLACEHOLDER: "Indicate the width of the image (ex: 100px, 50%, auto)", + BlockImage__LINK_PLACEHOLDER: "Link on click on image", + BlockImage__LIBRARY_MODAL_TITLE: "Search an image", + BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: "Upload an image", + BlockImage__LIBRARY_MODAL_SEARCH: "Search in the library", + BlockImage__LIBRARY_MODAL_TAG_FILTER: "Filter by tag", + BlockImage__LIBRARY_LOADING: "Loading library...", + BlockImage__TOAST_WRONG_FILE_TYPE: "Your image could not be uploaded. Please check that your file is an image.", + BlockImage__TOAST_MAX_FILE: "Please upload only one image.", + BlockImage__DROP_TO_UPLOAD: "Release to upload your image", + BlockImage__LIBRARY_NO_CONTENT: "No image found", + BlockImage__LIBRARY_SEARCHING: "Searching...", + BlockImage__LIBRARY_IMAGE_TAG_CONFIG: "Configure tags of", + BlockImage__LIBRARY_IMAGE_ADD_TAG: "Add one or more tag", + BlockImage__LIBRARY_IMAGE_SELECT_TAG: "Select one or more tag", + REPLACE: "Replace", + REPLACE_IMAGE: "Replace image", + OPTIONAL: "Optional", + CANCEL: "Cancel", + DELETE: "Delete", + SEARCH_BY: "Reference, name, ...", + LOADING: "Loading...", + DOWNLOADING: "Downloading...", + ALL_TAGS: "All tags", + CHOOSE: "Choose" + }, + es: { + BlockImage__DOWNLOAD: "Descargar una imagen", + BlockImage__OR_DROP: "o arrastrar una imagen", + BlockImage__SELECT_BUTTON: "Seleccionar una imagen", + BlockImage__SELECT: "de tu biblioteca", + BlockImage__TITLE: "T\xEDtulo de la imagen", + BlockImage__LINK: "Enlace de la imagen", + BlockImage__HEIGHT: "Altura de la imagen", + BlockImage__WIDTH: "Ancho de la imagen", + BlockImage__HEIGHT__PLACEHOLDER: "Indica la altura de la imagen (ex: 100px, 50%, auto)", + BlockImage__WIDTH__PLACEHOLDER: "Indica el ancho de la imagen (ex: 100px, 50%, auto)", + BlockImage__LINK_PLACEHOLDER: "Enlace al hacer clic en la imagen", + BlockImage__LIBRARY_MODAL_TITLE: "Buscar una imagen", + BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: "Subir una imagen", + BlockImage__LIBRARY_MODAL_SEARCH: "Buscar en la biblioteca", + BlockImage__LIBRARY_MODAL_TAG_FILTER: "Filtrar por tag", + BlockImage__LIBRARY_LOADING: "Cargando la biblioteca...", + BlockImage__TOAST_WRONG_FILE_TYPE: "Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.", + BlockImage__TOAST_MAX_FILE: "Por favor sube solo una imagen.", + BlockImage__DROP_TO_UPLOAD: "Suelte para subir tu imagen", + BlockImage__LIBRARY_NO_CONTENT: "No se encontraron imagenes", + BlockImage__LIBRARY_SEARCHING: "Buscando...", + BlockImage__LIBRARY_IMAGE_TAG_CONFIG: "Configurar tags de", + BlockImage__LIBRARY_IMAGE_ADD_TAG: "Agregar uno o m\xE1s tags", + BlockImage__LIBRARY_IMAGE_SELECT_TAG: "Seleccionar uno o m\xE1s tags", + REPLACE: "Reemplazar", + REPLACE_IMAGE: "Reemplazar imagen", + OPTIONAL: "Opcional", + CANCEL: "Cancelar", + DELETE: "Eliminar", + SEARCH_BY: "Referencia, nombre, ...", + LOADING: "Cargando...", + DOWNLOADING: "Descargando...", + ALL_TAGS: "Todos los tags", + CHOOSE: "Elegir" + }, + it: { + BlockImage__DOWNLOAD: "Scarica un immagine", + BlockImage__OR_DROP: "o trascina un immagine", + BlockImage__SELECT_BUTTON: "Seleziona un immagine", + BlockImage__SELECT: "dalla tua libreria", + BlockImage__TITLE: "Titolo dell immagine", + BlockImage__LINK: "Link dell immagine", + BlockImage__HEIGHT: "Altezza dell immagine", + BlockImage__WIDTH: "Larghezza dell immagine", + BlockImage__HEIGHT__PLACEHOLDER: "Indica l altezza dell immagine (ex: 100px, 50%, auto)", + BlockImage__WIDTH__PLACEHOLDER: "Indica la larghezza dell immagine (ex: 100px, 50%, auto)", + BlockImage__LINK_PLACEHOLDER: "Link al click sull immagine", + BlockImage__LIBRARY_MODAL_TITLE: "Cerca un immagine", + BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: "Carica un immagine", + BlockImage__LIBRARY_MODAL_SEARCH: "Cerca nella libreria", + BlockImage__LIBRARY_MODAL_TAG_FILTER: "Filtra per tag", + BlockImage__LIBRARY_LOADING: "Caricamento della libreria...", + BlockImage__TOAST_WRONG_FILE_TYPE: "La tua immagine non pu\xF2 essere caricata. Per favore verifica che il tuo file sia un immagine.", + BlockImage__TOAST_MAX_FILE: "Per favore carica solo una immagine.", + BlockImage__DROP_TO_UPLOAD: "Rilascia per caricare la tua immagine", + BlockImage__LIBRARY_NO_CONTENT: "Nessuna immagine trovata", + BlockImage__LIBRARY_SEARCHING: "Ricerca in corso...", + BlockImage__LIBRARY_IMAGE_TAG_CONFIG: "Configura i tag di", + BlockImage__LIBRARY_IMAGE_ADD_TAG: "Aggiungi uno o pi\xF9 tag", + BlockImage__LIBRARY_IMAGE_SELECT_TAG: "Seleziona uno o pi\xF9 tag", + REPLACE: "Sostituisci", + REPLACE_IMAGE: "Sostituisci immagine", + OPTIONAL: "Opzionale", + CANCEL: "Annulla", + DELETE: "Elimina", + SEARCH_BY: "Riferimento, nome, ...", + LOADING: "Caricamento...", + DOWNLOADING: "Scaricare...", + ALL_TAGS: "Tutti i tag", + CHOOSE: "Scegli" + } + }; + + // ../../node_modules/react-dropzone/dist/es/index.js + var import_react = __toESM(require_react()); + var import_prop_types = __toESM(require_prop_types()); + + // ../../node_modules/file-selector/dist/es5/file.js + var COMMON_MIME_TYPES = /* @__PURE__ */ new Map([ + ["aac", "audio/aac"], + ["abw", "application/x-abiword"], + ["arc", "application/x-freearc"], + ["avif", "image/avif"], + ["avi", "video/x-msvideo"], + ["azw", "application/vnd.amazon.ebook"], + ["bin", "application/octet-stream"], + ["bmp", "image/bmp"], + ["bz", "application/x-bzip"], + ["bz2", "application/x-bzip2"], + ["cda", "application/x-cdf"], + ["csh", "application/x-csh"], + ["css", "text/css"], + ["csv", "text/csv"], + ["doc", "application/msword"], + ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"], + ["eot", "application/vnd.ms-fontobject"], + ["epub", "application/epub+zip"], + ["gz", "application/gzip"], + ["gif", "image/gif"], + ["heic", "image/heic"], + ["heif", "image/heif"], + ["htm", "text/html"], + ["html", "text/html"], + ["ico", "image/vnd.microsoft.icon"], + ["ics", "text/calendar"], + ["jar", "application/java-archive"], + ["jpeg", "image/jpeg"], + ["jpg", "image/jpeg"], + ["js", "text/javascript"], + ["json", "application/json"], + ["jsonld", "application/ld+json"], + ["mid", "audio/midi"], + ["midi", "audio/midi"], + ["mjs", "text/javascript"], + ["mp3", "audio/mpeg"], + ["mp4", "video/mp4"], + ["mpeg", "video/mpeg"], + ["mpkg", "application/vnd.apple.installer+xml"], + ["odp", "application/vnd.oasis.opendocument.presentation"], + ["ods", "application/vnd.oasis.opendocument.spreadsheet"], + ["odt", "application/vnd.oasis.opendocument.text"], + ["oga", "audio/ogg"], + ["ogv", "video/ogg"], + ["ogx", "application/ogg"], + ["opus", "audio/opus"], + ["otf", "font/otf"], + ["png", "image/png"], + ["pdf", "application/pdf"], + ["php", "application/x-httpd-php"], + ["ppt", "application/vnd.ms-powerpoint"], + ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"], + ["rar", "application/vnd.rar"], + ["rtf", "application/rtf"], + ["sh", "application/x-sh"], + ["svg", "image/svg+xml"], + ["swf", "application/x-shockwave-flash"], + ["tar", "application/x-tar"], + ["tif", "image/tiff"], + ["tiff", "image/tiff"], + ["ts", "video/mp2t"], + ["ttf", "font/ttf"], + ["txt", "text/plain"], + ["vsd", "application/vnd.visio"], + ["wav", "audio/wav"], + ["weba", "audio/webm"], + ["webm", "video/webm"], + ["webp", "image/webp"], + ["woff", "font/woff"], + ["woff2", "font/woff2"], + ["xhtml", "application/xhtml+xml"], + ["xls", "application/vnd.ms-excel"], + ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], + ["xml", "application/xml"], + ["xul", "application/vnd.mozilla.xul+xml"], + ["zip", "application/zip"], + ["7z", "application/x-7z-compressed"], + ["mkv", "video/x-matroska"], + ["mov", "video/quicktime"], + ["msg", "application/vnd.ms-outlook"] + ]); + function toFileWithPath(file, path) { + var f4 = withMimeType(file); + if (typeof f4.path !== "string") { + var webkitRelativePath = file.webkitRelativePath; + Object.defineProperty(f4, "path", { + value: typeof path === "string" ? path : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : file.name, + writable: false, + configurable: false, + enumerable: true + }); + } + return f4; + } + function withMimeType(file) { + var name = file.name; + var hasExtension = name && name.lastIndexOf(".") !== -1; + if (hasExtension && !file.type) { + var ext = name.split(".").pop().toLowerCase(); + var type = COMMON_MIME_TYPES.get(ext); + if (type) { + Object.defineProperty(file, "type", { + value: type, + writable: false, + configurable: false, + enumerable: true + }); + } + } + return file; + } + + // ../../node_modules/file-selector/dist/es5/file-selector.js + var FILES_TO_IGNORE = [ + ".DS_Store", + "Thumbs.db" + ]; + function fromEvent(evt) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a2) { + if (isObject(evt) && isDataTransfer(evt.dataTransfer)) { + return [2, getDataTransferFiles(evt.dataTransfer, evt.type)]; + } else if (isChangeEvt(evt)) { + return [2, getInputFiles(evt)]; + } else if (Array.isArray(evt) && evt.every(function(item) { + return "getFile" in item && typeof item.getFile === "function"; + })) { + return [2, getFsHandleFiles(evt)]; + } + return [2, []]; + }); + }); + } + function isDataTransfer(value) { + return isObject(value); + } + function isChangeEvt(value) { + return isObject(value) && isObject(value.target); + } + function isObject(v2) { + return typeof v2 === "object" && v2 !== null; + } + function getInputFiles(evt) { + return fromList(evt.target.files).map(function(file) { + return toFileWithPath(file); + }); + } + function getFsHandleFiles(handles) { + return __awaiter(this, void 0, void 0, function() { + var files; + return __generator(this, function(_a2) { + switch (_a2.label) { + case 0: + return [4, Promise.all(handles.map(function(h2) { + return h2.getFile(); + }))]; + case 1: + files = _a2.sent(); + return [2, files.map(function(file) { + return toFileWithPath(file); + })]; + } + }); + }); + } + function getDataTransferFiles(dt, type) { + return __awaiter(this, void 0, void 0, function() { + var items, files; + return __generator(this, function(_a2) { + switch (_a2.label) { + case 0: + if (!dt.items) + return [3, 2]; + items = fromList(dt.items).filter(function(item) { + return item.kind === "file"; + }); + if (type !== "drop") { + return [2, items]; + } + return [4, Promise.all(items.map(toFilePromises))]; + case 1: + files = _a2.sent(); + return [2, noIgnoredFiles(flatten(files))]; + case 2: + return [2, noIgnoredFiles(fromList(dt.files).map(function(file) { + return toFileWithPath(file); + }))]; + } + }); + }); + } + function noIgnoredFiles(files) { + return files.filter(function(file) { + return FILES_TO_IGNORE.indexOf(file.name) === -1; + }); + } + function fromList(items) { + if (items === null) { + return []; + } + var files = []; + for (var i2 = 0; i2 < items.length; i2++) { + var file = items[i2]; + files.push(file); + } + return files; + } + function toFilePromises(item) { + if (typeof item.webkitGetAsEntry !== "function") { + return fromDataTransferItem(item); + } + var entry = item.webkitGetAsEntry(); + if (entry && entry.isDirectory) { + return fromDirEntry(entry); + } + return fromDataTransferItem(item); + } + function flatten(items) { + return items.reduce(function(acc, files) { + return __spreadArray(__spreadArray([], __read(acc), false), __read(Array.isArray(files) ? flatten(files) : [files]), false); + }, []); + } + function fromDataTransferItem(item) { + var file = item.getAsFile(); + if (!file) { + return Promise.reject("".concat(item, " is not a File")); + } + var fwp = toFileWithPath(file); + return Promise.resolve(fwp); + } + function fromEntry(entry) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a2) { + return [2, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)]; + }); + }); + } + function fromDirEntry(entry) { + var reader = entry.createReader(); + return new Promise(function(resolve, reject) { + var entries = []; + function readEntries() { + var _this = this; + reader.readEntries(function(batch) { + return __awaiter(_this, void 0, void 0, function() { + var files, err_1, items; + return __generator(this, function(_a2) { + switch (_a2.label) { + case 0: + if (!!batch.length) + return [3, 5]; + _a2.label = 1; + case 1: + _a2.trys.push([1, 3, , 4]); + return [4, Promise.all(entries)]; + case 2: + files = _a2.sent(); + resolve(files); + return [3, 4]; + case 3: + err_1 = _a2.sent(); + reject(err_1); + return [3, 4]; + case 4: + return [3, 6]; + case 5: + items = Promise.all(batch.map(fromEntry)); + entries.push(items); + readEntries(); + _a2.label = 6; + case 6: + return [2]; + } + }); + }); + }, function(err) { + reject(err); + }); + } + readEntries(); + }); + } + function fromFileEntry(entry) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a2) { + return [2, new Promise(function(resolve, reject) { + entry.file(function(file) { + var fwp = toFileWithPath(file, entry.fullPath); + resolve(fwp); + }, function(err) { + reject(err); + }); + })]; + }); + }); + } + + // ../../node_modules/react-dropzone/dist/es/utils/index.js + var import_attr_accept = __toESM(require_es()); + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = null != arguments[i2] ? arguments[i2] : {}; + i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _slicedToArray(arr, i2) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o3, minLen) { + if (!o3) + return; + if (typeof o3 === "string") + return _arrayLikeToArray(o3, minLen); + var n4 = Object.prototype.toString.call(o3).slice(8, -1); + if (n4 === "Object" && o3.constructor) + n4 = o3.constructor.name; + if (n4 === "Map" || n4 === "Set") + return Array.from(o3); + if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) + return _arrayLikeToArray(o3, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } + function _iterableToArrayLimit(arr, i2) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i2 && _arr.length === i2) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + var FILE_INVALID_TYPE = "file-invalid-type"; + var FILE_TOO_LARGE = "file-too-large"; + var FILE_TOO_SMALL = "file-too-small"; + var TOO_MANY_FILES = "too-many-files"; + var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2(accept) { + accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept; + var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(", ")) : accept; + return { + code: FILE_INVALID_TYPE, + message: "File type must be ".concat(messageSuffix) + }; + }; + var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) { + return { + code: FILE_TOO_LARGE, + message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes") + }; + }; + var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) { + return { + code: FILE_TOO_SMALL, + message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes") + }; + }; + var TOO_MANY_FILES_REJECTION = { + code: TOO_MANY_FILES, + message: "Too many files" + }; + function fileAccepted(file, accept) { + var isAcceptable = file.type === "application/x-moz-file" || (0, import_attr_accept.default)(file, accept); + return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)]; + } + function fileMatchSize(file, minSize, maxSize) { + if (isDefined(file.size)) { + if (isDefined(minSize) && isDefined(maxSize)) { + if (file.size > maxSize) + return [false, getTooLargeRejectionErr(maxSize)]; + if (file.size < minSize) + return [false, getTooSmallRejectionErr(minSize)]; + } else if (isDefined(minSize) && file.size < minSize) + return [false, getTooSmallRejectionErr(minSize)]; + else if (isDefined(maxSize) && file.size > maxSize) + return [false, getTooLargeRejectionErr(maxSize)]; + } + return [true, null]; + } + function isDefined(value) { + return value !== void 0 && value !== null; + } + function allFilesAccepted(_ref) { + var files = _ref.files, accept = _ref.accept, minSize = _ref.minSize, maxSize = _ref.maxSize, multiple = _ref.multiple, maxFiles = _ref.maxFiles, validator = _ref.validator; + if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) { + return false; + } + return files.every(function(file) { + var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray(_fileAccepted, 1), accepted = _fileAccepted2[0]; + var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0]; + var customErrors = validator ? validator(file) : null; + return accepted && sizeMatch && !customErrors; + }); + } + function isPropagationStopped(event) { + if (typeof event.isPropagationStopped === "function") { + return event.isPropagationStopped(); + } else if (typeof event.cancelBubble !== "undefined") { + return event.cancelBubble; + } + return false; + } + function isEvtWithFiles(event) { + if (!event.dataTransfer) { + return !!event.target && !!event.target.files; + } + return Array.prototype.some.call(event.dataTransfer.types, function(type) { + return type === "Files" || type === "application/x-moz-file"; + }); + } + function onDocumentDragOver(event) { + event.preventDefault(); + } + function isIe(userAgent) { + return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1; + } + function isEdge(userAgent) { + return userAgent.indexOf("Edge/") !== -1; + } + function isIeOrEdge() { + var userAgent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent; + return isIe(userAgent) || isEdge(userAgent); + } + function composeEventHandlers() { + for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { + fns[_key] = arguments[_key]; + } + return function(event) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + return fns.some(function(fn3) { + if (!isPropagationStopped(event) && fn3) { + fn3.apply(void 0, [event].concat(args)); + } + return isPropagationStopped(event); + }); + }; + } + function canUseFileSystemAccessAPI() { + return "showOpenFilePicker" in window; + } + function pickerOptionsFromAccept(accept) { + if (isDefined(accept)) { + var acceptForPicker = Object.entries(accept).filter(function(_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), mimeType = _ref3[0], ext = _ref3[1]; + var ok = true; + if (!isMIMEType(mimeType)) { + console.warn('Skipped "'.concat(mimeType, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')); + ok = false; + } + if (!Array.isArray(ext) || !ext.every(isExt)) { + console.warn('Skipped "'.concat(mimeType, '" because an invalid file extension was provided.')); + ok = false; + } + return ok; + }).reduce(function(agg, _ref4) { + var _ref5 = _slicedToArray(_ref4, 2), mimeType = _ref5[0], ext = _ref5[1]; + return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext)); + }, {}); + return [{ + accept: acceptForPicker + }]; + } + return accept; + } + function acceptPropAsAcceptAttr(accept) { + if (isDefined(accept)) { + return Object.entries(accept).reduce(function(a2, _ref6) { + var _ref7 = _slicedToArray(_ref6, 2), mimeType = _ref7[0], ext = _ref7[1]; + return [].concat(_toConsumableArray(a2), [mimeType], _toConsumableArray(ext)); + }, []).filter(function(v2) { + return isMIMEType(v2) || isExt(v2); + }).join(","); + } + return void 0; + } + function isAbort(v2) { + return v2 instanceof DOMException && (v2.name === "AbortError" || v2.code === v2.ABORT_ERR); + } + function isSecurityError(v2) { + return v2 instanceof DOMException && (v2.name === "SecurityError" || v2.code === v2.SECURITY_ERR); + } + function isMIMEType(v2) { + return v2 === "audio/*" || v2 === "video/*" || v2 === "image/*" || v2 === "text/*" || /\w+\/[-+.\w]+/g.test(v2); + } + function isExt(v2) { + return /^.*\.[\w]+$/.test(v2); + } + + // ../../node_modules/react-dropzone/dist/es/index.js + var _excluded = ["children"]; + var _excluded2 = ["open"]; + var _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]; + var _excluded4 = ["refKey", "onChange", "onClick"]; + function _toConsumableArray2(arr) { + return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2(); + } + function _nonIterableSpread2() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _iterableToArray2(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _arrayWithoutHoles2(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray2(arr); + } + function _slicedToArray2(arr, i2) { + return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i2) || _unsupportedIterableToArray2(arr, i2) || _nonIterableRest2(); + } + function _nonIterableRest2() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray2(o3, minLen) { + if (!o3) + return; + if (typeof o3 === "string") + return _arrayLikeToArray2(o3, minLen); + var n4 = Object.prototype.toString.call(o3).slice(8, -1); + if (n4 === "Object" && o3.constructor) + n4 = o3.constructor.name; + if (n4 === "Map" || n4 === "Set") + return Array.from(o3); + if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4)) + return _arrayLikeToArray2(o3, minLen); + } + function _arrayLikeToArray2(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } + function _iterableToArrayLimit2(arr, i2) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i2 && _arr.length === i2) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; + } + function _arrayWithHoles2(arr) { + if (Array.isArray(arr)) + return arr; + } + function ownKeys2(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = null != arguments[i2] ? arguments[i2] : {}; + i2 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty2(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty2(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _objectWithoutProperties(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key, i2; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) { + key = sourceSymbolKeys[i2]; + if (excluded.indexOf(key) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) + continue; + target[key] = source[key]; + } + } + return target; + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i2; + for (i2 = 0; i2 < sourceKeys.length; i2++) { + key = sourceKeys[i2]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; + } + var Dropzone = /* @__PURE__ */ (0, import_react.forwardRef)(function(_ref, ref) { + var children = _ref.children, params = _objectWithoutProperties(_ref, _excluded); + var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2); + (0, import_react.useImperativeHandle)(ref, function() { + return { + open + }; + }, [open]); + return /* @__PURE__ */ import_react.default.createElement(import_react.Fragment, null, children(_objectSpread2(_objectSpread2({}, props), {}, { + open + }))); + }); + Dropzone.displayName = "Dropzone"; + var defaultProps = { + disabled: false, + getFilesFromEvent: fromEvent, + maxSize: Infinity, + minSize: 0, + multiple: true, + maxFiles: 0, + preventDropOnDocument: true, + noClick: false, + noKeyboard: false, + noDrag: false, + noDragEventsBubbling: false, + validator: null, + useFsAccessApi: true, + autoFocus: false + }; + Dropzone.defaultProps = defaultProps; + Dropzone.propTypes = { + children: import_prop_types.default.func, + accept: import_prop_types.default.objectOf(import_prop_types.default.arrayOf(import_prop_types.default.string)), + multiple: import_prop_types.default.bool, + preventDropOnDocument: import_prop_types.default.bool, + noClick: import_prop_types.default.bool, + noKeyboard: import_prop_types.default.bool, + noDrag: import_prop_types.default.bool, + noDragEventsBubbling: import_prop_types.default.bool, + minSize: import_prop_types.default.number, + maxSize: import_prop_types.default.number, + maxFiles: import_prop_types.default.number, + disabled: import_prop_types.default.bool, + getFilesFromEvent: import_prop_types.default.func, + onFileDialogCancel: import_prop_types.default.func, + onFileDialogOpen: import_prop_types.default.func, + useFsAccessApi: import_prop_types.default.bool, + autoFocus: import_prop_types.default.bool, + onDragEnter: import_prop_types.default.func, + onDragLeave: import_prop_types.default.func, + onDragOver: import_prop_types.default.func, + onDrop: import_prop_types.default.func, + onDropAccepted: import_prop_types.default.func, + onDropRejected: import_prop_types.default.func, + onError: import_prop_types.default.func, + validator: import_prop_types.default.func + }; + var initialState = { + isFocused: false, + isFileDialogActive: false, + isDragActive: false, + isDragAccept: false, + isDragReject: false, + acceptedFiles: [], + fileRejections: [] + }; + function useDropzone() { + var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var _defaultProps$props = _objectSpread2(_objectSpread2({}, defaultProps), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator = _defaultProps$props.validator; + var acceptAttr = (0, import_react.useMemo)(function() { + return acceptPropAsAcceptAttr(accept); + }, [accept]); + var pickerTypes = (0, import_react.useMemo)(function() { + return pickerOptionsFromAccept(accept); + }, [accept]); + var onFileDialogOpenCb = (0, import_react.useMemo)(function() { + return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop; + }, [onFileDialogOpen]); + var onFileDialogCancelCb = (0, import_react.useMemo)(function() { + return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop; + }, [onFileDialogCancel]); + var rootRef = (0, import_react.useRef)(null); + var inputRef = (0, import_react.useRef)(null); + var _useReducer = (0, import_react.useReducer)(reducer, initialState), _useReducer2 = _slicedToArray2(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; + var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive; + var fsAccessApiWorksRef = (0, import_react.useRef)(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); + var onWindowFocus = function onWindowFocus2() { + if (!fsAccessApiWorksRef.current && isFileDialogActive) { + setTimeout(function() { + if (inputRef.current) { + var files = inputRef.current.files; + if (!files.length) { + dispatch({ + type: "closeDialog" + }); + onFileDialogCancelCb(); + } + } + }, 300); + } + }; + (0, import_react.useEffect)(function() { + window.addEventListener("focus", onWindowFocus, false); + return function() { + window.removeEventListener("focus", onWindowFocus, false); + }; + }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]); + var dragTargetsRef = (0, import_react.useRef)([]); + var onDocumentDrop = function onDocumentDrop2(event) { + if (rootRef.current && rootRef.current.contains(event.target)) { + return; + } + event.preventDefault(); + dragTargetsRef.current = []; + }; + (0, import_react.useEffect)(function() { + if (preventDropOnDocument) { + document.addEventListener("dragover", onDocumentDragOver, false); + document.addEventListener("drop", onDocumentDrop, false); + } + return function() { + if (preventDropOnDocument) { + document.removeEventListener("dragover", onDocumentDragOver); + document.removeEventListener("drop", onDocumentDrop); + } + }; + }, [rootRef, preventDropOnDocument]); + (0, import_react.useEffect)(function() { + if (!disabled && autoFocus && rootRef.current) { + rootRef.current.focus(); + } + return function() { + }; + }, [rootRef, autoFocus, disabled]); + var onErrCb = (0, import_react.useCallback)(function(e2) { + if (onError) { + onError(e2); + } else { + console.error(e2); + } + }, [onError]); + var onDragEnterCb = (0, import_react.useCallback)(function(event) { + event.preventDefault(); + event.persist(); + stopPropagation(event); + dragTargetsRef.current = [].concat(_toConsumableArray2(dragTargetsRef.current), [event.target]); + if (isEvtWithFiles(event)) { + Promise.resolve(getFilesFromEvent(event)).then(function(files) { + if (isPropagationStopped(event) && !noDragEventsBubbling) { + return; + } + var fileCount = files.length; + var isDragAccept = fileCount > 0 && allFilesAccepted({ + files, + accept: acceptAttr, + minSize, + maxSize, + multiple, + maxFiles, + validator + }); + var isDragReject = fileCount > 0 && !isDragAccept; + dispatch({ + isDragAccept, + isDragReject, + isDragActive: true, + type: "setDraggedFiles" + }); + if (onDragEnter) { + onDragEnter(event); + } + }).catch(function(e2) { + return onErrCb(e2); + }); + } + }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]); + var onDragOverCb = (0, import_react.useCallback)(function(event) { + event.preventDefault(); + event.persist(); + stopPropagation(event); + var hasFiles = isEvtWithFiles(event); + if (hasFiles && event.dataTransfer) { + try { + event.dataTransfer.dropEffect = "copy"; + } catch (_unused) { + } + } + if (hasFiles && onDragOver) { + onDragOver(event); + } + return false; + }, [onDragOver, noDragEventsBubbling]); + var onDragLeaveCb = (0, import_react.useCallback)(function(event) { + event.preventDefault(); + event.persist(); + stopPropagation(event); + var targets = dragTargetsRef.current.filter(function(target) { + return rootRef.current && rootRef.current.contains(target); + }); + var targetIdx = targets.indexOf(event.target); + if (targetIdx !== -1) { + targets.splice(targetIdx, 1); + } + dragTargetsRef.current = targets; + if (targets.length > 0) { + return; + } + dispatch({ + type: "setDraggedFiles", + isDragActive: false, + isDragAccept: false, + isDragReject: false + }); + if (isEvtWithFiles(event) && onDragLeave) { + onDragLeave(event); + } + }, [rootRef, onDragLeave, noDragEventsBubbling]); + var setFiles = (0, import_react.useCallback)(function(files, event) { + var acceptedFiles = []; + var fileRejections = []; + files.forEach(function(file) { + var _fileAccepted = fileAccepted(file, acceptAttr), _fileAccepted2 = _slicedToArray2(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1]; + var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray2(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1]; + var customErrors = validator ? validator(file) : null; + if (accepted && sizeMatch && !customErrors) { + acceptedFiles.push(file); + } else { + var errors = [acceptError, sizeError]; + if (customErrors) { + errors = errors.concat(customErrors); + } + fileRejections.push({ + file, + errors: errors.filter(function(e2) { + return e2; + }) + }); + } + }); + if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) { + acceptedFiles.forEach(function(file) { + fileRejections.push({ + file, + errors: [TOO_MANY_FILES_REJECTION] + }); + }); + acceptedFiles.splice(0); + } + dispatch({ + acceptedFiles, + fileRejections, + type: "setFiles" + }); + if (onDrop) { + onDrop(acceptedFiles, fileRejections, event); + } + if (fileRejections.length > 0 && onDropRejected) { + onDropRejected(fileRejections, event); + } + if (acceptedFiles.length > 0 && onDropAccepted) { + onDropAccepted(acceptedFiles, event); + } + }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]); + var onDropCb = (0, import_react.useCallback)(function(event) { + event.preventDefault(); + event.persist(); + stopPropagation(event); + dragTargetsRef.current = []; + if (isEvtWithFiles(event)) { + Promise.resolve(getFilesFromEvent(event)).then(function(files) { + if (isPropagationStopped(event) && !noDragEventsBubbling) { + return; + } + setFiles(files, event); + }).catch(function(e2) { + return onErrCb(e2); + }); + } + dispatch({ + type: "reset" + }); + }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); + var openFileDialog = (0, import_react.useCallback)(function() { + if (fsAccessApiWorksRef.current) { + dispatch({ + type: "openDialog" + }); + onFileDialogOpenCb(); + var opts = { + multiple, + types: pickerTypes + }; + window.showOpenFilePicker(opts).then(function(handles) { + return getFilesFromEvent(handles); + }).then(function(files) { + setFiles(files, null); + dispatch({ + type: "closeDialog" + }); + }).catch(function(e2) { + if (isAbort(e2)) { + onFileDialogCancelCb(e2); + dispatch({ + type: "closeDialog" + }); + } else if (isSecurityError(e2)) { + fsAccessApiWorksRef.current = false; + if (inputRef.current) { + inputRef.current.value = null; + inputRef.current.click(); + } else { + onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.")); + } + } else { + onErrCb(e2); + } + }); + return; + } + if (inputRef.current) { + dispatch({ + type: "openDialog" + }); + onFileDialogOpenCb(); + inputRef.current.value = null; + inputRef.current.click(); + } + }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); + var onKeyDownCb = (0, import_react.useCallback)(function(event) { + if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) { + return; + } + if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) { + event.preventDefault(); + openFileDialog(); + } + }, [rootRef, openFileDialog]); + var onFocusCb = (0, import_react.useCallback)(function() { + dispatch({ + type: "focus" + }); + }, []); + var onBlurCb = (0, import_react.useCallback)(function() { + dispatch({ + type: "blur" + }); + }, []); + var onClickCb = (0, import_react.useCallback)(function() { + if (noClick) { + return; + } + if (isIeOrEdge()) { + setTimeout(openFileDialog, 0); + } else { + openFileDialog(); + } + }, [noClick, openFileDialog]); + var composeHandler = function composeHandler2(fn3) { + return disabled ? null : fn3; + }; + var composeKeyboardHandler = function composeKeyboardHandler2(fn3) { + return noKeyboard ? null : composeHandler(fn3); + }; + var composeDragHandler = function composeDragHandler2(fn3) { + return noDrag ? null : composeHandler(fn3); + }; + var stopPropagation = function stopPropagation2(event) { + if (noDragEventsBubbling) { + event.stopPropagation(); + } + }; + var getRootProps = (0, import_react.useMemo)(function() { + return function() { + var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3); + return _objectSpread2(_objectSpread2(_defineProperty2({ + onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)), + onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)), + onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)), + onClick: composeHandler(composeEventHandlers(onClick, onClickCb)), + onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)), + onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)), + onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)), + onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)), + role: typeof role === "string" && role !== "" ? role : "presentation" + }, refKey, rootRef), !disabled && !noKeyboard ? { + tabIndex: 0 + } : {}), rest); + }; + }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]); + var onInputElementClick = (0, import_react.useCallback)(function(event) { + event.stopPropagation(); + }, []); + var getInputProps = (0, import_react.useMemo)(function() { + return function() { + var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4); + var inputProps = _defineProperty2({ + accept: acceptAttr, + multiple, + type: "file", + style: { + display: "none" + }, + onChange: composeHandler(composeEventHandlers(onChange, onDropCb)), + onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)), + tabIndex: -1 + }, refKey, inputRef); + return _objectSpread2(_objectSpread2({}, inputProps), rest); + }; + }, [inputRef, accept, multiple, onDropCb, disabled]); + return _objectSpread2(_objectSpread2({}, state), {}, { + isFocused: isFocused && !disabled, + getRootProps, + getInputProps, + rootRef, + inputRef, + open: composeHandler(openFileDialog) + }); + } + function reducer(state, action) { + switch (action.type) { + case "focus": + return _objectSpread2(_objectSpread2({}, state), {}, { + isFocused: true + }); + case "blur": + return _objectSpread2(_objectSpread2({}, state), {}, { + isFocused: false + }); + case "openDialog": + return _objectSpread2(_objectSpread2({}, initialState), {}, { + isFileDialogActive: true + }); + case "closeDialog": + return _objectSpread2(_objectSpread2({}, state), {}, { + isFileDialogActive: false + }); + case "setDraggedFiles": + return _objectSpread2(_objectSpread2({}, state), {}, { + isDragActive: action.isDragActive, + isDragAccept: action.isDragAccept, + isDragReject: action.isDragReject + }); + case "setFiles": + return _objectSpread2(_objectSpread2({}, state), {}, { + acceptedFiles: action.acceptedFiles, + fileRejections: action.fileRejections + }); + case "reset": + return _objectSpread2({}, initialState); + default: + return state; + } + } + function noop() { + } + + // ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js + function _setPrototypeOf(o3, p2) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o4, p3) { + o4.__proto__ = p3; + return o4; + }; + return _setPrototypeOf(o3, p2); + } + + // ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + + // ../../node_modules/react-query/es/core/subscribable.js + var Subscribable = /* @__PURE__ */ function() { + function Subscribable2() { + this.listeners = []; + } + var _proto = Subscribable2.prototype; + _proto.subscribe = function subscribe(listener) { + var _this = this; + var callback = listener || function() { + return void 0; + }; + this.listeners.push(callback); + this.onSubscribe(); + return function() { + _this.listeners = _this.listeners.filter(function(x2) { + return x2 !== callback; + }); + _this.onUnsubscribe(); + }; + }; + _proto.hasListeners = function hasListeners() { + return this.listeners.length > 0; + }; + _proto.onSubscribe = function onSubscribe() { + }; + _proto.onUnsubscribe = function onUnsubscribe() { + }; + return Subscribable2; + }(); + + // ../../node_modules/@babel/runtime/helpers/esm/extends.js + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = arguments[i2]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + + // ../../node_modules/react-query/es/core/utils.js + var isServer = typeof window === "undefined"; + function noop2() { + return void 0; + } + function functionalUpdate(updater, input) { + return typeof updater === "function" ? updater(input) : updater; + } + function isValidTimeout(value) { + return typeof value === "number" && value >= 0 && value !== Infinity; + } + function ensureQueryKeyArray(value) { + return Array.isArray(value) ? value : [value]; + } + function timeUntilStale(updatedAt, staleTime) { + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); + } + function parseQueryArgs(arg1, arg2, arg3) { + if (!isQueryKey(arg1)) { + return arg1; + } + if (typeof arg2 === "function") { + return _extends({}, arg3, { + queryKey: arg1, + queryFn: arg2 + }); + } + return _extends({}, arg2, { + queryKey: arg1 + }); + } + function parseMutationArgs(arg1, arg2, arg3) { + if (isQueryKey(arg1)) { + if (typeof arg2 === "function") { + return _extends({}, arg3, { + mutationKey: arg1, + mutationFn: arg2 + }); + } + return _extends({}, arg2, { + mutationKey: arg1 + }); + } + if (typeof arg1 === "function") { + return _extends({}, arg2, { + mutationFn: arg1 + }); + } + return _extends({}, arg1); + } + function parseFilterArgs(arg1, arg2, arg3) { + return isQueryKey(arg1) ? [_extends({}, arg2, { + queryKey: arg1 + }), arg3] : [arg1 || {}, arg2]; + } + function mapQueryStatusFilter(active, inactive) { + if (active === true && inactive === true || active == null && inactive == null) { + return "all"; + } else if (active === false && inactive === false) { + return "none"; + } else { + var isActive = active != null ? active : !inactive; + return isActive ? "active" : "inactive"; + } + } + function matchQuery(filters, query) { + var active = filters.active, exact = filters.exact, fetching = filters.fetching, inactive = filters.inactive, predicate = filters.predicate, queryKey = filters.queryKey, stale = filters.stale; + if (isQueryKey(queryKey)) { + if (exact) { + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { + return false; + } + } else if (!partialMatchKey(query.queryKey, queryKey)) { + return false; + } + } + var queryStatusFilter = mapQueryStatusFilter(active, inactive); + if (queryStatusFilter === "none") { + return false; + } else if (queryStatusFilter !== "all") { + var isActive = query.isActive(); + if (queryStatusFilter === "active" && !isActive) { + return false; + } + if (queryStatusFilter === "inactive" && isActive) { + return false; + } + } + if (typeof stale === "boolean" && query.isStale() !== stale) { + return false; + } + if (typeof fetching === "boolean" && query.isFetching() !== fetching) { + return false; + } + if (predicate && !predicate(query)) { + return false; + } + return true; + } + function matchMutation(filters, mutation) { + var exact = filters.exact, fetching = filters.fetching, predicate = filters.predicate, mutationKey = filters.mutationKey; + if (isQueryKey(mutationKey)) { + if (!mutation.options.mutationKey) { + return false; + } + if (exact) { + if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) { + return false; + } + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { + return false; + } + } + if (typeof fetching === "boolean" && mutation.state.status === "loading" !== fetching) { + return false; + } + if (predicate && !predicate(mutation)) { + return false; + } + return true; + } + function hashQueryKeyByOptions(queryKey, options) { + var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey; + return hashFn(queryKey); + } + function hashQueryKey(queryKey) { + var asArray = ensureQueryKeyArray(queryKey); + return stableValueHash(asArray); + } + function stableValueHash(value) { + return JSON.stringify(value, function(_2, val) { + return isPlainObject(val) ? Object.keys(val).sort().reduce(function(result, key) { + result[key] = val[key]; + return result; + }, {}) : val; + }); + } + function partialMatchKey(a2, b2) { + return partialDeepEqual(ensureQueryKeyArray(a2), ensureQueryKeyArray(b2)); + } + function partialDeepEqual(a2, b2) { + if (a2 === b2) { + return true; + } + if (typeof a2 !== typeof b2) { + return false; + } + if (a2 && b2 && typeof a2 === "object" && typeof b2 === "object") { + return !Object.keys(b2).some(function(key) { + return !partialDeepEqual(a2[key], b2[key]); + }); + } + return false; + } + function replaceEqualDeep(a2, b2) { + if (a2 === b2) { + return a2; + } + var array = Array.isArray(a2) && Array.isArray(b2); + if (array || isPlainObject(a2) && isPlainObject(b2)) { + var aSize = array ? a2.length : Object.keys(a2).length; + var bItems = array ? b2 : Object.keys(b2); + var bSize = bItems.length; + var copy = array ? [] : {}; + var equalItems = 0; + for (var i2 = 0; i2 < bSize; i2++) { + var key = array ? i2 : bItems[i2]; + copy[key] = replaceEqualDeep(a2[key], b2[key]); + if (copy[key] === a2[key]) { + equalItems++; + } + } + return aSize === bSize && equalItems === aSize ? a2 : copy; + } + return b2; + } + function shallowEqualObjects(a2, b2) { + if (a2 && !b2 || b2 && !a2) { + return false; + } + for (var key in a2) { + if (a2[key] !== b2[key]) { + return false; + } + } + return true; + } + function isPlainObject(o3) { + if (!hasObjectPrototype(o3)) { + return false; + } + var ctor = o3.constructor; + if (typeof ctor === "undefined") { + return true; + } + var prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + return true; + } + function hasObjectPrototype(o3) { + return Object.prototype.toString.call(o3) === "[object Object]"; + } + function isQueryKey(value) { + return typeof value === "string" || Array.isArray(value); + } + function sleep(timeout) { + return new Promise(function(resolve) { + setTimeout(resolve, timeout); + }); + } + function scheduleMicrotask(callback) { + Promise.resolve().then(callback).catch(function(error) { + return setTimeout(function() { + throw error; + }); + }); + } + function getAbortController() { + if (typeof AbortController === "function") { + return new AbortController(); + } + } + + // ../../node_modules/react-query/es/core/focusManager.js + var FocusManager = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(FocusManager2, _Subscribable); + function FocusManager2() { + var _this; + _this = _Subscribable.call(this) || this; + _this.setup = function(onFocus) { + var _window; + if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) { + var listener = function listener2() { + return onFocus(); + }; + window.addEventListener("visibilitychange", listener, false); + window.addEventListener("focus", listener, false); + return function() { + window.removeEventListener("visibilitychange", listener); + window.removeEventListener("focus", listener); + }; + } + }; + return _this; + } + var _proto = FocusManager2.prototype; + _proto.onSubscribe = function onSubscribe() { + if (!this.cleanup) { + this.setEventListener(this.setup); + } + }; + _proto.onUnsubscribe = function onUnsubscribe() { + if (!this.hasListeners()) { + var _this$cleanup; + (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); + this.cleanup = void 0; + } + }; + _proto.setEventListener = function setEventListener(setup) { + var _this$cleanup2, _this2 = this; + this.setup = setup; + (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); + this.cleanup = setup(function(focused) { + if (typeof focused === "boolean") { + _this2.setFocused(focused); + } else { + _this2.onFocus(); + } + }); + }; + _proto.setFocused = function setFocused(focused) { + this.focused = focused; + if (focused) { + this.onFocus(); + } + }; + _proto.onFocus = function onFocus() { + this.listeners.forEach(function(listener) { + listener(); + }); + }; + _proto.isFocused = function isFocused() { + if (typeof this.focused === "boolean") { + return this.focused; + } + if (typeof document === "undefined") { + return true; + } + return [void 0, "visible", "prerender"].includes(document.visibilityState); + }; + return FocusManager2; + }(Subscribable); + var focusManager = new FocusManager(); + + // ../../node_modules/react-query/es/core/onlineManager.js + var OnlineManager = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(OnlineManager2, _Subscribable); + function OnlineManager2() { + var _this; + _this = _Subscribable.call(this) || this; + _this.setup = function(onOnline) { + var _window; + if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) { + var listener = function listener2() { + return onOnline(); + }; + window.addEventListener("online", listener, false); + window.addEventListener("offline", listener, false); + return function() { + window.removeEventListener("online", listener); + window.removeEventListener("offline", listener); + }; + } + }; + return _this; + } + var _proto = OnlineManager2.prototype; + _proto.onSubscribe = function onSubscribe() { + if (!this.cleanup) { + this.setEventListener(this.setup); + } + }; + _proto.onUnsubscribe = function onUnsubscribe() { + if (!this.hasListeners()) { + var _this$cleanup; + (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); + this.cleanup = void 0; + } + }; + _proto.setEventListener = function setEventListener(setup) { + var _this$cleanup2, _this2 = this; + this.setup = setup; + (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); + this.cleanup = setup(function(online) { + if (typeof online === "boolean") { + _this2.setOnline(online); + } else { + _this2.onOnline(); + } + }); + }; + _proto.setOnline = function setOnline(online) { + this.online = online; + if (online) { + this.onOnline(); + } + }; + _proto.onOnline = function onOnline() { + this.listeners.forEach(function(listener) { + listener(); + }); + }; + _proto.isOnline = function isOnline() { + if (typeof this.online === "boolean") { + return this.online; + } + if (typeof navigator === "undefined" || typeof navigator.onLine === "undefined") { + return true; + } + return navigator.onLine; + }; + return OnlineManager2; + }(Subscribable); + var onlineManager = new OnlineManager(); + + // ../../node_modules/react-query/es/core/retryer.js + function defaultRetryDelay(failureCount) { + return Math.min(1e3 * Math.pow(2, failureCount), 3e4); + } + function isCancelable(value) { + return typeof (value == null ? void 0 : value.cancel) === "function"; + } + var CancelledError = function CancelledError2(options) { + this.revert = options == null ? void 0 : options.revert; + this.silent = options == null ? void 0 : options.silent; + }; + function isCancelledError(value) { + return value instanceof CancelledError; + } + var Retryer = function Retryer2(config) { + var _this = this; + var cancelRetry = false; + var cancelFn; + var continueFn; + var promiseResolve; + var promiseReject; + this.abort = config.abort; + this.cancel = function(cancelOptions) { + return cancelFn == null ? void 0 : cancelFn(cancelOptions); + }; + this.cancelRetry = function() { + cancelRetry = true; + }; + this.continueRetry = function() { + cancelRetry = false; + }; + this.continue = function() { + return continueFn == null ? void 0 : continueFn(); + }; + this.failureCount = 0; + this.isPaused = false; + this.isResolved = false; + this.isTransportCancelable = false; + this.promise = new Promise(function(outerResolve, outerReject) { + promiseResolve = outerResolve; + promiseReject = outerReject; + }); + var resolve = function resolve2(value) { + if (!_this.isResolved) { + _this.isResolved = true; + config.onSuccess == null ? void 0 : config.onSuccess(value); + continueFn == null ? void 0 : continueFn(); + promiseResolve(value); + } + }; + var reject = function reject2(value) { + if (!_this.isResolved) { + _this.isResolved = true; + config.onError == null ? void 0 : config.onError(value); + continueFn == null ? void 0 : continueFn(); + promiseReject(value); + } + }; + var pause = function pause2() { + return new Promise(function(continueResolve) { + continueFn = continueResolve; + _this.isPaused = true; + config.onPause == null ? void 0 : config.onPause(); + }).then(function() { + continueFn = void 0; + _this.isPaused = false; + config.onContinue == null ? void 0 : config.onContinue(); + }); + }; + var run = function run2() { + if (_this.isResolved) { + return; + } + var promiseOrValue; + try { + promiseOrValue = config.fn(); + } catch (error) { + promiseOrValue = Promise.reject(error); + } + cancelFn = function cancelFn2(cancelOptions) { + if (!_this.isResolved) { + reject(new CancelledError(cancelOptions)); + _this.abort == null ? void 0 : _this.abort(); + if (isCancelable(promiseOrValue)) { + try { + promiseOrValue.cancel(); + } catch (_unused) { + } + } + } + }; + _this.isTransportCancelable = isCancelable(promiseOrValue); + Promise.resolve(promiseOrValue).then(resolve).catch(function(error) { + var _config$retry, _config$retryDelay; + if (_this.isResolved) { + return; + } + var retry = (_config$retry = config.retry) != null ? _config$retry : 3; + var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay; + var delay = typeof retryDelay === "function" ? retryDelay(_this.failureCount, error) : retryDelay; + var shouldRetry = retry === true || typeof retry === "number" && _this.failureCount < retry || typeof retry === "function" && retry(_this.failureCount, error); + if (cancelRetry || !shouldRetry) { + reject(error); + return; + } + _this.failureCount++; + config.onFail == null ? void 0 : config.onFail(_this.failureCount, error); + sleep(delay).then(function() { + if (!focusManager.isFocused() || !onlineManager.isOnline()) { + return pause(); + } + }).then(function() { + if (cancelRetry) { + reject(error); + } else { + run2(); + } + }); + }); + }; + run(); + }; + + // ../../node_modules/react-query/es/core/notifyManager.js + var NotifyManager = /* @__PURE__ */ function() { + function NotifyManager2() { + this.queue = []; + this.transactions = 0; + this.notifyFn = function(callback) { + callback(); + }; + this.batchNotifyFn = function(callback) { + callback(); + }; + } + var _proto = NotifyManager2.prototype; + _proto.batch = function batch(callback) { + var result; + this.transactions++; + try { + result = callback(); + } finally { + this.transactions--; + if (!this.transactions) { + this.flush(); + } + } + return result; + }; + _proto.schedule = function schedule(callback) { + var _this = this; + if (this.transactions) { + this.queue.push(callback); + } else { + scheduleMicrotask(function() { + _this.notifyFn(callback); + }); + } + }; + _proto.batchCalls = function batchCalls(callback) { + var _this2 = this; + return function() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this2.schedule(function() { + callback.apply(void 0, args); + }); + }; + }; + _proto.flush = function flush() { + var _this3 = this; + var queue = this.queue; + this.queue = []; + if (queue.length) { + scheduleMicrotask(function() { + _this3.batchNotifyFn(function() { + queue.forEach(function(callback) { + _this3.notifyFn(callback); + }); + }); + }); + } + }; + _proto.setNotifyFunction = function setNotifyFunction(fn3) { + this.notifyFn = fn3; + }; + _proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn3) { + this.batchNotifyFn = fn3; + }; + return NotifyManager2; + }(); + var notifyManager = new NotifyManager(); + + // ../../node_modules/react-query/es/core/logger.js + var logger = console; + function getLogger() { + return logger; + } + function setLogger(newLogger) { + logger = newLogger; + } + + // ../../node_modules/react-query/es/core/query.js + var Query = /* @__PURE__ */ function() { + function Query2(config) { + this.abortSignalConsumed = false; + this.hadObservers = false; + this.defaultOptions = config.defaultOptions; + this.setOptions(config.options); + this.observers = []; + this.cache = config.cache; + this.queryKey = config.queryKey; + this.queryHash = config.queryHash; + this.initialState = config.state || this.getDefaultState(this.options); + this.state = this.initialState; + this.meta = config.meta; + this.scheduleGc(); + } + var _proto = Query2.prototype; + _proto.setOptions = function setOptions(options) { + var _this$options$cacheTi; + this.options = _extends({}, this.defaultOptions, options); + this.meta = options == null ? void 0 : options.meta; + this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 5 * 60 * 1e3); + }; + _proto.setDefaultOptions = function setDefaultOptions(options) { + this.defaultOptions = options; + }; + _proto.scheduleGc = function scheduleGc() { + var _this = this; + this.clearGcTimeout(); + if (isValidTimeout(this.cacheTime)) { + this.gcTimeout = setTimeout(function() { + _this.optionalRemove(); + }, this.cacheTime); + } + }; + _proto.clearGcTimeout = function clearGcTimeout() { + if (this.gcTimeout) { + clearTimeout(this.gcTimeout); + this.gcTimeout = void 0; + } + }; + _proto.optionalRemove = function optionalRemove() { + if (!this.observers.length) { + if (this.state.isFetching) { + if (this.hadObservers) { + this.scheduleGc(); + } + } else { + this.cache.remove(this); + } + } + }; + _proto.setData = function setData(updater, options) { + var _this$options$isDataE, _this$options; + var prevData = this.state.data; + var data = functionalUpdate(updater, prevData); + if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) { + data = prevData; + } else if (this.options.structuralSharing !== false) { + data = replaceEqualDeep(prevData, data); + } + this.dispatch({ + data, + type: "success", + dataUpdatedAt: options == null ? void 0 : options.updatedAt + }); + return data; + }; + _proto.setState = function setState(state, setStateOptions) { + this.dispatch({ + type: "setState", + state, + setStateOptions + }); + }; + _proto.cancel = function cancel(options) { + var _this$retryer; + var promise = this.promise; + (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options); + return promise ? promise.then(noop2).catch(noop2) : Promise.resolve(); + }; + _proto.destroy = function destroy() { + this.clearGcTimeout(); + this.cancel({ + silent: true + }); + }; + _proto.reset = function reset() { + this.destroy(); + this.setState(this.initialState); + }; + _proto.isActive = function isActive() { + return this.observers.some(function(observer) { + return observer.options.enabled !== false; + }); + }; + _proto.isFetching = function isFetching() { + return this.state.isFetching; + }; + _proto.isStale = function isStale2() { + return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function(observer) { + return observer.getCurrentResult().isStale; + }); + }; + _proto.isStaleByTime = function isStaleByTime(staleTime) { + if (staleTime === void 0) { + staleTime = 0; + } + return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime); + }; + _proto.onFocus = function onFocus() { + var _this$retryer2; + var observer = this.observers.find(function(x2) { + return x2.shouldFetchOnWindowFocus(); + }); + if (observer) { + observer.refetch(); + } + (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue(); + }; + _proto.onOnline = function onOnline() { + var _this$retryer3; + var observer = this.observers.find(function(x2) { + return x2.shouldFetchOnReconnect(); + }); + if (observer) { + observer.refetch(); + } + (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue(); + }; + _proto.addObserver = function addObserver(observer) { + if (this.observers.indexOf(observer) === -1) { + this.observers.push(observer); + this.hadObservers = true; + this.clearGcTimeout(); + this.cache.notify({ + type: "observerAdded", + query: this, + observer + }); + } + }; + _proto.removeObserver = function removeObserver(observer) { + if (this.observers.indexOf(observer) !== -1) { + this.observers = this.observers.filter(function(x2) { + return x2 !== observer; + }); + if (!this.observers.length) { + if (this.retryer) { + if (this.retryer.isTransportCancelable || this.abortSignalConsumed) { + this.retryer.cancel({ + revert: true + }); + } else { + this.retryer.cancelRetry(); + } + } + if (this.cacheTime) { + this.scheduleGc(); + } else { + this.cache.remove(this); + } + } + this.cache.notify({ + type: "observerRemoved", + query: this, + observer + }); + } + }; + _proto.getObserversCount = function getObserversCount() { + return this.observers.length; + }; + _proto.invalidate = function invalidate() { + if (!this.state.isInvalidated) { + this.dispatch({ + type: "invalidate" + }); + } + }; + _proto.fetch = function fetch(options, fetchOptions) { + var _this2 = this, _this$options$behavio, _context$fetchOptions, _abortController$abor; + if (this.state.isFetching) { + if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { + this.cancel({ + silent: true + }); + } else if (this.promise) { + var _this$retryer4; + (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); + return this.promise; + } + } + if (options) { + this.setOptions(options); + } + if (!this.options.queryFn) { + var observer = this.observers.find(function(x2) { + return x2.options.queryFn; + }); + if (observer) { + this.setOptions(observer.options); + } + } + var queryKey = ensureQueryKeyArray(this.queryKey); + var abortController = getAbortController(); + var queryFnContext = { + queryKey, + pageParam: void 0, + meta: this.meta + }; + Object.defineProperty(queryFnContext, "signal", { + enumerable: true, + get: function get() { + if (abortController) { + _this2.abortSignalConsumed = true; + return abortController.signal; + } + return void 0; + } + }); + var fetchFn = function fetchFn2() { + if (!_this2.options.queryFn) { + return Promise.reject("Missing queryFn"); + } + _this2.abortSignalConsumed = false; + return _this2.options.queryFn(queryFnContext); + }; + var context = { + fetchOptions, + options: this.options, + queryKey, + state: this.state, + fetchFn, + meta: this.meta + }; + if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) { + var _this$options$behavio2; + (_this$options$behavio2 = this.options.behavior) == null ? void 0 : _this$options$behavio2.onFetch(context); + } + this.revertState = this.state; + if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) { + var _context$fetchOptions2; + this.dispatch({ + type: "fetch", + meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta + }); + } + this.retryer = new Retryer({ + fn: context.fetchFn, + abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController), + onSuccess: function onSuccess(data) { + _this2.setData(data); + _this2.cache.config.onSuccess == null ? void 0 : _this2.cache.config.onSuccess(data, _this2); + if (_this2.cacheTime === 0) { + _this2.optionalRemove(); + } + }, + onError: function onError(error) { + if (!(isCancelledError(error) && error.silent)) { + _this2.dispatch({ + type: "error", + error + }); + } + if (!isCancelledError(error)) { + _this2.cache.config.onError == null ? void 0 : _this2.cache.config.onError(error, _this2); + getLogger().error(error); + } + if (_this2.cacheTime === 0) { + _this2.optionalRemove(); + } + }, + onFail: function onFail() { + _this2.dispatch({ + type: "failed" + }); + }, + onPause: function onPause() { + _this2.dispatch({ + type: "pause" + }); + }, + onContinue: function onContinue() { + _this2.dispatch({ + type: "continue" + }); + }, + retry: context.options.retry, + retryDelay: context.options.retryDelay + }); + this.promise = this.retryer.promise; + return this.promise; + }; + _proto.dispatch = function dispatch(action) { + var _this3 = this; + this.state = this.reducer(this.state, action); + notifyManager.batch(function() { + _this3.observers.forEach(function(observer) { + observer.onQueryUpdate(action); + }); + _this3.cache.notify({ + query: _this3, + type: "queryUpdated", + action + }); + }); + }; + _proto.getDefaultState = function getDefaultState2(options) { + var data = typeof options.initialData === "function" ? options.initialData() : options.initialData; + var hasInitialData = typeof options.initialData !== "undefined"; + var initialDataUpdatedAt = hasInitialData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; + var hasData = typeof data !== "undefined"; + return { + data, + dataUpdateCount: 0, + dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0, + error: null, + errorUpdateCount: 0, + errorUpdatedAt: 0, + fetchFailureCount: 0, + fetchMeta: null, + isFetching: false, + isInvalidated: false, + isPaused: false, + status: hasData ? "success" : "idle" + }; + }; + _proto.reducer = function reducer3(state, action) { + var _action$meta, _action$dataUpdatedAt; + switch (action.type) { + case "failed": + return _extends({}, state, { + fetchFailureCount: state.fetchFailureCount + 1 + }); + case "pause": + return _extends({}, state, { + isPaused: true + }); + case "continue": + return _extends({}, state, { + isPaused: false + }); + case "fetch": + return _extends({}, state, { + fetchFailureCount: 0, + fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null, + isFetching: true, + isPaused: false + }, !state.dataUpdatedAt && { + error: null, + status: "loading" + }); + case "success": + return _extends({}, state, { + data: action.data, + dataUpdateCount: state.dataUpdateCount + 1, + dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(), + error: null, + fetchFailureCount: 0, + isFetching: false, + isInvalidated: false, + isPaused: false, + status: "success" + }); + case "error": + var error = action.error; + if (isCancelledError(error) && error.revert && this.revertState) { + return _extends({}, this.revertState); + } + return _extends({}, state, { + error, + errorUpdateCount: state.errorUpdateCount + 1, + errorUpdatedAt: Date.now(), + fetchFailureCount: state.fetchFailureCount + 1, + isFetching: false, + isPaused: false, + status: "error" + }); + case "invalidate": + return _extends({}, state, { + isInvalidated: true + }); + case "setState": + return _extends({}, state, action.state); + default: + return state; + } + }; + return Query2; + }(); + + // ../../node_modules/react-query/es/core/queryCache.js + var QueryCache = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(QueryCache2, _Subscribable); + function QueryCache2(config) { + var _this; + _this = _Subscribable.call(this) || this; + _this.config = config || {}; + _this.queries = []; + _this.queriesMap = {}; + return _this; + } + var _proto = QueryCache2.prototype; + _proto.build = function build(client, options, state) { + var _options$queryHash; + var queryKey = options.queryKey; + var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options); + var query = this.get(queryHash); + if (!query) { + query = new Query({ + cache: this, + queryKey, + queryHash, + options: client.defaultQueryOptions(options), + state, + defaultOptions: client.getQueryDefaults(queryKey), + meta: options.meta + }); + this.add(query); + } + return query; + }; + _proto.add = function add(query) { + if (!this.queriesMap[query.queryHash]) { + this.queriesMap[query.queryHash] = query; + this.queries.push(query); + this.notify({ + type: "queryAdded", + query + }); + } + }; + _proto.remove = function remove(query) { + var queryInMap = this.queriesMap[query.queryHash]; + if (queryInMap) { + query.destroy(); + this.queries = this.queries.filter(function(x2) { + return x2 !== query; + }); + if (queryInMap === query) { + delete this.queriesMap[query.queryHash]; + } + this.notify({ + type: "queryRemoved", + query + }); + } + }; + _proto.clear = function clear() { + var _this2 = this; + notifyManager.batch(function() { + _this2.queries.forEach(function(query) { + _this2.remove(query); + }); + }); + }; + _proto.get = function get(queryHash) { + return this.queriesMap[queryHash]; + }; + _proto.getAll = function getAll() { + return this.queries; + }; + _proto.find = function find(arg1, arg2) { + var _parseFilterArgs = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs[0]; + if (typeof filters.exact === "undefined") { + filters.exact = true; + } + return this.queries.find(function(query) { + return matchQuery(filters, query); + }); + }; + _proto.findAll = function findAll(arg1, arg2) { + var _parseFilterArgs2 = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs2[0]; + return Object.keys(filters).length > 0 ? this.queries.filter(function(query) { + return matchQuery(filters, query); + }) : this.queries; + }; + _proto.notify = function notify(event) { + var _this3 = this; + notifyManager.batch(function() { + _this3.listeners.forEach(function(listener) { + listener(event); + }); + }); + }; + _proto.onFocus = function onFocus() { + var _this4 = this; + notifyManager.batch(function() { + _this4.queries.forEach(function(query) { + query.onFocus(); + }); + }); + }; + _proto.onOnline = function onOnline() { + var _this5 = this; + notifyManager.batch(function() { + _this5.queries.forEach(function(query) { + query.onOnline(); + }); + }); + }; + return QueryCache2; + }(Subscribable); + + // ../../node_modules/react-query/es/core/mutation.js + var Mutation = /* @__PURE__ */ function() { + function Mutation2(config) { + this.options = _extends({}, config.defaultOptions, config.options); + this.mutationId = config.mutationId; + this.mutationCache = config.mutationCache; + this.observers = []; + this.state = config.state || getDefaultState(); + this.meta = config.meta; + } + var _proto = Mutation2.prototype; + _proto.setState = function setState(state) { + this.dispatch({ + type: "setState", + state + }); + }; + _proto.addObserver = function addObserver(observer) { + if (this.observers.indexOf(observer) === -1) { + this.observers.push(observer); + } + }; + _proto.removeObserver = function removeObserver(observer) { + this.observers = this.observers.filter(function(x2) { + return x2 !== observer; + }); + }; + _proto.cancel = function cancel() { + if (this.retryer) { + this.retryer.cancel(); + return this.retryer.promise.then(noop2).catch(noop2); + } + return Promise.resolve(); + }; + _proto.continue = function _continue() { + if (this.retryer) { + this.retryer.continue(); + return this.retryer.promise; + } + return this.execute(); + }; + _proto.execute = function execute() { + var _this = this; + var data; + var restored = this.state.status === "loading"; + var promise = Promise.resolve(); + if (!restored) { + this.dispatch({ + type: "loading", + variables: this.options.variables + }); + promise = promise.then(function() { + _this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this); + }).then(function() { + return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables); + }).then(function(context) { + if (context !== _this.state.context) { + _this.dispatch({ + type: "loading", + context, + variables: _this.state.variables + }); + } + }); + } + return promise.then(function() { + return _this.executeMutation(); + }).then(function(result) { + data = result; + _this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this); + }).then(function() { + return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context); + }).then(function() { + return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context); + }).then(function() { + _this.dispatch({ + type: "success", + data + }); + return data; + }).catch(function(error) { + _this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); + getLogger().error(error); + return Promise.resolve().then(function() { + return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context); + }).then(function() { + return _this.options.onSettled == null ? void 0 : _this.options.onSettled(void 0, error, _this.state.variables, _this.state.context); + }).then(function() { + _this.dispatch({ + type: "error", + error + }); + throw error; + }); + }); + }; + _proto.executeMutation = function executeMutation() { + var _this2 = this, _this$options$retry; + this.retryer = new Retryer({ + fn: function fn3() { + if (!_this2.options.mutationFn) { + return Promise.reject("No mutationFn found"); + } + return _this2.options.mutationFn(_this2.state.variables); + }, + onFail: function onFail() { + _this2.dispatch({ + type: "failed" + }); + }, + onPause: function onPause() { + _this2.dispatch({ + type: "pause" + }); + }, + onContinue: function onContinue() { + _this2.dispatch({ + type: "continue" + }); + }, + retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0, + retryDelay: this.options.retryDelay + }); + return this.retryer.promise; + }; + _proto.dispatch = function dispatch(action) { + var _this3 = this; + this.state = reducer2(this.state, action); + notifyManager.batch(function() { + _this3.observers.forEach(function(observer) { + observer.onMutationUpdate(action); + }); + _this3.mutationCache.notify(_this3); + }); + }; + return Mutation2; + }(); + function getDefaultState() { + return { + context: void 0, + data: void 0, + error: null, + failureCount: 0, + isPaused: false, + status: "idle", + variables: void 0 + }; + } + function reducer2(state, action) { + switch (action.type) { + case "failed": + return _extends({}, state, { + failureCount: state.failureCount + 1 + }); + case "pause": + return _extends({}, state, { + isPaused: true + }); + case "continue": + return _extends({}, state, { + isPaused: false + }); + case "loading": + return _extends({}, state, { + context: action.context, + data: void 0, + error: null, + isPaused: false, + status: "loading", + variables: action.variables + }); + case "success": + return _extends({}, state, { + data: action.data, + error: null, + status: "success", + isPaused: false + }); + case "error": + return _extends({}, state, { + data: void 0, + error: action.error, + failureCount: state.failureCount + 1, + isPaused: false, + status: "error" + }); + case "setState": + return _extends({}, state, action.state); + default: + return state; + } + } + + // ../../node_modules/react-query/es/core/mutationCache.js + var MutationCache = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(MutationCache2, _Subscribable); + function MutationCache2(config) { + var _this; + _this = _Subscribable.call(this) || this; + _this.config = config || {}; + _this.mutations = []; + _this.mutationId = 0; + return _this; + } + var _proto = MutationCache2.prototype; + _proto.build = function build(client, options, state) { + var mutation = new Mutation({ + mutationCache: this, + mutationId: ++this.mutationId, + options: client.defaultMutationOptions(options), + state, + defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : void 0, + meta: options.meta + }); + this.add(mutation); + return mutation; + }; + _proto.add = function add(mutation) { + this.mutations.push(mutation); + this.notify(mutation); + }; + _proto.remove = function remove(mutation) { + this.mutations = this.mutations.filter(function(x2) { + return x2 !== mutation; + }); + mutation.cancel(); + this.notify(mutation); + }; + _proto.clear = function clear() { + var _this2 = this; + notifyManager.batch(function() { + _this2.mutations.forEach(function(mutation) { + _this2.remove(mutation); + }); + }); + }; + _proto.getAll = function getAll() { + return this.mutations; + }; + _proto.find = function find(filters) { + if (typeof filters.exact === "undefined") { + filters.exact = true; + } + return this.mutations.find(function(mutation) { + return matchMutation(filters, mutation); + }); + }; + _proto.findAll = function findAll(filters) { + return this.mutations.filter(function(mutation) { + return matchMutation(filters, mutation); + }); + }; + _proto.notify = function notify(mutation) { + var _this3 = this; + notifyManager.batch(function() { + _this3.listeners.forEach(function(listener) { + listener(mutation); + }); + }); + }; + _proto.onFocus = function onFocus() { + this.resumePausedMutations(); + }; + _proto.onOnline = function onOnline() { + this.resumePausedMutations(); + }; + _proto.resumePausedMutations = function resumePausedMutations() { + var pausedMutations = this.mutations.filter(function(x2) { + return x2.state.isPaused; + }); + return notifyManager.batch(function() { + return pausedMutations.reduce(function(promise, mutation) { + return promise.then(function() { + return mutation.continue().catch(noop2); + }); + }, Promise.resolve()); + }); + }; + return MutationCache2; + }(Subscribable); + + // ../../node_modules/react-query/es/core/infiniteQueryBehavior.js + function infiniteQueryBehavior() { + return { + onFetch: function onFetch(context) { + context.fetchFn = function() { + var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2; + var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage; + var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore; + var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam; + var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === "forward"; + var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === "backward"; + var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || []; + var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || []; + var abortController = getAbortController(); + var abortSignal = abortController == null ? void 0 : abortController.signal; + var newPageParams = oldPageParams; + var cancelled = false; + var queryFn = context.options.queryFn || function() { + return Promise.reject("Missing queryFn"); + }; + var buildNewPages = function buildNewPages2(pages, param2, page, previous) { + newPageParams = previous ? [param2].concat(newPageParams) : [].concat(newPageParams, [param2]); + return previous ? [page].concat(pages) : [].concat(pages, [page]); + }; + var fetchPage = function fetchPage2(pages, manual2, param2, previous) { + if (cancelled) { + return Promise.reject("Cancelled"); + } + if (typeof param2 === "undefined" && !manual2 && pages.length) { + return Promise.resolve(pages); + } + var queryFnContext = { + queryKey: context.queryKey, + signal: abortSignal, + pageParam: param2, + meta: context.meta + }; + var queryFnResult = queryFn(queryFnContext); + var promise2 = Promise.resolve(queryFnResult).then(function(page) { + return buildNewPages(pages, param2, page, previous); + }); + if (isCancelable(queryFnResult)) { + var promiseAsAny = promise2; + promiseAsAny.cancel = queryFnResult.cancel; + } + return promise2; + }; + var promise; + if (!oldPages.length) { + promise = fetchPage([]); + } else if (isFetchingNextPage) { + var manual = typeof pageParam !== "undefined"; + var param = manual ? pageParam : getNextPageParam(context.options, oldPages); + promise = fetchPage(oldPages, manual, param); + } else if (isFetchingPreviousPage) { + var _manual = typeof pageParam !== "undefined"; + var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages); + promise = fetchPage(oldPages, _manual, _param, true); + } else { + (function() { + newPageParams = []; + var manual2 = typeof context.options.getNextPageParam === "undefined"; + var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; + promise = shouldFetchFirstPage ? fetchPage([], manual2, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); + var _loop = function _loop2(i3) { + promise = promise.then(function(pages) { + var shouldFetchNextPage = refetchPage && oldPages[i3] ? refetchPage(oldPages[i3], i3, oldPages) : true; + if (shouldFetchNextPage) { + var _param2 = manual2 ? oldPageParams[i3] : getNextPageParam(context.options, pages); + return fetchPage(pages, manual2, _param2); + } + return Promise.resolve(buildNewPages(pages, oldPageParams[i3], oldPages[i3])); + }); + }; + for (var i2 = 1; i2 < oldPages.length; i2++) { + _loop(i2); + } + })(); + } + var finalPromise = promise.then(function(pages) { + return { + pages, + pageParams: newPageParams + }; + }); + var finalPromiseAsAny = finalPromise; + finalPromiseAsAny.cancel = function() { + cancelled = true; + abortController == null ? void 0 : abortController.abort(); + if (isCancelable(promise)) { + promise.cancel(); + } + }; + return finalPromise; + }; + } + }; + } + function getNextPageParam(options, pages) { + return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages); + } + function getPreviousPageParam(options, pages) { + return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages); + } + + // ../../node_modules/react-query/es/core/queryClient.js + var QueryClient = /* @__PURE__ */ function() { + function QueryClient2(config) { + if (config === void 0) { + config = {}; + } + this.queryCache = config.queryCache || new QueryCache(); + this.mutationCache = config.mutationCache || new MutationCache(); + this.defaultOptions = config.defaultOptions || {}; + this.queryDefaults = []; + this.mutationDefaults = []; + } + var _proto = QueryClient2.prototype; + _proto.mount = function mount() { + var _this = this; + this.unsubscribeFocus = focusManager.subscribe(function() { + if (focusManager.isFocused() && onlineManager.isOnline()) { + _this.mutationCache.onFocus(); + _this.queryCache.onFocus(); + } + }); + this.unsubscribeOnline = onlineManager.subscribe(function() { + if (focusManager.isFocused() && onlineManager.isOnline()) { + _this.mutationCache.onOnline(); + _this.queryCache.onOnline(); + } + }); + }; + _proto.unmount = function unmount() { + var _this$unsubscribeFocu, _this$unsubscribeOnli; + (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this); + (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this); + }; + _proto.isFetching = function isFetching(arg1, arg2) { + var _parseFilterArgs = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs[0]; + filters.fetching = true; + return this.queryCache.findAll(filters).length; + }; + _proto.isMutating = function isMutating(filters) { + return this.mutationCache.findAll(_extends({}, filters, { + fetching: true + })).length; + }; + _proto.getQueryData = function getQueryData(queryKey, filters) { + var _this$queryCache$find; + return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data; + }; + _proto.getQueriesData = function getQueriesData(queryKeyOrFilters) { + return this.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref) { + var queryKey = _ref.queryKey, state = _ref.state; + var data = state.data; + return [queryKey, data]; + }); + }; + _proto.setQueryData = function setQueryData(queryKey, updater, options) { + var parsedOptions = parseQueryArgs(queryKey); + var defaultedOptions = this.defaultQueryOptions(parsedOptions); + return this.queryCache.build(this, defaultedOptions).setData(updater, options); + }; + _proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) { + var _this2 = this; + return notifyManager.batch(function() { + return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref2) { + var queryKey = _ref2.queryKey; + return [queryKey, _this2.setQueryData(queryKey, updater, options)]; + }); + }); + }; + _proto.getQueryState = function getQueryState(queryKey, filters) { + var _this$queryCache$find2; + return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state; + }; + _proto.removeQueries = function removeQueries(arg1, arg2) { + var _parseFilterArgs2 = parseFilterArgs(arg1, arg2), filters = _parseFilterArgs2[0]; + var queryCache = this.queryCache; + notifyManager.batch(function() { + queryCache.findAll(filters).forEach(function(query) { + queryCache.remove(query); + }); + }); + }; + _proto.resetQueries = function resetQueries(arg1, arg2, arg3) { + var _this3 = this; + var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs3[0], options = _parseFilterArgs3[1]; + var queryCache = this.queryCache; + var refetchFilters = _extends({}, filters, { + active: true + }); + return notifyManager.batch(function() { + queryCache.findAll(filters).forEach(function(query) { + query.reset(); + }); + return _this3.refetchQueries(refetchFilters, options); + }); + }; + _proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) { + var _this4 = this; + var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs4[0], _parseFilterArgs4$ = _parseFilterArgs4[1], cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$; + if (typeof cancelOptions.revert === "undefined") { + cancelOptions.revert = true; + } + var promises = notifyManager.batch(function() { + return _this4.queryCache.findAll(filters).map(function(query) { + return query.cancel(cancelOptions); + }); + }); + return Promise.all(promises).then(noop2).catch(noop2); + }; + _proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) { + var _ref3, _filters$refetchActiv, _filters$refetchInact, _this5 = this; + var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs5[0], options = _parseFilterArgs5[1]; + var refetchFilters = _extends({}, filters, { + active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true, + inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false + }); + return notifyManager.batch(function() { + _this5.queryCache.findAll(filters).forEach(function(query) { + query.invalidate(); + }); + return _this5.refetchQueries(refetchFilters, options); + }); + }; + _proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) { + var _this6 = this; + var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3), filters = _parseFilterArgs6[0], options = _parseFilterArgs6[1]; + var promises = notifyManager.batch(function() { + return _this6.queryCache.findAll(filters).map(function(query) { + return query.fetch(void 0, _extends({}, options, { + meta: { + refetchPage: filters == null ? void 0 : filters.refetchPage + } + })); + }); + }); + var promise = Promise.all(promises).then(noop2); + if (!(options == null ? void 0 : options.throwOnError)) { + promise = promise.catch(noop2); + } + return promise; + }; + _proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) { + var parsedOptions = parseQueryArgs(arg1, arg2, arg3); + var defaultedOptions = this.defaultQueryOptions(parsedOptions); + if (typeof defaultedOptions.retry === "undefined") { + defaultedOptions.retry = false; + } + var query = this.queryCache.build(this, defaultedOptions); + return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + }; + _proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) { + return this.fetchQuery(arg1, arg2, arg3).then(noop2).catch(noop2); + }; + _proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) { + var parsedOptions = parseQueryArgs(arg1, arg2, arg3); + parsedOptions.behavior = infiniteQueryBehavior(); + return this.fetchQuery(parsedOptions); + }; + _proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) { + return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop2).catch(noop2); + }; + _proto.cancelMutations = function cancelMutations() { + var _this7 = this; + var promises = notifyManager.batch(function() { + return _this7.mutationCache.getAll().map(function(mutation) { + return mutation.cancel(); + }); + }); + return Promise.all(promises).then(noop2).catch(noop2); + }; + _proto.resumePausedMutations = function resumePausedMutations() { + return this.getMutationCache().resumePausedMutations(); + }; + _proto.executeMutation = function executeMutation(options) { + return this.mutationCache.build(this, options).execute(); + }; + _proto.getQueryCache = function getQueryCache() { + return this.queryCache; + }; + _proto.getMutationCache = function getMutationCache() { + return this.mutationCache; + }; + _proto.getDefaultOptions = function getDefaultOptions() { + return this.defaultOptions; + }; + _proto.setDefaultOptions = function setDefaultOptions(options) { + this.defaultOptions = options; + }; + _proto.setQueryDefaults = function setQueryDefaults(queryKey, options) { + var result = this.queryDefaults.find(function(x2) { + return hashQueryKey(queryKey) === hashQueryKey(x2.queryKey); + }); + if (result) { + result.defaultOptions = options; + } else { + this.queryDefaults.push({ + queryKey, + defaultOptions: options + }); + } + }; + _proto.getQueryDefaults = function getQueryDefaults(queryKey) { + var _this$queryDefaults$f; + return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function(x2) { + return partialMatchKey(queryKey, x2.queryKey); + })) == null ? void 0 : _this$queryDefaults$f.defaultOptions : void 0; + }; + _proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) { + var result = this.mutationDefaults.find(function(x2) { + return hashQueryKey(mutationKey) === hashQueryKey(x2.mutationKey); + }); + if (result) { + result.defaultOptions = options; + } else { + this.mutationDefaults.push({ + mutationKey, + defaultOptions: options + }); + } + }; + _proto.getMutationDefaults = function getMutationDefaults(mutationKey) { + var _this$mutationDefault; + return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function(x2) { + return partialMatchKey(mutationKey, x2.mutationKey); + })) == null ? void 0 : _this$mutationDefault.defaultOptions : void 0; + }; + _proto.defaultQueryOptions = function defaultQueryOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; + } + var defaultedOptions = _extends({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, { + _defaulted: true + }); + if (!defaultedOptions.queryHash && defaultedOptions.queryKey) { + defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions); + } + return defaultedOptions; + }; + _proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) { + return this.defaultQueryOptions(options); + }; + _proto.defaultMutationOptions = function defaultMutationOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; + } + return _extends({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, { + _defaulted: true + }); + }; + _proto.clear = function clear() { + this.queryCache.clear(); + this.mutationCache.clear(); + }; + return QueryClient2; + }(); + + // ../../node_modules/react-query/es/core/queryObserver.js + var QueryObserver = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(QueryObserver2, _Subscribable); + function QueryObserver2(client, options) { + var _this; + _this = _Subscribable.call(this) || this; + _this.client = client; + _this.options = options; + _this.trackedProps = []; + _this.selectError = null; + _this.bindMethods(); + _this.setOptions(options); + return _this; + } + var _proto = QueryObserver2.prototype; + _proto.bindMethods = function bindMethods() { + this.remove = this.remove.bind(this); + this.refetch = this.refetch.bind(this); + }; + _proto.onSubscribe = function onSubscribe() { + if (this.listeners.length === 1) { + this.currentQuery.addObserver(this); + if (shouldFetchOnMount(this.currentQuery, this.options)) { + this.executeFetch(); + } + this.updateTimers(); + } + }; + _proto.onUnsubscribe = function onUnsubscribe() { + if (!this.listeners.length) { + this.destroy(); + } + }; + _proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() { + return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect); + }; + _proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() { + return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus); + }; + _proto.destroy = function destroy() { + this.listeners = []; + this.clearTimers(); + this.currentQuery.removeObserver(this); + }; + _proto.setOptions = function setOptions(options, notifyOptions) { + var prevOptions = this.options; + var prevQuery = this.currentQuery; + this.options = this.client.defaultQueryObserverOptions(options); + if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") { + throw new Error("Expected enabled to be a boolean"); + } + if (!this.options.queryKey) { + this.options.queryKey = prevOptions.queryKey; + } + this.updateQuery(); + var mounted = this.hasListeners(); + if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) { + this.executeFetch(); + } + this.updateResult(notifyOptions); + if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) { + this.updateStaleTimeout(); + } + var nextRefetchInterval = this.computeRefetchInterval(); + if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) { + this.updateRefetchInterval(nextRefetchInterval); + } + }; + _proto.getOptimisticResult = function getOptimisticResult(options) { + var defaultedOptions = this.client.defaultQueryObserverOptions(options); + var query = this.client.getQueryCache().build(this.client, defaultedOptions); + return this.createResult(query, defaultedOptions); + }; + _proto.getCurrentResult = function getCurrentResult() { + return this.currentResult; + }; + _proto.trackResult = function trackResult(result, defaultedOptions) { + var _this2 = this; + var trackedResult = {}; + var trackProp = function trackProp2(key) { + if (!_this2.trackedProps.includes(key)) { + _this2.trackedProps.push(key); + } + }; + Object.keys(result).forEach(function(key) { + Object.defineProperty(trackedResult, key, { + configurable: false, + enumerable: true, + get: function get() { + trackProp(key); + return result[key]; + } + }); + }); + if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) { + trackProp("error"); + } + return trackedResult; + }; + _proto.getNextResult = function getNextResult(options) { + var _this3 = this; + return new Promise(function(resolve, reject) { + var unsubscribe = _this3.subscribe(function(result) { + if (!result.isFetching) { + unsubscribe(); + if (result.isError && (options == null ? void 0 : options.throwOnError)) { + reject(result.error); + } else { + resolve(result); + } + } + }); + }); + }; + _proto.getCurrentQuery = function getCurrentQuery() { + return this.currentQuery; + }; + _proto.remove = function remove() { + this.client.getQueryCache().remove(this.currentQuery); + }; + _proto.refetch = function refetch(options) { + return this.fetch(_extends({}, options, { + meta: { + refetchPage: options == null ? void 0 : options.refetchPage + } + })); + }; + _proto.fetchOptimistic = function fetchOptimistic(options) { + var _this4 = this; + var defaultedOptions = this.client.defaultQueryObserverOptions(options); + var query = this.client.getQueryCache().build(this.client, defaultedOptions); + return query.fetch().then(function() { + return _this4.createResult(query, defaultedOptions); + }); + }; + _proto.fetch = function fetch(fetchOptions) { + var _this5 = this; + return this.executeFetch(fetchOptions).then(function() { + _this5.updateResult(); + return _this5.currentResult; + }); + }; + _proto.executeFetch = function executeFetch(fetchOptions) { + this.updateQuery(); + var promise = this.currentQuery.fetch(this.options, fetchOptions); + if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { + promise = promise.catch(noop2); + } + return promise; + }; + _proto.updateStaleTimeout = function updateStaleTimeout() { + var _this6 = this; + this.clearStaleTimeout(); + if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) { + return; + } + var time = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); + var timeout = time + 1; + this.staleTimeoutId = setTimeout(function() { + if (!_this6.currentResult.isStale) { + _this6.updateResult(); + } + }, timeout); + }; + _proto.computeRefetchInterval = function computeRefetchInterval() { + var _this$options$refetch; + return typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false; + }; + _proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) { + var _this7 = this; + this.clearRefetchInterval(); + this.currentRefetchInterval = nextInterval; + if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) { + return; + } + this.refetchIntervalId = setInterval(function() { + if (_this7.options.refetchIntervalInBackground || focusManager.isFocused()) { + _this7.executeFetch(); + } + }, this.currentRefetchInterval); + }; + _proto.updateTimers = function updateTimers() { + this.updateStaleTimeout(); + this.updateRefetchInterval(this.computeRefetchInterval()); + }; + _proto.clearTimers = function clearTimers() { + this.clearStaleTimeout(); + this.clearRefetchInterval(); + }; + _proto.clearStaleTimeout = function clearStaleTimeout() { + if (this.staleTimeoutId) { + clearTimeout(this.staleTimeoutId); + this.staleTimeoutId = void 0; + } + }; + _proto.clearRefetchInterval = function clearRefetchInterval() { + if (this.refetchIntervalId) { + clearInterval(this.refetchIntervalId); + this.refetchIntervalId = void 0; + } + }; + _proto.createResult = function createResult(query, options) { + var prevQuery = this.currentQuery; + var prevOptions = this.options; + var prevResult = this.currentResult; + var prevResultState = this.currentResultState; + var prevResultOptions = this.currentResultOptions; + var queryChange = query !== prevQuery; + var queryInitialState = queryChange ? query.state : this.currentQueryInitialState; + var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult; + var state = query.state; + var dataUpdatedAt = state.dataUpdatedAt, error = state.error, errorUpdatedAt = state.errorUpdatedAt, isFetching = state.isFetching, status = state.status; + var isPreviousData = false; + var isPlaceholderData = false; + var data; + if (options.optimisticResults) { + var mounted = this.hasListeners(); + var fetchOnMount = !mounted && shouldFetchOnMount(query, options); + var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); + if (fetchOnMount || fetchOptionally) { + isFetching = true; + if (!dataUpdatedAt) { + status = "loading"; + } + } + } + if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== "error") { + data = prevQueryResult.data; + dataUpdatedAt = prevQueryResult.dataUpdatedAt; + status = prevQueryResult.status; + isPreviousData = true; + } else if (options.select && typeof state.data !== "undefined") { + if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) { + data = this.selectResult; + } else { + try { + this.selectFn = options.select; + data = options.select(state.data); + if (options.structuralSharing !== false) { + data = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, data); + } + this.selectResult = data; + this.selectError = null; + } catch (selectError) { + getLogger().error(selectError); + this.selectError = selectError; + } + } + } else { + data = state.data; + } + if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && (status === "loading" || status === "idle")) { + var placeholderData; + if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { + placeholderData = prevResult.data; + } else { + placeholderData = typeof options.placeholderData === "function" ? options.placeholderData() : options.placeholderData; + if (options.select && typeof placeholderData !== "undefined") { + try { + placeholderData = options.select(placeholderData); + if (options.structuralSharing !== false) { + placeholderData = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, placeholderData); + } + this.selectError = null; + } catch (selectError) { + getLogger().error(selectError); + this.selectError = selectError; + } + } + } + if (typeof placeholderData !== "undefined") { + status = "success"; + data = placeholderData; + isPlaceholderData = true; + } + } + if (this.selectError) { + error = this.selectError; + data = this.selectResult; + errorUpdatedAt = Date.now(); + status = "error"; + } + var result = { + status, + isLoading: status === "loading", + isSuccess: status === "success", + isError: status === "error", + isIdle: status === "idle", + data, + dataUpdatedAt, + error, + errorUpdatedAt, + failureCount: state.fetchFailureCount, + errorUpdateCount: state.errorUpdateCount, + isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, + isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, + isFetching, + isRefetching: isFetching && status !== "loading", + isLoadingError: status === "error" && state.dataUpdatedAt === 0, + isPlaceholderData, + isPreviousData, + isRefetchError: status === "error" && state.dataUpdatedAt !== 0, + isStale: isStale(query, options), + refetch: this.refetch, + remove: this.remove + }; + return result; + }; + _proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) { + if (!prevResult) { + return true; + } + var _this$options = this.options, notifyOnChangeProps = _this$options.notifyOnChangeProps, notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions; + if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) { + return true; + } + if (notifyOnChangeProps === "tracked" && !this.trackedProps.length) { + return true; + } + var includedProps = notifyOnChangeProps === "tracked" ? this.trackedProps : notifyOnChangeProps; + return Object.keys(result).some(function(key) { + var typedKey = key; + var changed = result[typedKey] !== prevResult[typedKey]; + var isIncluded = includedProps == null ? void 0 : includedProps.some(function(x2) { + return x2 === key; + }); + var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function(x2) { + return x2 === key; + }); + return changed && !isExcluded && (!includedProps || isIncluded); + }); + }; + _proto.updateResult = function updateResult(notifyOptions) { + var prevResult = this.currentResult; + this.currentResult = this.createResult(this.currentQuery, this.options); + this.currentResultState = this.currentQuery.state; + this.currentResultOptions = this.options; + if (shallowEqualObjects(this.currentResult, prevResult)) { + return; + } + var defaultNotifyOptions = { + cache: true + }; + if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) { + defaultNotifyOptions.listeners = true; + } + this.notify(_extends({}, defaultNotifyOptions, notifyOptions)); + }; + _proto.updateQuery = function updateQuery() { + var query = this.client.getQueryCache().build(this.client, this.options); + if (query === this.currentQuery) { + return; + } + var prevQuery = this.currentQuery; + this.currentQuery = query; + this.currentQueryInitialState = query.state; + this.previousQueryResult = this.currentResult; + if (this.hasListeners()) { + prevQuery == null ? void 0 : prevQuery.removeObserver(this); + query.addObserver(this); + } + }; + _proto.onQueryUpdate = function onQueryUpdate(action) { + var notifyOptions = {}; + if (action.type === "success") { + notifyOptions.onSuccess = true; + } else if (action.type === "error" && !isCancelledError(action.error)) { + notifyOptions.onError = true; + } + this.updateResult(notifyOptions); + if (this.hasListeners()) { + this.updateTimers(); + } + }; + _proto.notify = function notify(notifyOptions) { + var _this8 = this; + notifyManager.batch(function() { + if (notifyOptions.onSuccess) { + _this8.options.onSuccess == null ? void 0 : _this8.options.onSuccess(_this8.currentResult.data); + _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(_this8.currentResult.data, null); + } else if (notifyOptions.onError) { + _this8.options.onError == null ? void 0 : _this8.options.onError(_this8.currentResult.error); + _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(void 0, _this8.currentResult.error); + } + if (notifyOptions.listeners) { + _this8.listeners.forEach(function(listener) { + listener(_this8.currentResult); + }); + } + if (notifyOptions.cache) { + _this8.client.getQueryCache().notify({ + query: _this8.currentQuery, + type: "observerResultsUpdated" + }); + } + }); + }; + return QueryObserver2; + }(Subscribable); + function shouldLoadOnMount(query, options) { + return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options.retryOnMount === false); + } + function shouldFetchOnMount(query, options) { + return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount); + } + function shouldFetchOn(query, options, field) { + if (options.enabled !== false) { + var value = typeof field === "function" ? field(query) : field; + return value === "always" || value !== false && isStale(query, options); + } + return false; + } + function shouldFetchOptionally(query, prevQuery, options, prevOptions) { + return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); + } + function isStale(query, options) { + return query.isStaleByTime(options.staleTime); + } + + // ../../node_modules/react-query/es/core/mutationObserver.js + var MutationObserver = /* @__PURE__ */ function(_Subscribable) { + _inheritsLoose(MutationObserver2, _Subscribable); + function MutationObserver2(client, options) { + var _this; + _this = _Subscribable.call(this) || this; + _this.client = client; + _this.setOptions(options); + _this.bindMethods(); + _this.updateResult(); + return _this; + } + var _proto = MutationObserver2.prototype; + _proto.bindMethods = function bindMethods() { + this.mutate = this.mutate.bind(this); + this.reset = this.reset.bind(this); + }; + _proto.setOptions = function setOptions(options) { + this.options = this.client.defaultMutationOptions(options); + }; + _proto.onUnsubscribe = function onUnsubscribe() { + if (!this.listeners.length) { + var _this$currentMutation; + (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.removeObserver(this); + } + }; + _proto.onMutationUpdate = function onMutationUpdate(action) { + this.updateResult(); + var notifyOptions = { + listeners: true + }; + if (action.type === "success") { + notifyOptions.onSuccess = true; + } else if (action.type === "error") { + notifyOptions.onError = true; + } + this.notify(notifyOptions); + }; + _proto.getCurrentResult = function getCurrentResult() { + return this.currentResult; + }; + _proto.reset = function reset() { + this.currentMutation = void 0; + this.updateResult(); + this.notify({ + listeners: true + }); + }; + _proto.mutate = function mutate(variables, options) { + this.mutateOptions = options; + if (this.currentMutation) { + this.currentMutation.removeObserver(this); + } + this.currentMutation = this.client.getMutationCache().build(this.client, _extends({}, this.options, { + variables: typeof variables !== "undefined" ? variables : this.options.variables + })); + this.currentMutation.addObserver(this); + return this.currentMutation.execute(); + }; + _proto.updateResult = function updateResult() { + var state = this.currentMutation ? this.currentMutation.state : getDefaultState(); + var result = _extends({}, state, { + isLoading: state.status === "loading", + isSuccess: state.status === "success", + isError: state.status === "error", + isIdle: state.status === "idle", + mutate: this.mutate, + reset: this.reset + }); + this.currentResult = result; + }; + _proto.notify = function notify(options) { + var _this2 = this; + notifyManager.batch(function() { + if (_this2.mutateOptions) { + if (options.onSuccess) { + _this2.mutateOptions.onSuccess == null ? void 0 : _this2.mutateOptions.onSuccess(_this2.currentResult.data, _this2.currentResult.variables, _this2.currentResult.context); + _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(_this2.currentResult.data, null, _this2.currentResult.variables, _this2.currentResult.context); + } else if (options.onError) { + _this2.mutateOptions.onError == null ? void 0 : _this2.mutateOptions.onError(_this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); + _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(void 0, _this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); + } + } + if (options.listeners) { + _this2.listeners.forEach(function(listener) { + listener(_this2.currentResult); + }); + } + }); + }; + return MutationObserver2; + }(Subscribable); + + // ../../node_modules/react-query/es/react/reactBatchedUpdates.js + var import_react_dom = __toESM(require_react_dom()); + var unstable_batchedUpdates = import_react_dom.default.unstable_batchedUpdates; + + // ../../node_modules/react-query/es/react/setBatchUpdatesFn.js + notifyManager.setBatchNotifyFunction(unstable_batchedUpdates); + + // ../../node_modules/react-query/es/react/logger.js + var logger2 = console; + + // ../../node_modules/react-query/es/react/setLogger.js + setLogger(logger2); + + // ../../node_modules/react-query/es/react/QueryClientProvider.js + var import_react2 = __toESM(require_react()); + var defaultContext = /* @__PURE__ */ import_react2.default.createContext(void 0); + var QueryClientSharingContext = /* @__PURE__ */ import_react2.default.createContext(false); + function getQueryClientContext(contextSharing) { + if (contextSharing && typeof window !== "undefined") { + if (!window.ReactQueryClientContext) { + window.ReactQueryClientContext = defaultContext; + } + return window.ReactQueryClientContext; + } + return defaultContext; + } + var useQueryClient = function useQueryClient2() { + var queryClient = import_react2.default.useContext(getQueryClientContext(import_react2.default.useContext(QueryClientSharingContext))); + if (!queryClient) { + throw new Error("No QueryClient set, use QueryClientProvider to set one"); + } + return queryClient; + }; + var QueryClientProvider = function QueryClientProvider2(_ref) { + var client = _ref.client, _ref$contextSharing = _ref.contextSharing, contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing, children = _ref.children; + import_react2.default.useEffect(function() { + client.mount(); + return function() { + client.unmount(); + }; + }, [client]); + var Context2 = getQueryClientContext(contextSharing); + return /* @__PURE__ */ import_react2.default.createElement(QueryClientSharingContext.Provider, { + value: contextSharing + }, /* @__PURE__ */ import_react2.default.createElement(Context2.Provider, { + value: client + }, children)); + }; + + // ../../node_modules/react-query/es/react/QueryErrorResetBoundary.js + var import_react3 = __toESM(require_react()); + function createValue() { + var _isReset = false; + return { + clearReset: function clearReset() { + _isReset = false; + }, + reset: function reset() { + _isReset = true; + }, + isReset: function isReset() { + return _isReset; + } + }; + } + var QueryErrorResetBoundaryContext = /* @__PURE__ */ import_react3.default.createContext(createValue()); + var useQueryErrorResetBoundary = function useQueryErrorResetBoundary2() { + return import_react3.default.useContext(QueryErrorResetBoundaryContext); + }; + + // ../../node_modules/react-query/es/react/useMutation.js + var import_react4 = __toESM(require_react()); + + // ../../node_modules/react-query/es/react/utils.js + function shouldThrowError(suspense, _useErrorBoundary, params) { + if (typeof _useErrorBoundary === "function") { + return _useErrorBoundary.apply(void 0, params); + } + if (typeof _useErrorBoundary === "boolean") + return _useErrorBoundary; + return !!suspense; + } + + // ../../node_modules/react-query/es/react/useMutation.js + function useMutation(arg1, arg2, arg3) { + var mountedRef = import_react4.default.useRef(false); + var _React$useState = import_react4.default.useState(0), forceUpdate = _React$useState[1]; + var options = parseMutationArgs(arg1, arg2, arg3); + var queryClient = useQueryClient(); + var obsRef = import_react4.default.useRef(); + if (!obsRef.current) { + obsRef.current = new MutationObserver(queryClient, options); + } else { + obsRef.current.setOptions(options); + } + var currentResult = obsRef.current.getCurrentResult(); + import_react4.default.useEffect(function() { + mountedRef.current = true; + var unsubscribe = obsRef.current.subscribe(notifyManager.batchCalls(function() { + if (mountedRef.current) { + forceUpdate(function(x2) { + return x2 + 1; + }); + } + })); + return function() { + mountedRef.current = false; + unsubscribe(); + }; + }, []); + var mutate = import_react4.default.useCallback(function(variables, mutateOptions) { + obsRef.current.mutate(variables, mutateOptions).catch(noop2); + }, []); + if (currentResult.error && shouldThrowError(void 0, obsRef.current.options.useErrorBoundary, [currentResult.error])) { + throw currentResult.error; + } + return _extends({}, currentResult, { + mutate, + mutateAsync: currentResult.mutate + }); + } + + // ../../node_modules/react-query/es/react/useBaseQuery.js + var import_react5 = __toESM(require_react()); + function useBaseQuery(options, Observer) { + var mountedRef = import_react5.default.useRef(false); + var _React$useState = import_react5.default.useState(0), forceUpdate = _React$useState[1]; + var queryClient = useQueryClient(); + var errorResetBoundary = useQueryErrorResetBoundary(); + var defaultedOptions = queryClient.defaultQueryObserverOptions(options); + defaultedOptions.optimisticResults = true; + if (defaultedOptions.onError) { + defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError); + } + if (defaultedOptions.onSuccess) { + defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess); + } + if (defaultedOptions.onSettled) { + defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled); + } + if (defaultedOptions.suspense) { + if (typeof defaultedOptions.staleTime !== "number") { + defaultedOptions.staleTime = 1e3; + } + if (defaultedOptions.cacheTime === 0) { + defaultedOptions.cacheTime = 1; + } + } + if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) { + if (!errorResetBoundary.isReset()) { + defaultedOptions.retryOnMount = false; + } + } + var _React$useState2 = import_react5.default.useState(function() { + return new Observer(queryClient, defaultedOptions); + }), observer = _React$useState2[0]; + var result = observer.getOptimisticResult(defaultedOptions); + import_react5.default.useEffect(function() { + mountedRef.current = true; + errorResetBoundary.clearReset(); + var unsubscribe = observer.subscribe(notifyManager.batchCalls(function() { + if (mountedRef.current) { + forceUpdate(function(x2) { + return x2 + 1; + }); + } + })); + observer.updateResult(); + return function() { + mountedRef.current = false; + unsubscribe(); + }; + }, [errorResetBoundary, observer]); + import_react5.default.useEffect(function() { + observer.setOptions(defaultedOptions, { + listeners: false + }); + }, [defaultedOptions, observer]); + if (defaultedOptions.suspense && result.isLoading) { + throw observer.fetchOptimistic(defaultedOptions).then(function(_ref) { + var data = _ref.data; + defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data); + defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null); + }).catch(function(error) { + errorResetBoundary.clearReset(); + defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error); + defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(void 0, error); + }); + } + if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, [result.error, observer.getCurrentQuery()])) { + throw result.error; + } + if (defaultedOptions.notifyOnChangeProps === "tracked") { + result = observer.trackResult(result, defaultedOptions); + } + return result; + } + + // ../../node_modules/react-query/es/react/useQuery.js + function useQuery(arg1, arg2, arg3) { + var parsedOptions = parseQueryArgs(arg1, arg2, arg3); + return useBaseQuery(parsedOptions, QueryObserver); + } + + // ../fetcher/dist/index.mjs + var import_axios = __toESM(require_axios2(), 1); + var o = import_axios.default.create(); + var u = new QueryClient({ defaultOptions: { queries: { suspense: true, refetchOnWindowFocus: false, cacheTime: 1 / 0 } } }); + async function f(t2, r = {}) { + try { + return (await o({ url: t2, withCredentials: true, ...r })).data; + } catch (e2) { + throw Error(e2); + } + } + + // src/utils/queries.tsx + function useLibraryImage(options) { + return useQuery( + ["LibraryImage", options], + () => f(`/open_api/library/image`, { + method: "GET", + params: { + id: options.id || null, + limit: options.limit || 5, + offset: options.offset || 0, + title: options.title || null, + tagId: options.tagId || null + } + }), + { + keepPreviousData: true, + onSuccess: (data) => { + } + } + ); + } + function useCreateImage() { + const queryClient = useQueryClient(); + return useMutation( + (data) => { + return f(`/open_api/library/image`, { + method: "POST", + headers: { + "content-type": "multipart/form-data" + }, + data + }); + }, + { + onSuccess: (data) => { + queryClient.setQueryData(["LibraryImage"], (oldData) => { + if (oldData && Array.isArray(oldData)) { + return [...oldData, data]; + } + return oldData; + }); + } + } + ); + } + function useDeleteImage() { + const queryClient = useQueryClient(); + return useMutation( + (id) => { + return f(`/open_api/library/image/${id}`, { + method: "DELETE" + }); + }, + { + onSuccess: (_2, id) => { + queryClient.setQueriesData(["LibraryImage"], (oldData) => { + if (oldData && Array.isArray(oldData)) { + return oldData.filter((i2) => i2.id !== id); + } + return oldData; + }); + } + } + ); + } + function useGetTags() { + return useQuery( + ["LibraryTag"], + () => f(`/open_api/library/tag`, { + method: "GET" + }), + { + keepPreviousData: true, + onSuccess: (data) => { + } + } + ); + } + function useDeleteTagAssociation() { + const queryClient = useQueryClient(); + return useMutation( + (id) => { + return f(`/open_api/library/image_tag/${id}`, { + method: "DELETE" + }); + }, + { + onSuccess: (data, id) => { + queryClient.setQueriesData(["LibraryImage"], (oldData) => { + if (oldData && Array.isArray(oldData)) { + return oldData.map((image) => { + if (image.tags && image.tags.length) { + return { + ...image, + tags: image.tags.filter( + ({ imageTag }) => imageTag.id !== id + ) + }; + } + return image; + }); + } + return oldData; + }); + } + } + ); + } + function useAssociateTag() { + const queryClient = useQueryClient(); + return useMutation( + (data) => { + return f(`/open_api/library/image_tag`, { + method: "POST", + data + }); + }, + { + onSuccess: (data) => { + queryClient.setQueriesData(["LibraryImage"], (oldData) => { + if (oldData && Array.isArray(oldData)) { + return oldData.map((image) => { + if (image.id === data.imageTag.imageId) { + return { + ...image, + tags: [...image.tags, data] + }; + } + return image; + }); + } + return oldData; + }); + } + } + ); + } + + // src/Library/assets/xmark.svg + var React15 = __toESM(require_react()); + var SvgXmark = (props) => /* @__PURE__ */ React15.createElement("svg", { + width: 19, + height: 18, + viewBox: "0 0 19 18", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React15.createElement("path", { + d: "M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z", + fill: "currentcolor" + })); + + // src/Library/assets/trash.svg + var React16 = __toESM(require_react()); + var SvgTrash = (props) => /* @__PURE__ */ React16.createElement("svg", { + width: 12, + height: 12, + viewBox: "0 0 12 12", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React16.createElement("path", { + d: "M3.91875 0.498484C4.04531 0.257609 4.30547 0.105469 4.58906 0.105469H7.41094C7.69453 0.105469 7.95469 0.257609 8.08125 0.498484L8.25 0.816406H10.5C10.9148 0.816406 11.25 1.13477 11.25 1.52734C11.25 1.91991 10.9148 2.23828 10.5 2.23828H1.5C1.08586 2.23828 0.75 1.91991 0.75 1.52734C0.75 1.13477 1.08586 0.816406 1.5 0.816406H3.75L3.91875 0.498484ZM1.47891 2.94922H10.5V10.0586C10.5 10.8428 9.82734 11.4805 9 11.4805H2.97891C2.17148 11.4805 1.47891 10.8428 1.47891 10.0586V2.94922ZM3.35391 4.72656V9.70312C3.35391 9.89863 3.54375 10.0586 3.72891 10.0586C3.95625 10.0586 4.10391 9.89863 4.10391 9.70312V4.72656C4.10391 4.53105 3.95625 4.37109 3.72891 4.37109C3.54375 4.37109 3.35391 4.53105 3.35391 4.72656ZM5.60391 4.72656V9.70312C5.60391 9.89863 5.79375 10.0586 5.97891 10.0586C6.20625 10.0586 6.375 9.89863 6.375 9.70312V4.72656C6.375 4.53105 6.20625 4.37109 5.97891 4.37109C5.79375 4.37109 5.60391 4.53105 5.60391 4.72656ZM7.875 4.72656V9.70312C7.875 9.89863 8.04375 10.0586 8.25 10.0586C8.45625 10.0586 8.625 9.89863 8.625 9.70312V4.72656C8.625 4.53105 8.45625 4.37109 8.25 4.37109C8.04375 4.37109 7.875 4.53105 7.875 4.72656Z", + fill: "white" + })); + + // src/Library/assets/tag-xmark.svg + var React17 = __toESM(require_react()); + var SvgTagXmark = (props) => /* @__PURE__ */ React17.createElement("svg", { + width: 8, + height: 8, + viewBox: "0 0 19 18", + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + ...props + }, /* @__PURE__ */ React17.createElement("path", { + d: "M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z", + fill: "currentcolor" + })); + + // src/Library/index.tsx + var import_react_modal = __toESM(require_lib()); + var import_react10 = __toESM(require_react()); + + // src/Input/Input.tsx + var import_react8 = __toESM(require_react()); + + // ../../node_modules/@popperjs/core/lib/enums.js + var top = "top"; + var bottom = "bottom"; + var right = "right"; + var left = "left"; + var auto = "auto"; + var basePlacements = [top, bottom, right, left]; + var start = "start"; + var end = "end"; + var clippingParents = "clippingParents"; + var viewport = "viewport"; + var popper = "popper"; + var reference = "reference"; + var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); + }, []); + var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); + }, []); + var beforeRead = "beforeRead"; + var read = "read"; + var afterRead = "afterRead"; + var beforeMain = "beforeMain"; + var main = "main"; + var afterMain = "afterMain"; + var beforeWrite = "beforeWrite"; + var write = "write"; + var afterWrite = "afterWrite"; + var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + + // ../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js + function getNodeName(element) { + return element ? (element.nodeName || "").toLowerCase() : null; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js + function getWindow(node) { + if (node == null) { + return window; + } + if (node.toString() !== "[object Window]") { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + return node; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js + function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; + } + function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; + } + function isShadowRoot(node) { + if (typeof ShadowRoot === "undefined") { + return false; + } + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; + } + + // ../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js + function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function(name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(name2) { + var value = attributes[name2]; + if (value === false) { + element.removeAttribute(name2); + } else { + element.setAttribute(name2, value === true ? "" : value); + } + }); + }); + } + function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + return function() { + Object.keys(state.elements).forEach(function(name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); + var style = styleProperties.reduce(function(style2, property) { + style2[property] = ""; + return style2; + }, {}); + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(attribute) { + element.removeAttribute(attribute); + }); + }); + }; + } + var applyStyles_default = { + name: "applyStyles", + enabled: true, + phase: "write", + fn: applyStyles, + effect, + requires: ["computeStyles"] + }; + + // ../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js + function getBasePlacement(placement) { + return placement.split("-")[0]; + } + + // ../../node_modules/@popperjs/core/lib/utils/math.js + var max = Math.max; + var min = Math.min; + var round = Math.round; + + // ../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js + function getBoundingClientRect(element, includeScale) { + if (includeScale === void 0) { + includeScale = false; + } + var rect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + if (isHTMLElement(element) && includeScale) { + var offsetHeight = element.offsetHeight; + var offsetWidth = element.offsetWidth; + if (offsetWidth > 0) { + scaleX = round(rect.width) / offsetWidth || 1; + } + if (offsetHeight > 0) { + scaleY = round(rect.height) / offsetHeight || 1; + } + } + return { + width: rect.width / scaleX, + height: rect.height / scaleY, + top: rect.top / scaleY, + right: rect.right / scaleX, + bottom: rect.bottom / scaleY, + left: rect.left / scaleX, + x: rect.left / scaleX, + y: rect.top / scaleY + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js + function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); + var width = element.offsetWidth; + var height = element.offsetHeight; + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + return { + x: element.offsetLeft, + y: element.offsetTop, + width, + height + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/contains.js + function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); + if (parent.contains(child)) { + return true; + } else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + do { + if (next && parent.isSameNode(next)) { + return true; + } + next = next.parentNode || next.host; + } while (next); + } + return false; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js + function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js + function isTableElement(element) { + return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js + function getDocumentElement(element) { + return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js + function getParentNode(element) { + if (getNodeName(element) === "html") { + return element; + } + return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js + function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") { + return null; + } + return element.offsetParent; + } + function getContainingBlock(element) { + var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1; + var isIE = navigator.userAgent.indexOf("Trident") !== -1; + if (isIE && isHTMLElement(element)) { + var elementCss = getComputedStyle(element); + if (elementCss.position === "fixed") { + return null; + } + } + var currentNode = getParentNode(element); + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); + if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + return null; + } + function getOffsetParent(element) { + var window2 = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") { + offsetParent = getTrueOffsetParent(offsetParent); + } + if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) { + return window2; + } + return offsetParent || getContainingBlock(element) || window2; + } + + // ../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js + function getMainAxisFromPlacement(placement) { + return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; + } + + // ../../node_modules/@popperjs/core/lib/utils/within.js + function within(min2, value, max2) { + return max(min2, min(value, max2)); + } + function withinMaxClamp(min2, value, max2) { + var v2 = within(min2, value, max2); + return v2 > max2 ? max2 : v2; + } + + // ../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js + function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; + } + + // ../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js + function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); + } + + // ../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js + function expandToHashMap(value, keys) { + return keys.reduce(function(hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); + } + + // ../../node_modules/@popperjs/core/lib/modifiers/arrow.js + var toPaddingObject = function toPaddingObject2(padding, state) { + padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + }; + function arrow(_ref) { + var _state$modifiersData$; + var state = _ref.state, name = _ref.name, options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets2 = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? "height" : "width"; + if (!arrowElement || !popperOffsets2) { + return; + } + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === "y" ? top : left; + var maxProp = axis === "y" ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; + var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; + var min2 = paddingObject[minProp]; + var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset2 = within(min2, center, max2); + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); + } + function effect2(_ref2) { + var state = _ref2.state, options = _ref2.options; + var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; + if (arrowElement == null) { + return; + } + if (typeof arrowElement === "string") { + arrowElement = state.elements.popper.querySelector(arrowElement); + if (!arrowElement) { + return; + } + } + if (true) { + if (!isHTMLElement(arrowElement)) { + console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" ")); + } + } + if (!contains(state.elements.popper, arrowElement)) { + if (true) { + console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" ")); + } + return; + } + state.elements.arrow = arrowElement; + } + var arrow_default = { + name: "arrow", + enabled: true, + phase: "main", + fn: arrow, + effect: effect2, + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"] + }; + + // ../../node_modules/@popperjs/core/lib/utils/getVariation.js + function getVariation(placement) { + return placement.split("-")[1]; + } + + // ../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js + var unsetSides = { + top: "auto", + right: "auto", + bottom: "auto", + left: "auto" + }; + function roundOffsetsByDPR(_ref) { + var x2 = _ref.x, y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x2 * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; + } + function mapToStyles(_ref2) { + var _Object$assign2; + var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y; + var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ + x: x2, + y + }) : { + x: x2, + y + }; + x2 = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty("x"); + var hasY = offsets.hasOwnProperty("y"); + var sideX = left; + var sideY = top; + var win = window; + if (adaptive) { + var offsetParent = getOffsetParent(popper2); + var heightProp = "clientHeight"; + var widthProp = "clientWidth"; + if (offsetParent === getWindow(popper2)) { + offsetParent = getDocumentElement(popper2); + if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") { + heightProp = "scrollHeight"; + widthProp = "scrollWidth"; + } + } + offsetParent = offsetParent; + if (placement === top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + if (placement === left || (placement === top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp]; + x2 -= offsetX - popperRect.width; + x2 *= gpuAcceleration ? 1 : -1; + } + } + var commonStyles = Object.assign({ + position + }, adaptive && unsetSides); + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x2, + y + }) : { + x: x2, + y + }; + x2 = _ref4.x; + y = _ref4.y; + if (gpuAcceleration) { + var _Object$assign; + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y + "px)" : "translate3d(" + x2 + "px, " + y + "px, 0)", _Object$assign)); + } + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2)); + } + function computeStyles(_ref5) { + var state = _ref5.state, options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + if (true) { + var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ""; + if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) { + return transitionProperty.indexOf(property) >= 0; + })) { + console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" ")); + } + } + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration, + isFixed: state.options.strategy === "fixed" + }; + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive, + roundOffsets + }))); + } + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: "absolute", + adaptive: false, + roundOffsets + }))); + } + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-placement": state.placement + }); + } + var computeStyles_default = { + name: "computeStyles", + enabled: true, + phase: "beforeWrite", + fn: computeStyles, + data: {} + }; + + // ../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js + var passive = { + passive: true + }; + function effect3(_ref) { + var state = _ref.state, instance = _ref.instance, options = _ref.options; + var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; + var window2 = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.addEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.addEventListener("resize", instance.update, passive); + } + return function() { + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.removeEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.removeEventListener("resize", instance.update, passive); + } + }; + } + var eventListeners_default = { + name: "eventListeners", + enabled: true, + phase: "write", + fn: function fn() { + }, + effect: effect3, + data: {} + }; + + // ../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js + var hash = { + left: "right", + right: "left", + bottom: "top", + top: "bottom" + }; + function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function(matched) { + return hash[matched]; + }); + } + + // ../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js + var hash2 = { + start: "end", + end: "start" + }; + function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function(matched) { + return hash2[matched]; + }); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js + function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft, + scrollTop + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js + function getWindowScrollBarX(element) { + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js + function getViewportRect(element) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x2 = 0; + var y = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { + x2 = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + return { + width, + height, + x: x2 + getWindowScrollBarX(element), + y + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js + function getDocumentRect(element) { + var _element$ownerDocumen; + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + if (getComputedStyle(body || html).direction === "rtl") { + x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + return { + width, + height, + x: x2, + y + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js + function isScrollParent(element) { + var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js + function getScrollParent(node) { + if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { + return node.ownerDocument.body; + } + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + return getScrollParent(getParentNode(node)); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js + function listScrollParents(element, list) { + var _element$ownerDocumen; + if (list === void 0) { + list = []; + } + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target))); + } + + // ../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js + function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js + function getInnerBoundingClientRect(element) { + var rect = getBoundingClientRect(element); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; + } + function getClientRectFromMixedType(element, clippingParent) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); + } + function getClippingParents(element) { + var clippingParents2 = listScrollParents(getParentNode(element)); + var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + if (!isElement(clipperElement)) { + return []; + } + return clippingParents2.filter(function(clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; + }); + } + function getClippingRect(element, boundary, rootBoundary) { + var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); + var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents2[0]; + var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; + } + + // ../../node_modules/@popperjs/core/lib/utils/computeOffsets.js + function computeOffsets(_ref) { + var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference2.x + reference2.width / 2 - element.width / 2; + var commonY = reference2.y + reference2.height / 2 - element.height / 2; + var offsets; + switch (basePlacement) { + case top: + offsets = { + x: commonX, + y: reference2.y - element.height + }; + break; + case bottom: + offsets = { + x: commonX, + y: reference2.y + reference2.height + }; + break; + case right: + offsets = { + x: reference2.x + reference2.width, + y: commonY + }; + break; + case left: + offsets = { + x: reference2.x - element.width, + y: commonY + }; + break; + default: + offsets = { + x: reference2.x, + y: reference2.y + }; + } + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + if (mainAxis != null) { + var len = mainAxis === "y" ? "height" : "width"; + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); + break; + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); + break; + default: + } + } + return offsets; + } + + // ../../node_modules/@popperjs/core/lib/utils/detectOverflow.js + function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets2 = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: "absolute", + placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; + if (elementContext === popper && offsetData) { + var offset2 = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function(key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; + overflowOffsets[key] += offset2[axis] * multiply; + }); + } + return overflowOffsets; + } + + // ../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js + function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { + return getVariation(placement2) === variation; + }) : basePlacements; + var allowedPlacements = placements2.filter(function(placement2) { + return allowedAutoPlacements.indexOf(placement2) >= 0; + }); + if (allowedPlacements.length === 0) { + allowedPlacements = placements2; + if (true) { + console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")); + } + } + var overflows = allowedPlacements.reduce(function(acc, placement2) { + acc[placement2] = detectOverflow(state, { + placement: placement2, + boundary, + rootBoundary, + padding + })[getBasePlacement(placement2)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function(a2, b2) { + return overflows[a2] - overflows[b2]; + }); + } + + // ../../node_modules/@popperjs/core/lib/modifiers/flip.js + function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; + } + function flip(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + if (state.modifiersData[name]._skip) { + return; + } + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { + return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { + placement: placement2, + boundary, + rootBoundary, + padding, + flipVariations, + allowedAutoPlacements + }) : placement2); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = /* @__PURE__ */ new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements2[0]; + for (var i2 = 0; i2 < placements2.length; i2++) { + var placement = placements2[i2]; + var _basePlacement = getBasePlacement(placement); + var isStartVariation = getVariation(placement) === start; + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? "width" : "height"; + var overflow = detectOverflow(state, { + placement, + boundary, + rootBoundary, + altBoundary, + padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + if (checks.every(function(check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + checksMap.set(placement, checks); + } + if (makeFallbackChecks) { + var numberOfChecks = flipVariations ? 3 : 1; + var _loop = function _loop2(_i2) { + var fittingPlacement = placements2.find(function(placement2) { + var checks2 = checksMap.get(placement2); + if (checks2) { + return checks2.slice(0, _i2).every(function(check) { + return check; + }); + } + }); + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + if (_ret === "break") + break; + } + } + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } + } + var flip_default = { + name: "flip", + enabled: true, + phase: "main", + fn: flip, + requiresIfExists: ["offset"], + data: { + _skip: false + } + }; + + // ../../node_modules/@popperjs/core/lib/modifiers/hide.js + function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; + } + function isAnySideFullyClipped(overflow) { + return [top, right, bottom, left].some(function(side) { + return overflow[side] >= 0; + }); + } + function hide(_ref) { + var state = _ref.state, name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: "reference" + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets, + popperEscapeOffsets, + isReferenceHidden, + hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-reference-hidden": isReferenceHidden, + "data-popper-escaped": hasPopperEscaped + }); + } + var hide_default = { + name: "hide", + enabled: true, + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: hide + }; + + // ../../node_modules/@popperjs/core/lib/modifiers/offset.js + function distanceAndSkiddingToXY(placement, rects, offset2) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; + var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { + placement + })) : offset2, skidding = _ref[0], distance = _ref[1]; + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; + } + function offset(_ref2) { + var state = _ref2.state, options = _ref2.options, name = _ref2.name; + var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = placements.reduce(function(acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); + return acc; + }, {}); + var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y = _data$state$placement.y; + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x2; + state.modifiersData.popperOffsets.y += y; + } + state.modifiersData[name] = data; + } + var offset_default = { + name: "offset", + enabled: true, + phase: "main", + requires: ["popperOffsets"], + fn: offset + }; + + // ../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js + function popperOffsets(_ref) { + var state = _ref.state, name = _ref.name; + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: "absolute", + placement: state.placement + }); + } + var popperOffsets_default = { + name: "popperOffsets", + enabled: true, + phase: "read", + fn: popperOffsets, + data: {} + }; + + // ../../node_modules/@popperjs/core/lib/utils/getAltAxis.js + function getAltAxis(axis) { + return axis === "x" ? "y" : "x"; + } + + // ../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js + function preventOverflow(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary, + rootBoundary, + padding, + altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets2 = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + if (!popperOffsets2) { + return; + } + if (checkMainAxis) { + var _offsetModifierState$; + var mainSide = mainAxis === "y" ? top : left; + var altSide = mainAxis === "y" ? bottom : right; + var len = mainAxis === "y" ? "height" : "width"; + var offset2 = popperOffsets2[mainAxis]; + var min2 = offset2 + overflow[mainSide]; + var max2 = offset2 - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset2 + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2); + popperOffsets2[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset2; + } + if (checkAltAxis) { + var _offsetModifierState$2; + var _mainSide = mainAxis === "x" ? top : left; + var _altSide = mainAxis === "x" ? bottom : right; + var _offset = popperOffsets2[altAxis]; + var _len = altAxis === "y" ? "height" : "width"; + var _min = _offset + overflow[_mainSide]; + var _max = _offset - overflow[_altSide]; + var isOriginSide = [top, left].indexOf(basePlacement) !== -1; + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + popperOffsets2[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + state.modifiersData[name] = data; + } + var preventOverflow_default = { + name: "preventOverflow", + enabled: true, + phase: "main", + fn: preventOverflow, + requiresIfExists: ["offset"] + }; + + // ../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js + function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js + function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } + } + + // ../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js + function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; + } + function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; + } + + // ../../node_modules/@popperjs/core/lib/utils/orderModifiers.js + function order(modifiers) { + var map = /* @__PURE__ */ new Map(); + var visited = /* @__PURE__ */ new Set(); + var result = []; + modifiers.forEach(function(modifier) { + map.set(modifier.name, modifier); + }); + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function(dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + modifiers.forEach(function(modifier) { + if (!visited.has(modifier.name)) { + sort(modifier); + } + }); + return result; + } + function orderModifiers(modifiers) { + var orderedModifiers = order(modifiers); + return modifierPhases.reduce(function(acc, phase) { + return acc.concat(orderedModifiers.filter(function(modifier) { + return modifier.phase === phase; + })); + }, []); + } + + // ../../node_modules/@popperjs/core/lib/utils/debounce.js + function debounce(fn3) { + var pending; + return function() { + if (!pending) { + pending = new Promise(function(resolve) { + Promise.resolve().then(function() { + pending = void 0; + resolve(fn3()); + }); + }); + } + return pending; + }; + } + + // ../../node_modules/@popperjs/core/lib/utils/format.js + function format(str) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return [].concat(args).reduce(function(p2, c2) { + return p2.replace(/%s/, c2); + }, str); + } + + // ../../node_modules/@popperjs/core/lib/utils/validateModifiers.js + var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; + var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; + var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"]; + function validateModifiers(modifiers) { + modifiers.forEach(function(modifier) { + [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index2, self2) { + return self2.indexOf(value) === index2; + }).forEach(function(key) { + switch (key) { + case "name": + if (typeof modifier.name !== "string") { + console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"')); + } + break; + case "enabled": + if (typeof modifier.enabled !== "boolean") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"')); + } + break; + case "phase": + if (modifierPhases.indexOf(modifier.phase) < 0) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"')); + } + break; + case "fn": + if (typeof modifier.fn !== "function") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"')); + } + break; + case "effect": + if (modifier.effect != null && typeof modifier.effect !== "function") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"')); + } + break; + case "requires": + if (modifier.requires != null && !Array.isArray(modifier.requires)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"')); + } + break; + case "requiresIfExists": + if (!Array.isArray(modifier.requiresIfExists)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"')); + } + break; + case "options": + case "data": + break; + default: + console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s2) { + return '"' + s2 + '"'; + }).join(", ") + '; but "' + key + '" was provided.'); + } + modifier.requires && modifier.requires.forEach(function(requirement) { + if (modifiers.find(function(mod) { + return mod.name === requirement; + }) == null) { + console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); + } + }); + }); + }); + } + + // ../../node_modules/@popperjs/core/lib/utils/uniqueBy.js + function uniqueBy(arr, fn3) { + var identifiers = /* @__PURE__ */ new Set(); + return arr.filter(function(item) { + var identifier = fn3(item); + if (!identifiers.has(identifier)) { + identifiers.add(identifier); + return true; + } + }); + } + + // ../../node_modules/@popperjs/core/lib/utils/mergeByName.js + function mergeByName(modifiers) { + var merged = modifiers.reduce(function(merged2, current) { + var existing = merged2[current.name]; + merged2[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged2; + }, {}); + return Object.keys(merged).map(function(key) { + return merged[key]; + }); + } + + // ../../node_modules/@popperjs/core/lib/createPopper.js + var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element."; + var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash."; + var DEFAULT_OPTIONS = { + placement: "bottom", + modifiers: [], + strategy: "absolute" + }; + function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return !args.some(function(element) { + return !(element && typeof element.getBoundingClientRect === "function"); + }); + } + function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper2(reference2, popper2, options) { + if (options === void 0) { + options = defaultOptions; + } + var state = { + placement: "bottom", + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference2, + popper: popper2 + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state, + setOptions: function setOptions(setOptionsAction) { + var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options2); + state.scrollParents = { + reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], + popper: listScrollParents(popper2) + }; + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); + state.orderedModifiers = orderedModifiers.filter(function(m3) { + return m3.enabled; + }); + if (true) { + var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) { + var name = _ref.name; + return name; + }); + validateModifiers(modifiers); + if (getBasePlacement(state.options.placement) === auto) { + var flipModifier = state.orderedModifiers.find(function(_ref2) { + var name = _ref2.name; + return name === "flip"; + }); + if (!flipModifier) { + console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" ")); + } + } + var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft; + if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) { + return parseFloat(margin); + })) { + console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" ")); + } + } + runModifierEffects(); + return instance.update(); + }, + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; + if (!areValidElements(reference3, popper3)) { + if (true) { + console.error(INVALID_ELEMENT_ERROR); + } + return; + } + state.rects = { + reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), + popper: getLayoutRect(popper3) + }; + state.reset = false; + state.placement = state.options.placement; + state.orderedModifiers.forEach(function(modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) { + if (true) { + __debug_loops__ += 1; + if (__debug_loops__ > 100) { + console.error(INFINITE_LOOP_ERROR); + break; + } + } + if (state.reset === true) { + state.reset = false; + index2 = -1; + continue; + } + var _state$orderedModifie = state.orderedModifiers[index2], fn3 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; + if (typeof fn3 === "function") { + state = fn3({ + state, + options: _options, + name, + instance + }) || state; + } + } + }, + update: debounce(function() { + return new Promise(function(resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + if (!areValidElements(reference2, popper2)) { + if (true) { + console.error(INVALID_ELEMENT_ERROR); + } + return instance; + } + instance.setOptions(options).then(function(state2) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state2); + } + }); + function runModifierEffects() { + state.orderedModifiers.forEach(function(_ref3) { + var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect5 = _ref3.effect; + if (typeof effect5 === "function") { + var cleanupFn = effect5({ + state, + name, + instance, + options: options2 + }); + var noopFn = function noopFn2() { + }; + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + function cleanupModifierEffects() { + effectCleanupFns.forEach(function(fn3) { + return fn3(); + }); + effectCleanupFns = []; + } + return instance; + }; + } + + // ../../node_modules/@popperjs/core/lib/popper.js + var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default]; + var createPopper = /* @__PURE__ */ popperGenerator({ + defaultModifiers + }); + + // ../../node_modules/tippy.js/dist/tippy.esm.js + var BOX_CLASS = "tippy-box"; + var CONTENT_CLASS = "tippy-content"; + var BACKDROP_CLASS = "tippy-backdrop"; + var ARROW_CLASS = "tippy-arrow"; + var SVG_ARROW_CLASS = "tippy-svg-arrow"; + var TOUCH_OPTIONS = { + passive: true, + capture: true + }; + var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() { + return document.body; + }; + function hasOwnProperty(obj, key) { + return {}.hasOwnProperty.call(obj, key); + } + function getValueAtIndexOrReturn(value, index2, defaultValue) { + if (Array.isArray(value)) { + var v2 = value[index2]; + return v2 == null ? Array.isArray(defaultValue) ? defaultValue[index2] : defaultValue : v2; + } + return value; + } + function isType(value, type) { + var str = {}.toString.call(value); + return str.indexOf("[object") === 0 && str.indexOf(type + "]") > -1; + } + function invokeWithArgsOrReturn(value, args) { + return typeof value === "function" ? value.apply(void 0, args) : value; + } + function debounce2(fn3, ms) { + if (ms === 0) { + return fn3; + } + var timeout; + return function(arg) { + clearTimeout(timeout); + timeout = setTimeout(function() { + fn3(arg); + }, ms); + }; + } + function removeProperties(obj, keys) { + var clone = Object.assign({}, obj); + keys.forEach(function(key) { + delete clone[key]; + }); + return clone; + } + function splitBySpaces(value) { + return value.split(/\s+/).filter(Boolean); + } + function normalizeToArray(value) { + return [].concat(value); + } + function pushIfUnique(arr, value) { + if (arr.indexOf(value) === -1) { + arr.push(value); + } + } + function unique(arr) { + return arr.filter(function(item, index2) { + return arr.indexOf(item) === index2; + }); + } + function getBasePlacement2(placement) { + return placement.split("-")[0]; + } + function arrayFrom(value) { + return [].slice.call(value); + } + function removeUndefinedProps(obj) { + return Object.keys(obj).reduce(function(acc, key) { + if (obj[key] !== void 0) { + acc[key] = obj[key]; + } + return acc; + }, {}); + } + function div() { + return document.createElement("div"); + } + function isElement2(value) { + return ["Element", "Fragment"].some(function(type) { + return isType(value, type); + }); + } + function isNodeList(value) { + return isType(value, "NodeList"); + } + function isMouseEvent(value) { + return isType(value, "MouseEvent"); + } + function isReferenceElement(value) { + return !!(value && value._tippy && value._tippy.reference === value); + } + function getArrayOfElements(value) { + if (isElement2(value)) { + return [value]; + } + if (isNodeList(value)) { + return arrayFrom(value); + } + if (Array.isArray(value)) { + return value; + } + return arrayFrom(document.querySelectorAll(value)); + } + function setTransitionDuration(els, value) { + els.forEach(function(el) { + if (el) { + el.style.transitionDuration = value + "ms"; + } + }); + } + function setVisibilityState(els, state) { + els.forEach(function(el) { + if (el) { + el.setAttribute("data-state", state); + } + }); + } + function getOwnerDocument(elementOrElements) { + var _element$ownerDocumen; + var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0]; + return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; + } + function isCursorOutsideInteractiveBorder(popperTreeData, event) { + var clientX = event.clientX, clientY = event.clientY; + return popperTreeData.every(function(_ref) { + var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props; + var interactiveBorder = props.interactiveBorder; + var basePlacement = getBasePlacement2(popperState.placement); + var offsetData = popperState.modifiersData.offset; + if (!offsetData) { + return true; + } + var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0; + var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0; + var leftDistance = basePlacement === "right" ? offsetData.left.x : 0; + var rightDistance = basePlacement === "left" ? offsetData.right.x : 0; + var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; + var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; + var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; + var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; + return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; + }); + } + function updateTransitionEndListener(box, action, listener) { + var method = action + "EventListener"; + ["transitionend", "webkitTransitionEnd"].forEach(function(event) { + box[method](event, listener); + }); + } + function actualContains(parent, child) { + var target = child; + while (target) { + var _target$getRootNode; + if (parent.contains(target)) { + return true; + } + target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; + } + return false; + } + var currentInput = { + isTouch: false + }; + var lastMouseMoveTime = 0; + function onDocumentTouchStart() { + if (currentInput.isTouch) { + return; + } + currentInput.isTouch = true; + if (window.performance) { + document.addEventListener("mousemove", onDocumentMouseMove); + } + } + function onDocumentMouseMove() { + var now2 = performance.now(); + if (now2 - lastMouseMoveTime < 20) { + currentInput.isTouch = false; + document.removeEventListener("mousemove", onDocumentMouseMove); + } + lastMouseMoveTime = now2; + } + function onWindowBlur() { + var activeElement = document.activeElement; + if (isReferenceElement(activeElement)) { + var instance = activeElement._tippy; + if (activeElement.blur && !instance.state.isVisible) { + activeElement.blur(); + } + } + } + function bindGlobalEventListeners() { + document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS); + window.addEventListener("blur", onWindowBlur); + } + var isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var isIE11 = isBrowser ? !!window.msCrypto : false; + function createMemoryLeakWarning(method) { + var txt = method === "destroy" ? "n already-" : " "; + return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" "); + } + function clean(value) { + var spacesAndTabs = /[ \t]{2,}/g; + var lineStartWithSpaces = /^[ \t]*/gm; + return value.replace(spacesAndTabs, " ").replace(lineStartWithSpaces, "").trim(); + } + function getDevMessage(message) { + return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\u{1F477}\u200D This is a development-only message. It will be removed in production.\n "); + } + function getFormattedMessage(message) { + return [ + getDevMessage(message), + "color: #00C584; font-size: 1.3em; font-weight: bold;", + "line-height: 1.5", + "color: #a6a095;" + ]; + } + var visitedMessages; + if (true) { + resetVisitedMessages(); + } + function resetVisitedMessages() { + visitedMessages = /* @__PURE__ */ new Set(); + } + function warnWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console; + visitedMessages.add(message); + (_console = console).warn.apply(_console, getFormattedMessage(message)); + } + } + function errorWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console2; + visitedMessages.add(message); + (_console2 = console).error.apply(_console2, getFormattedMessage(message)); + } + } + function validateTargets(targets) { + var didPassFalsyValue = !targets; + var didPassPlainObject = Object.prototype.toString.call(targets) === "[object Object]" && !targets.addEventListener; + errorWhen(didPassFalsyValue, ["tippy() was passed", "`" + String(targets) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")); + errorWhen(didPassPlainObject, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" ")); + } + var pluginProps = { + animateFill: false, + followCursor: false, + inlinePositioning: false, + sticky: false + }; + var renderProps = { + allowHTML: false, + animation: "fade", + arrow: true, + content: "", + inertia: false, + maxWidth: 350, + role: "tooltip", + theme: "", + zIndex: 9999 + }; + var defaultProps2 = Object.assign({ + appendTo: TIPPY_DEFAULT_APPEND_TO, + aria: { + content: "auto", + expanded: "auto" + }, + delay: 0, + duration: [300, 250], + getReferenceClientRect: null, + hideOnClick: true, + ignoreAttributes: false, + interactive: false, + interactiveBorder: 2, + interactiveDebounce: 0, + moveTransition: "", + offset: [0, 10], + onAfterUpdate: function onAfterUpdate() { + }, + onBeforeUpdate: function onBeforeUpdate() { + }, + onCreate: function onCreate() { + }, + onDestroy: function onDestroy() { + }, + onHidden: function onHidden() { + }, + onHide: function onHide() { + }, + onMount: function onMount() { + }, + onShow: function onShow() { + }, + onShown: function onShown() { + }, + onTrigger: function onTrigger() { + }, + onUntrigger: function onUntrigger() { + }, + onClickOutside: function onClickOutside() { + }, + placement: "top", + plugins: [], + popperOptions: {}, + render: null, + showOnCreate: false, + touch: true, + trigger: "mouseenter focus", + triggerTarget: null + }, pluginProps, renderProps); + var defaultKeys = Object.keys(defaultProps2); + var setDefaultProps = function setDefaultProps2(partialProps) { + if (true) { + validateProps(partialProps, []); + } + var keys = Object.keys(partialProps); + keys.forEach(function(key) { + defaultProps2[key] = partialProps[key]; + }); + }; + function getExtendedPassedProps(passedProps) { + var plugins = passedProps.plugins || []; + var pluginProps2 = plugins.reduce(function(acc, plugin) { + var name = plugin.name, defaultValue = plugin.defaultValue; + if (name) { + var _name; + acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps2[name]) != null ? _name : defaultValue; + } + return acc; + }, {}); + return Object.assign({}, passedProps, pluginProps2); + } + function getDataAttributeProps(reference2, plugins) { + var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps2, { + plugins + }))) : defaultKeys; + var props = propKeys.reduce(function(acc, key) { + var valueAsString = (reference2.getAttribute("data-tippy-" + key) || "").trim(); + if (!valueAsString) { + return acc; + } + if (key === "content") { + acc[key] = valueAsString; + } else { + try { + acc[key] = JSON.parse(valueAsString); + } catch (e2) { + acc[key] = valueAsString; + } + } + return acc; + }, {}); + return props; + } + function evaluateProps(reference2, props) { + var out = Object.assign({}, props, { + content: invokeWithArgsOrReturn(props.content, [reference2]) + }, props.ignoreAttributes ? {} : getDataAttributeProps(reference2, props.plugins)); + out.aria = Object.assign({}, defaultProps2.aria, out.aria); + out.aria = { + expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded, + content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content + }; + return out; + } + function validateProps(partialProps, plugins) { + if (partialProps === void 0) { + partialProps = {}; + } + if (plugins === void 0) { + plugins = []; + } + var keys = Object.keys(partialProps); + keys.forEach(function(prop) { + var nonPluginProps = removeProperties(defaultProps2, Object.keys(pluginProps)); + var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); + if (didPassUnknownProp) { + didPassUnknownProp = plugins.filter(function(plugin) { + return plugin.name === prop; + }).length === 0; + } + warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", "\n\n", "All props: https://atomiks.github.io/tippyjs/v6/all-props/\n", "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" ")); + }); + } + var innerHTML = function innerHTML2() { + return "innerHTML"; + }; + function dangerouslySetInnerHTML(element, html) { + element[innerHTML()] = html; + } + function createArrowElement(value) { + var arrow2 = div(); + if (value === true) { + arrow2.className = ARROW_CLASS; + } else { + arrow2.className = SVG_ARROW_CLASS; + if (isElement2(value)) { + arrow2.appendChild(value); + } else { + dangerouslySetInnerHTML(arrow2, value); + } + } + return arrow2; + } + function setContent(content, props) { + if (isElement2(props.content)) { + dangerouslySetInnerHTML(content, ""); + content.appendChild(props.content); + } else if (typeof props.content !== "function") { + if (props.allowHTML) { + dangerouslySetInnerHTML(content, props.content); + } else { + content.textContent = props.content; + } + } + } + function getChildren(popper2) { + var box = popper2.firstElementChild; + var boxChildren = arrayFrom(box.children); + return { + box, + content: boxChildren.find(function(node) { + return node.classList.contains(CONTENT_CLASS); + }), + arrow: boxChildren.find(function(node) { + return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); + }), + backdrop: boxChildren.find(function(node) { + return node.classList.contains(BACKDROP_CLASS); + }) + }; + } + function render(instance) { + var popper2 = div(); + var box = div(); + box.className = BOX_CLASS; + box.setAttribute("data-state", "hidden"); + box.setAttribute("tabindex", "-1"); + var content = div(); + content.className = CONTENT_CLASS; + content.setAttribute("data-state", "hidden"); + setContent(content, instance.props); + popper2.appendChild(box); + box.appendChild(content); + onUpdate(instance.props, instance.props); + function onUpdate(prevProps, nextProps) { + var _getChildren = getChildren(popper2), box2 = _getChildren.box, content2 = _getChildren.content, arrow2 = _getChildren.arrow; + if (nextProps.theme) { + box2.setAttribute("data-theme", nextProps.theme); + } else { + box2.removeAttribute("data-theme"); + } + if (typeof nextProps.animation === "string") { + box2.setAttribute("data-animation", nextProps.animation); + } else { + box2.removeAttribute("data-animation"); + } + if (nextProps.inertia) { + box2.setAttribute("data-inertia", ""); + } else { + box2.removeAttribute("data-inertia"); + } + box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth; + if (nextProps.role) { + box2.setAttribute("role", nextProps.role); + } else { + box2.removeAttribute("role"); + } + if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { + setContent(content2, instance.props); + } + if (nextProps.arrow) { + if (!arrow2) { + box2.appendChild(createArrowElement(nextProps.arrow)); + } else if (prevProps.arrow !== nextProps.arrow) { + box2.removeChild(arrow2); + box2.appendChild(createArrowElement(nextProps.arrow)); + } + } else if (arrow2) { + box2.removeChild(arrow2); + } + } + return { + popper: popper2, + onUpdate + }; + } + render.$$tippy = true; + var idCounter = 1; + var mouseMoveListeners = []; + var mountedInstances = []; + function createTippy(reference2, passedProps) { + var props = evaluateProps(reference2, Object.assign({}, defaultProps2, getExtendedPassedProps(removeUndefinedProps(passedProps)))); + var showTimeout; + var hideTimeout; + var scheduleHideAnimationFrame; + var isVisibleFromClick = false; + var didHideDueToDocumentMouseDown = false; + var didTouchMove = false; + var ignoreOnFirstUpdate = false; + var lastTriggerEvent; + var currentTransitionEndListener; + var onFirstUpdate; + var listeners = []; + var debouncedOnMouseMove = debounce2(onMouseMove, props.interactiveDebounce); + var currentTarget; + var id = idCounter++; + var popperInstance = null; + var plugins = unique(props.plugins); + var state = { + isEnabled: true, + isVisible: false, + isDestroyed: false, + isMounted: false, + isShown: false + }; + var instance = { + id, + reference: reference2, + popper: div(), + popperInstance, + props, + state, + plugins, + clearDelayTimeouts, + setProps, + setContent: setContent2, + show, + hide: hide2, + hideWithInteractivity, + enable, + disable, + unmount, + destroy + }; + if (!props.render) { + if (true) { + errorWhen(true, "render() function has not been supplied."); + } + return instance; + } + var _props$render = props.render(instance), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate; + popper2.setAttribute("data-tippy-root", ""); + popper2.id = "tippy-" + instance.id; + instance.popper = popper2; + reference2._tippy = instance; + popper2._tippy = instance; + var pluginsHooks = plugins.map(function(plugin) { + return plugin.fn(instance); + }); + var hasAriaExpanded = reference2.hasAttribute("aria-expanded"); + addListeners(); + handleAriaExpandedAttribute(); + handleStyles(); + invokeHook("onCreate", [instance]); + if (props.showOnCreate) { + scheduleShow(); + } + popper2.addEventListener("mouseenter", function() { + if (instance.props.interactive && instance.state.isVisible) { + instance.clearDelayTimeouts(); + } + }); + popper2.addEventListener("mouseleave", function() { + if (instance.props.interactive && instance.props.trigger.indexOf("mouseenter") >= 0) { + getDocument().addEventListener("mousemove", debouncedOnMouseMove); + } + }); + return instance; + function getNormalizedTouchSettings() { + var touch = instance.props.touch; + return Array.isArray(touch) ? touch : [touch, 0]; + } + function getIsCustomTouchBehavior() { + return getNormalizedTouchSettings()[0] === "hold"; + } + function getIsDefaultRenderFn() { + var _instance$props$rende; + return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); + } + function getCurrentTarget() { + return currentTarget || reference2; + } + function getDocument() { + var parent = getCurrentTarget().parentNode; + return parent ? getOwnerDocument(parent) : document; + } + function getDefaultTemplateChildren() { + return getChildren(popper2); + } + function getDelay(isShow) { + if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") { + return 0; + } + return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps2.delay); + } + function handleStyles(fromHide) { + if (fromHide === void 0) { + fromHide = false; + } + popper2.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none"; + popper2.style.zIndex = "" + instance.props.zIndex; + } + function invokeHook(hook, args, shouldInvokePropsHook) { + if (shouldInvokePropsHook === void 0) { + shouldInvokePropsHook = true; + } + pluginsHooks.forEach(function(pluginHooks) { + if (pluginHooks[hook]) { + pluginHooks[hook].apply(pluginHooks, args); + } + }); + if (shouldInvokePropsHook) { + var _instance$props; + (_instance$props = instance.props)[hook].apply(_instance$props, args); + } + } + function handleAriaContentAttribute() { + var aria = instance.props.aria; + if (!aria.content) { + return; + } + var attr = "aria-" + aria.content; + var id2 = popper2.id; + var nodes = normalizeToArray(instance.props.triggerTarget || reference2); + nodes.forEach(function(node) { + var currentValue = node.getAttribute(attr); + if (instance.state.isVisible) { + node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2); + } else { + var nextValue = currentValue && currentValue.replace(id2, "").trim(); + if (nextValue) { + node.setAttribute(attr, nextValue); + } else { + node.removeAttribute(attr); + } + } + }); + } + function handleAriaExpandedAttribute() { + if (hasAriaExpanded || !instance.props.aria.expanded) { + return; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference2); + nodes.forEach(function(node) { + if (instance.props.interactive) { + node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false"); + } else { + node.removeAttribute("aria-expanded"); + } + }); + } + function cleanupInteractiveMouseListeners() { + getDocument().removeEventListener("mousemove", debouncedOnMouseMove); + mouseMoveListeners = mouseMoveListeners.filter(function(listener) { + return listener !== debouncedOnMouseMove; + }); + } + function onDocumentPress(event) { + if (currentInput.isTouch) { + if (didTouchMove || event.type === "mousedown") { + return; + } + } + var actualTarget = event.composedPath && event.composedPath()[0] || event.target; + if (instance.props.interactive && actualContains(popper2, actualTarget)) { + return; + } + if (normalizeToArray(instance.props.triggerTarget || reference2).some(function(el) { + return actualContains(el, actualTarget); + })) { + if (currentInput.isTouch) { + return; + } + if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) { + return; + } + } else { + invokeHook("onClickOutside", [instance, event]); + } + if (instance.props.hideOnClick === true) { + instance.clearDelayTimeouts(); + instance.hide(); + didHideDueToDocumentMouseDown = true; + setTimeout(function() { + didHideDueToDocumentMouseDown = false; + }); + if (!instance.state.isMounted) { + removeDocumentPress(); + } + } + } + function onTouchMove() { + didTouchMove = true; + } + function onTouchStart() { + didTouchMove = false; + } + function addDocumentPress() { + var doc = getDocument(); + doc.addEventListener("mousedown", onDocumentPress, true); + doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); + } + function removeDocumentPress() { + var doc = getDocument(); + doc.removeEventListener("mousedown", onDocumentPress, true); + doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); + } + function onTransitionedOut(duration, callback) { + onTransitionEnd(duration, function() { + if (!instance.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) { + callback(); + } + }); + } + function onTransitionedIn(duration, callback) { + onTransitionEnd(duration, callback); + } + function onTransitionEnd(duration, callback) { + var box = getDefaultTemplateChildren().box; + function listener(event) { + if (event.target === box) { + updateTransitionEndListener(box, "remove", listener); + callback(); + } + } + if (duration === 0) { + return callback(); + } + updateTransitionEndListener(box, "remove", currentTransitionEndListener); + updateTransitionEndListener(box, "add", listener); + currentTransitionEndListener = listener; + } + function on(eventType, handler, options) { + if (options === void 0) { + options = false; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference2); + nodes.forEach(function(node) { + node.addEventListener(eventType, handler, options); + listeners.push({ + node, + eventType, + handler, + options + }); + }); + } + function addListeners() { + if (getIsCustomTouchBehavior()) { + on("touchstart", onTrigger2, { + passive: true + }); + on("touchend", onMouseLeave, { + passive: true + }); + } + splitBySpaces(instance.props.trigger).forEach(function(eventType) { + if (eventType === "manual") { + return; + } + on(eventType, onTrigger2); + switch (eventType) { + case "mouseenter": + on("mouseleave", onMouseLeave); + break; + case "focus": + on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut); + break; + case "focusin": + on("focusout", onBlurOrFocusOut); + break; + } + }); + } + function removeListeners() { + listeners.forEach(function(_ref) { + var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options; + node.removeEventListener(eventType, handler, options); + }); + listeners = []; + } + function onTrigger2(event) { + var _lastTriggerEvent; + var shouldScheduleClickHide = false; + if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { + return; + } + var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus"; + lastTriggerEvent = event; + currentTarget = event.currentTarget; + handleAriaExpandedAttribute(); + if (!instance.state.isVisible && isMouseEvent(event)) { + mouseMoveListeners.forEach(function(listener) { + return listener(event); + }); + } + if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { + shouldScheduleClickHide = true; + } else { + scheduleShow(event); + } + if (event.type === "click") { + isVisibleFromClick = !shouldScheduleClickHide; + } + if (shouldScheduleClickHide && !wasFocused) { + scheduleHide(event); + } + } + function onMouseMove(event) { + var target = event.target; + var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target); + if (event.type === "mousemove" && isCursorOverReferenceOrPopper) { + return; + } + var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) { + var _instance$popperInsta; + var instance2 = popper3._tippy; + var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state; + if (state2) { + return { + popperRect: popper3.getBoundingClientRect(), + popperState: state2, + props + }; + } + return null; + }).filter(Boolean); + if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { + cleanupInteractiveMouseListeners(); + scheduleHide(event); + } + } + function onMouseLeave(event) { + var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick; + if (shouldBail) { + return; + } + if (instance.props.interactive) { + instance.hideWithInteractivity(event); + return; + } + scheduleHide(event); + } + function onBlurOrFocusOut(event) { + if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) { + return; + } + if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) { + return; + } + scheduleHide(event); + } + function isEventListenerStopped(event) { + return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false; + } + function createPopperInstance() { + destroyPopperInstance(); + var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition; + var arrow2 = getIsDefaultRenderFn() ? getChildren(popper2).arrow : null; + var computedReference = getReferenceClientRect ? { + getBoundingClientRect: getReferenceClientRect, + contextElement: getReferenceClientRect.contextElement || getCurrentTarget() + } : reference2; + var tippyModifier = { + name: "$$tippy", + enabled: true, + phase: "beforeWrite", + requires: ["computeStyles"], + fn: function fn3(_ref2) { + var state2 = _ref2.state; + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box; + ["placement", "reference-hidden", "escaped"].forEach(function(attr) { + if (attr === "placement") { + box.setAttribute("data-placement", state2.placement); + } else { + if (state2.attributes.popper["data-popper-" + attr]) { + box.setAttribute("data-" + attr, ""); + } else { + box.removeAttribute("data-" + attr); + } + } + }); + state2.attributes.popper = {}; + } + } + }; + var modifiers = [{ + name: "offset", + options: { + offset: offset2 + } + }, { + name: "preventOverflow", + options: { + padding: { + top: 2, + bottom: 2, + left: 5, + right: 5 + } + } + }, { + name: "flip", + options: { + padding: 5 + } + }, { + name: "computeStyles", + options: { + adaptive: !moveTransition + } + }, tippyModifier]; + if (getIsDefaultRenderFn() && arrow2) { + modifiers.push({ + name: "arrow", + options: { + element: arrow2, + padding: 3 + } + }); + } + modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); + instance.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, { + placement, + onFirstUpdate, + modifiers + })); + } + function destroyPopperInstance() { + if (instance.popperInstance) { + instance.popperInstance.destroy(); + instance.popperInstance = null; + } + } + function mount() { + var appendTo = instance.props.appendTo; + var parentNode; + var node = getCurrentTarget(); + if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") { + parentNode = node.parentNode; + } else { + parentNode = invokeWithArgsOrReturn(appendTo, [node]); + } + if (!parentNode.contains(popper2)) { + parentNode.appendChild(popper2); + } + instance.state.isMounted = true; + createPopperInstance(); + if (true) { + warnWhen(instance.props.interactive && appendTo === defaultProps2.appendTo && node.nextElementSibling !== popper2, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", "\n\n", "Using a wrapper
or tag around the reference element", "solves this by creating a new parentNode context.", "\n\n", "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", "\n\n", "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" ")); + } + } + function getNestedPopperTree() { + return arrayFrom(popper2.querySelectorAll("[data-tippy-root]")); + } + function scheduleShow(event) { + instance.clearDelayTimeouts(); + if (event) { + invokeHook("onTrigger", [instance, event]); + } + addDocumentPress(); + var delay = getDelay(true); + var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1]; + if (currentInput.isTouch && touchValue === "hold" && touchDelay) { + delay = touchDelay; + } + if (delay) { + showTimeout = setTimeout(function() { + instance.show(); + }, delay); + } else { + instance.show(); + } + } + function scheduleHide(event) { + instance.clearDelayTimeouts(); + invokeHook("onUntrigger", [instance, event]); + if (!instance.state.isVisible) { + removeDocumentPress(); + return; + } + if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) { + return; + } + var delay = getDelay(false); + if (delay) { + hideTimeout = setTimeout(function() { + if (instance.state.isVisible) { + instance.hide(); + } + }, delay); + } else { + scheduleHideAnimationFrame = requestAnimationFrame(function() { + instance.hide(); + }); + } + } + function enable() { + instance.state.isEnabled = true; + } + function disable() { + instance.hide(); + instance.state.isEnabled = false; + } + function clearDelayTimeouts() { + clearTimeout(showTimeout); + clearTimeout(hideTimeout); + cancelAnimationFrame(scheduleHideAnimationFrame); + } + function setProps(partialProps) { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("setProps")); + } + if (instance.state.isDestroyed) { + return; + } + invokeHook("onBeforeUpdate", [instance, partialProps]); + removeListeners(); + var prevProps = instance.props; + var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { + ignoreAttributes: true + })); + instance.props = nextProps; + addListeners(); + if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { + cleanupInteractiveMouseListeners(); + debouncedOnMouseMove = debounce2(onMouseMove, nextProps.interactiveDebounce); + } + if (prevProps.triggerTarget && !nextProps.triggerTarget) { + normalizeToArray(prevProps.triggerTarget).forEach(function(node) { + node.removeAttribute("aria-expanded"); + }); + } else if (nextProps.triggerTarget) { + reference2.removeAttribute("aria-expanded"); + } + handleAriaExpandedAttribute(); + handleStyles(); + if (onUpdate) { + onUpdate(prevProps, nextProps); + } + if (instance.popperInstance) { + createPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); + }); + } + invokeHook("onAfterUpdate", [instance, partialProps]); + } + function setContent2(content) { + instance.setProps({ + content + }); + } + function show() { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("show")); + } + var isAlreadyVisible = instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; + var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps2.duration); + if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { + return; + } + if (getCurrentTarget().hasAttribute("disabled")) { + return; + } + invokeHook("onShow", [instance], false); + if (instance.props.onShow(instance) === false) { + return; + } + instance.state.isVisible = true; + if (getIsDefaultRenderFn()) { + popper2.style.visibility = "visible"; + } + handleStyles(); + addDocumentPress(); + if (!instance.state.isMounted) { + popper2.style.transition = "none"; + } + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content; + setTransitionDuration([box, content], 0); + } + onFirstUpdate = function onFirstUpdate2() { + var _instance$popperInsta2; + if (!instance.state.isVisible || ignoreOnFirstUpdate) { + return; + } + ignoreOnFirstUpdate = true; + void popper2.offsetHeight; + popper2.style.transition = instance.props.moveTransition; + if (getIsDefaultRenderFn() && instance.props.animation) { + var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content; + setTransitionDuration([_box, _content], duration); + setVisibilityState([_box, _content], "visible"); + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); + pushIfUnique(mountedInstances, instance); + (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); + invokeHook("onMount", [instance]); + if (instance.props.animation && getIsDefaultRenderFn()) { + onTransitionedIn(duration, function() { + instance.state.isShown = true; + invokeHook("onShown", [instance]); + }); + } + }; + mount(); + } + function hide2() { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hide")); + } + var isAlreadyHidden = !instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps2.duration); + if (isAlreadyHidden || isDestroyed || isDisabled) { + return; + } + invokeHook("onHide", [instance], false); + if (instance.props.onHide(instance) === false) { + return; + } + instance.state.isVisible = false; + instance.state.isShown = false; + ignoreOnFirstUpdate = false; + isVisibleFromClick = false; + if (getIsDefaultRenderFn()) { + popper2.style.visibility = "hidden"; + } + cleanupInteractiveMouseListeners(); + removeDocumentPress(); + handleStyles(true); + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content; + if (instance.props.animation) { + setTransitionDuration([box, content], duration); + setVisibilityState([box, content], "hidden"); + } + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); + if (instance.props.animation) { + if (getIsDefaultRenderFn()) { + onTransitionedOut(duration, instance.unmount); + } + } else { + instance.unmount(); + } + } + function hideWithInteractivity(event) { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity")); + } + getDocument().addEventListener("mousemove", debouncedOnMouseMove); + pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); + debouncedOnMouseMove(event); + } + function unmount() { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("unmount")); + } + if (instance.state.isVisible) { + instance.hide(); + } + if (!instance.state.isMounted) { + return; + } + destroyPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + nestedPopper._tippy.unmount(); + }); + if (popper2.parentNode) { + popper2.parentNode.removeChild(popper2); + } + mountedInstances = mountedInstances.filter(function(i2) { + return i2 !== instance; + }); + instance.state.isMounted = false; + invokeHook("onHidden", [instance]); + } + function destroy() { + if (true) { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("destroy")); + } + if (instance.state.isDestroyed) { + return; + } + instance.clearDelayTimeouts(); + instance.unmount(); + removeListeners(); + delete reference2._tippy; + instance.state.isDestroyed = true; + invokeHook("onDestroy", [instance]); + } + } + function tippy(targets, optionalProps) { + if (optionalProps === void 0) { + optionalProps = {}; + } + var plugins = defaultProps2.plugins.concat(optionalProps.plugins || []); + if (true) { + validateTargets(targets); + validateProps(optionalProps, plugins); + } + bindGlobalEventListeners(); + var passedProps = Object.assign({}, optionalProps, { + plugins + }); + var elements = getArrayOfElements(targets); + if (true) { + var isSingleContentElement = isElement2(passedProps.content); + var isMoreThanOneReferenceElement = elements.length > 1; + warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" ")); + } + var instances = elements.reduce(function(acc, reference2) { + var instance = reference2 && createTippy(reference2, passedProps); + if (instance) { + acc.push(instance); + } + return acc; + }, []); + return isElement2(targets) ? instances[0] : instances; + } + tippy.defaultProps = defaultProps2; + tippy.setDefaultProps = setDefaultProps; + tippy.currentInput = currentInput; + var applyStylesModifier = Object.assign({}, applyStyles_default, { + effect: function effect4(_ref) { + var state = _ref.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + } + }); + tippy.setDefaultProps({ + render + }); + var tippy_esm_default = tippy; + + // ../../node_modules/@tippyjs/react/dist/tippy-react.esm.js + var import_react6 = __toESM(require_react()); + var import_react_dom2 = __toESM(require_react_dom()); + function _objectWithoutPropertiesLoose2(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i2; + for (i2 = 0; i2 < sourceKeys.length; i2++) { + key = sourceKeys[i2]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; + } + var isBrowser2 = typeof window !== "undefined" && typeof document !== "undefined"; + function preserveRef(ref, node) { + if (ref) { + if (typeof ref === "function") { + ref(node); + } + if ({}.hasOwnProperty.call(ref, "current")) { + ref.current = node; + } + } + } + function ssrSafeCreateDiv() { + return isBrowser2 && document.createElement("div"); + } + function toDataAttributes(attrs) { + var dataAttrs = { + "data-placement": attrs.placement + }; + if (attrs.referenceHidden) { + dataAttrs["data-reference-hidden"] = ""; + } + if (attrs.escaped) { + dataAttrs["data-escaped"] = ""; + } + return dataAttrs; + } + function deepEqual(x2, y) { + if (x2 === y) { + return true; + } else if (typeof x2 === "object" && x2 != null && typeof y === "object" && y != null) { + if (Object.keys(x2).length !== Object.keys(y).length) { + return false; + } + for (var prop in x2) { + if (y.hasOwnProperty(prop)) { + if (!deepEqual(x2[prop], y[prop])) { + return false; + } + } else { + return false; + } + } + return true; + } else { + return false; + } + } + function uniqueByShape(arr) { + var output = []; + arr.forEach(function(item) { + if (!output.find(function(outputItem) { + return deepEqual(item, outputItem); + })) { + output.push(item); + } + }); + return output; + } + function deepPreserveProps(instanceProps, componentProps) { + var _instanceProps$popper, _componentProps$poppe; + return Object.assign({}, componentProps, { + popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, { + modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || [])) + }) + }); + } + var useIsomorphicLayoutEffect = isBrowser2 ? import_react6.useLayoutEffect : import_react6.useEffect; + function useMutableBox(initialValue) { + var ref = (0, import_react6.useRef)(); + if (!ref.current) { + ref.current = typeof initialValue === "function" ? initialValue() : initialValue; + } + return ref.current; + } + function updateClassName(box, action, classNames) { + classNames.split(/\s+/).forEach(function(name) { + if (name) { + box.classList[action](name); + } + }); + } + var classNamePlugin = { + name: "className", + defaultValue: "", + fn: function fn2(instance) { + var box = instance.popper.firstElementChild; + var isDefaultRenderFn = function isDefaultRenderFn2() { + var _instance$props$rende; + return !!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy); + }; + function add() { + if (instance.props.className && !isDefaultRenderFn()) { + if (true) { + console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with", "`render` prop. Place the className on the element you are", "rendering."].join(" ")); + } + return; + } + updateClassName(box, "add", instance.props.className); + } + function remove() { + if (isDefaultRenderFn()) { + updateClassName(box, "remove", instance.props.className); + } + } + return { + onCreate: add, + onBeforeUpdate: remove, + onAfterUpdate: add + }; + } + }; + function TippyGenerator(tippy2) { + function Tippy(_ref) { + var children = _ref.children, content = _ref.content, visible = _ref.visible, singleton = _ref.singleton, render2 = _ref.render, reference2 = _ref.reference, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$ignoreAttributes = _ref.ignoreAttributes, ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes, __source = _ref.__source, __self = _ref.__self, restOfNativeProps = _objectWithoutPropertiesLoose2(_ref, ["children", "content", "visible", "singleton", "render", "reference", "disabled", "ignoreAttributes", "__source", "__self"]); + var isControlledMode = visible !== void 0; + var isSingletonMode = singleton !== void 0; + var _useState = (0, import_react6.useState)(false), mounted = _useState[0], setMounted = _useState[1]; + var _useState2 = (0, import_react6.useState)({}), attrs = _useState2[0], setAttrs = _useState2[1]; + var _useState3 = (0, import_react6.useState)(), singletonContent = _useState3[0], setSingletonContent = _useState3[1]; + var mutableBox = useMutableBox(function() { + return { + container: ssrSafeCreateDiv(), + renders: 1 + }; + }); + var props = Object.assign({ + ignoreAttributes + }, restOfNativeProps, { + content: mutableBox.container + }); + if (isControlledMode) { + if (true) { + ["trigger", "hideOnClick", "showOnCreate"].forEach(function(nativeStateProp) { + if (props[nativeStateProp] !== void 0) { + console.warn(["@tippyjs/react: Cannot specify `" + nativeStateProp + "` prop in", "controlled mode (`visible` prop)"].join(" ")); + } + }); + } + props.trigger = "manual"; + props.hideOnClick = false; + } + if (isSingletonMode) { + disabled = true; + } + var computedProps = props; + var plugins = props.plugins || []; + if (render2) { + computedProps = Object.assign({}, props, { + plugins: isSingletonMode && singleton.data != null ? [].concat(plugins, [{ + fn: function fn3() { + return { + onTrigger: function onTrigger2(instance, event) { + var node = singleton.data.children.find(function(_ref2) { + var instance2 = _ref2.instance; + return instance2.reference === event.currentTarget; + }); + instance.state.$$activeSingletonInstance = node.instance; + setSingletonContent(node.content); + } + }; + } + }]) : plugins, + render: function render3() { + return { + popper: mutableBox.container + }; + } + }); + } + var deps = [reference2].concat(children ? [children.type] : []); + useIsomorphicLayoutEffect(function() { + var element = reference2; + if (reference2 && reference2.hasOwnProperty("current")) { + element = reference2.current; + } + var instance = tippy2(element || mutableBox.ref || ssrSafeCreateDiv(), Object.assign({}, computedProps, { + plugins: [classNamePlugin].concat(props.plugins || []) + })); + mutableBox.instance = instance; + if (disabled) { + instance.disable(); + } + if (visible) { + instance.show(); + } + if (isSingletonMode) { + singleton.hook({ + instance, + content, + props: computedProps, + setSingletonContent + }); + } + setMounted(true); + return function() { + instance.destroy(); + singleton == null ? void 0 : singleton.cleanup(instance); + }; + }, deps); + useIsomorphicLayoutEffect(function() { + var _instance$popperInsta; + if (mutableBox.renders === 1) { + mutableBox.renders++; + return; + } + var instance = mutableBox.instance; + instance.setProps(deepPreserveProps(instance.props, computedProps)); + (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.forceUpdate(); + if (disabled) { + instance.disable(); + } else { + instance.enable(); + } + if (isControlledMode) { + if (visible) { + instance.show(); + } else { + instance.hide(); + } + } + if (isSingletonMode) { + singleton.hook({ + instance, + content, + props: computedProps, + setSingletonContent + }); + } + }); + useIsomorphicLayoutEffect(function() { + var _instance$props$poppe; + if (!render2) { + return; + } + var instance = mutableBox.instance; + instance.setProps({ + popperOptions: Object.assign({}, instance.props.popperOptions, { + modifiers: [].concat((((_instance$props$poppe = instance.props.popperOptions) == null ? void 0 : _instance$props$poppe.modifiers) || []).filter(function(_ref3) { + var name = _ref3.name; + return name !== "$$tippyReact"; + }), [{ + name: "$$tippyReact", + enabled: true, + phase: "beforeWrite", + requires: ["computeStyles"], + fn: function fn3(_ref4) { + var _state$modifiersData; + var state = _ref4.state; + var hideData = (_state$modifiersData = state.modifiersData) == null ? void 0 : _state$modifiersData.hide; + if (attrs.placement !== state.placement || attrs.referenceHidden !== (hideData == null ? void 0 : hideData.isReferenceHidden) || attrs.escaped !== (hideData == null ? void 0 : hideData.hasPopperEscaped)) { + setAttrs({ + placement: state.placement, + referenceHidden: hideData == null ? void 0 : hideData.isReferenceHidden, + escaped: hideData == null ? void 0 : hideData.hasPopperEscaped + }); + } + state.attributes.popper = {}; + } + }]) + }) + }); + }, [attrs.placement, attrs.referenceHidden, attrs.escaped].concat(deps)); + return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, children ? /* @__PURE__ */ (0, import_react6.cloneElement)(children, { + ref: function ref(node) { + mutableBox.ref = node; + preserveRef(children.ref, node); + } + }) : null, mounted && /* @__PURE__ */ (0, import_react_dom2.createPortal)(render2 ? render2(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content, mutableBox.container)); + } + return Tippy; + } + var forwardRef3 = function(Tippy, defaultProps3) { + return /* @__PURE__ */ (0, import_react6.forwardRef)(function TippyWrapper(_ref, _ref2) { + var children = _ref.children, props = _objectWithoutPropertiesLoose2(_ref, ["children"]); + return /* @__PURE__ */ import_react6.default.createElement(Tippy, Object.assign({}, defaultProps3, props), children ? /* @__PURE__ */ (0, import_react6.cloneElement)(children, { + ref: function ref(node) { + preserveRef(_ref2, node); + preserveRef(children.ref, node); + } + }) : null); + }); + }; + var index = /* @__PURE__ */ forwardRef3(/* @__PURE__ */ TippyGenerator(tippy_esm_default)); + var tippy_react_esm_default = index; + + // src/Input/InputWrapper.tsx + var InputWrapper = ({ + children, + label, + error, + info, + id + }) => { + return /* @__PURE__ */ React.createElement("div", { + className: "Input__Wrapper" + }, /* @__PURE__ */ React.createElement("div", { + className: "Input__Wrapper__Header" + }, label && /* @__PURE__ */ React.createElement("label", { + htmlFor: id + }, label), info && /* @__PURE__ */ React.createElement(tippy_react_esm_default, { + delay: [700, 0], + content: info + }, /* @__PURE__ */ React.createElement("i", { + className: "fa fa-info-circle" + }))), children, error && /* @__PURE__ */ React.createElement("div", { + className: "Input__Wrapper__Error" + }, error)); + }; + var InputWrapper_default = InputWrapper; + + // src/Input/Input.tsx + var InputIcon = ({ + icon, + alignment = "left" + }) => { + return /* @__PURE__ */ React.createElement("span", { + className: `Input__Icon Input__Icon${alignment === "left" ? "--left" : "--right"}` + }, icon); + }; + var Input = (0, import_react8.forwardRef)( + ({ + value, + onChange, + className = "", + emphasize, + placeholder, + icon, + iconAlignment = "left", + type = "text", + isValid, + label, + id, + info, + error, + ...props + }, ref) => { + return /* @__PURE__ */ React.createElement(InputWrapper_default, { + id, + label, + error, + info + }, /* @__PURE__ */ React.createElement("div", { + className: "Input__Text__Wrapper" + }, /* @__PURE__ */ React.createElement("input", { + ref, + type, + value, + id, + onChange, + className: `Input__Text ${emphasize ? "Input__Text--emphasize" : ""} ${iconAlignment === "left" && icon ? "Input__Text--withIcon" : icon && isValid ? "Input__Text--withIcons" : ""}`, + placeholder, + ...props + }), icon && /* @__PURE__ */ React.createElement(InputIcon, { + alignment: iconAlignment, + icon + }), icon && isValid && iconAlignment === "left" && /* @__PURE__ */ React.createElement(InputIcon, { + alignment: iconAlignment, + icon: /* @__PURE__ */ React.createElement("i", { + className: "fas fa-check" + }) + }))); + } + ); + var Input_default = Input; + + // src/ErrorBoundary.tsx + var import_react9 = __toESM(require_react()); + var ErrorBoundary = class extends import_react9.Component { + constructor() { + super(...arguments); + __publicField(this, "state", { + hasError: false + }); + } + static getDerivedStateFromError(_2) { + return { hasError: true }; + } + componentDidCatch(error, errorInfo) { + } + render() { + if (this.state.hasError) { + console.log(this.state); + return /* @__PURE__ */ React.createElement("span", { + className: "block p-8 text-2xl text-center text-red" + }, "Une erreur est survenue"); + } + return this.props.children; + } + }; + var ErrorBoundary_default = ErrorBoundary; + + // src/Library/index.tsx + var import_blocks_editor = __toESM(require_blocks_editor()); + var TagsList = ({ + currentTags, + onUpdate + }) => { + const { data } = useGetTags(); + const tags = data?.filter( + (tagFromServer) => !currentTags.find( + ({ tag }) => tag.id === tagFromServer.id + ) + ) || []; + return /* @__PURE__ */ React.createElement("ul", { + className: "TagList" + }, tags?.length > 0 ? tags.map((tag) => /* @__PURE__ */ React.createElement("li", { + key: tag.id, + onClick: () => { + onUpdate(tag); + }, + className: "TagList__Item" + }, /* @__PURE__ */ React.createElement("span", null, tag.title))) : /* @__PURE__ */ React.createElement("li", { + className: "TagList__Item" + }, /* @__PURE__ */ React.createElement("span", null, "No tags available."))); + }; + var TagConfigurationModal = ({ + isOpen, + setIsOpen, + image + }) => { + const [showTags, setShowTags] = (0, import_react10.useState)(false); + const intl = useIntl(); + const deleteTagAssociation = useDeleteTagAssociation(); + const associateTag = useAssociateTag(); + return /* @__PURE__ */ React.createElement(import_react_modal.default, { + isOpen, + onRequestClose: () => { + setIsOpen(false); + }, + className: "Modal-Tags", + overlayClassName: "Overlay" + }, /* @__PURE__ */ React.createElement("div", { + className: "Modal__Wrapper" + }, /* @__PURE__ */ React.createElement("div", { + className: "Modal__Header" + }, /* @__PURE__ */ React.createElement("button", { + onClick: () => { + setIsOpen(false); + }, + className: "Modal__Header__Close" + }, /* @__PURE__ */ React.createElement(SvgXmark, null)), /* @__PURE__ */ React.createElement("div", { + className: "Modal__Header__Title" + }, intl.formatMessage({ id: "BlockImage__LIBRARY_IMAGE_TAG_CONFIG" }), " ", image.title)), /* @__PURE__ */ React.createElement("div", { + className: "Modal__Content", + style: { overflow: "inherit" } + }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, intl.formatMessage({ id: "BlockImage__LIBRARY_IMAGE_ADD_TAG" })), /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__TagSelector" + }, /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__TagSelector__Tags", + style: { paddingLeft: image.tags.length < 1 ? "14px" : "0" } + }, image.tags.length ? image.tags.map(({ tag, imageTag }) => /* @__PURE__ */ React.createElement("div", { + key: tag.id, + className: "BlockImage__TagSelector__Tag" + }, /* @__PURE__ */ React.createElement("span", null, tag.title), /* @__PURE__ */ React.createElement("button", { + className: "BlockImage__TagSelector__Tag__Remove", + onClick: () => deleteTagAssociation.mutate(imageTag.id || 57) + }, /* @__PURE__ */ React.createElement(SvgTagXmark, null)))) : !associateTag.isLoading ? intl.formatMessage({ + id: "BlockImage__LIBRARY_IMAGE_SELECT_TAG" + }) : null, associateTag.isLoading && /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__TagSelector__Tag" + }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", { + className: "fa fa-circle-notch fa-spin" + })))), /* @__PURE__ */ React.createElement("button", { + className: "BlockImage__TagSelector__Add", + onClick: () => setShowTags(!showTags), + disabled: associateTag.isLoading || deleteTagAssociation.isLoading + }, /* @__PURE__ */ React.createElement("i", { + className: "block fas fa-plus" + })), showTags ? /* @__PURE__ */ React.createElement(import_react10.Suspense, { + fallback: /* @__PURE__ */ React.createElement("div", { + className: "BlockProduct__Loader" + }, /* @__PURE__ */ React.createElement("i", { + className: "fa fa-circle-notch fa-spin" + })) + }, /* @__PURE__ */ React.createElement(TagsList, { + currentTags: image.tags, + onUpdate: (selectedTag) => { + associateTag.mutate({ + imageId: image.id, + tagId: selectedTag.id + }); + setShowTags(false); + } + })) : null))))); + }; + var TagFilterOptions = () => { + const intl = useIntl(); + const { data: tags } = useGetTags(); + return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("option", { + value: "" + }, intl.formatMessage({ id: "ALL_TAGS" })), tags?.map((tag) => /* @__PURE__ */ React.createElement("option", { + key: tag.id, + value: tag.id + }, tag.title))); + }; + var TagFilter = ({ setTagId }) => { + const intl = useIntl(); + return /* @__PURE__ */ React.createElement("div", { + className: "Select__Wrapper" + }, /* @__PURE__ */ React.createElement("div", { + className: "Input__Select__Separator" + }), /* @__PURE__ */ React.createElement("label", { + htmlFor: "tag-filter", + style: { display: "flex" } + }, intl.formatMessage({ id: "BlockImage__LIBRARY_MODAL_TAG_FILTER" })), /* @__PURE__ */ React.createElement("select", { + className: "Input__Select", + name: "tag-filter", + id: "tag-filter", + onChange: (e2) => setTagId(e2.target.value) + }, /* @__PURE__ */ React.createElement(import_react10.Suspense, { + fallback: /* @__PURE__ */ React.createElement("option", null, intl.formatMessage({ id: "LOADING" })) + }, /* @__PURE__ */ React.createElement(TagFilterOptions, null)))); + }; + var LibraryImage = ({ + image, + onSelect + }) => { + const [isTagModalOpen, setIsTagModalOpen] = (0, import_react10.useState)(false); + const intl = useIntl(); + const deleteMutation = useDeleteImage(); + const { getUrlWithPrefix } = (0, import_react10.useContext)(import_blocks_editor.LocaleContext); + return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { + className: "Library__Image" + }, /* @__PURE__ */ React.createElement("div", { + className: "Library__Image__Tags" + }, image.tags?.map(({ tag }) => /* @__PURE__ */ React.createElement("span", { + key: tag.id, + style: { + border: `1px solid ${tag.colorCode}`, + color: tag.colorCode + }, + className: "Library__Image__Tag" + }, tag.title))), /* @__PURE__ */ React.createElement("img", { + width: "150", + height: "150", + loading: "lazy", + src: getUrlWithPrefix( + `/image-library/${image.id}/full/^!150,150/0/default.webp` + ) + }), /* @__PURE__ */ React.createElement("span", { + className: "Library__Image__Title" + }, image.title), /* @__PURE__ */ React.createElement("div", { + className: "Library__Image__Actions" + }, /* @__PURE__ */ React.createElement("span", { + className: "Library__Image__Action__Title" + }, image.title), /* @__PURE__ */ React.createElement("button", { + className: "Library__Image__Select__Action", + style: { marginTop: "12px", marginBottom: "6px" }, + onClick: () => onSelect(image) + }, intl.formatMessage({ id: "CHOOSE" })), /* @__PURE__ */ React.createElement("div", { + className: "Library__Image__Actions__Wrapper" + }, /* @__PURE__ */ React.createElement("button", { + className: "Library__Image__Tag__Action", + onClick: () => setIsTagModalOpen(true) + }, /* @__PURE__ */ React.createElement("i", { + className: "fas fa-tag" + })), /* @__PURE__ */ React.createElement("button", { + className: "Library__Image__Delete__Action", + onClick: () => deleteMutation.mutate(image.id) + }, /* @__PURE__ */ React.createElement(SvgTrash, null))))), /* @__PURE__ */ React.createElement(TagConfigurationModal, { + image, + isOpen: isTagModalOpen, + setIsOpen: setIsTagModalOpen + })); + }; + var LibraryContent = ({ + limit = 20, + onSelect, + setMode + }) => { + const [offset2, setOffset] = (0, import_react10.useState)(0); + const [title, setTitle] = (0, import_react10.useState)(""); + const [tagId, setTagId] = (0, import_react10.useState)(); + const { + data: images = [], + isFetching, + isPreviousData + } = useLibraryImage({ + offset: offset2, + limit, + title, + tagId + }); + const intl = useIntl(); + return /* @__PURE__ */ React.createElement("div", { + className: "Library" + }, /* @__PURE__ */ React.createElement("div", { + className: "Library__Filters" + }, /* @__PURE__ */ React.createElement(Input_default, { + placeholder: intl.formatMessage({ id: "SEARCH_BY" }), + type: "text", + name: "library-search", + id: "library-search", + value: title, + onChange: (e2) => setTitle(e2.target.value), + label: intl.formatMessage({ id: "BlockImage__LIBRARY_MODAL_SEARCH" }), + icon: /* @__PURE__ */ React.createElement("i", { + className: "fa fa-search emphasize" + }), + iconAlignment: "right" + }), /* @__PURE__ */ React.createElement(TagFilter, { + setTagId + }), /* @__PURE__ */ React.createElement("button", { + className: "BlockImage__Button", + style: { + marginTop: "auto", + height: "40px" + }, + onClick: () => setMode("upload") + }, intl.formatMessage({ id: "BlockImage__LIBRARY_MODAL_TITLE_UPLOAD" }))), /* @__PURE__ */ React.createElement("div", { + className: "Library__Content" + }, isFetching ? /* @__PURE__ */ React.createElement("div", { + className: "Modal__Content__Loader" + }, /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__LIBRARY_SEARCHING" })), /* @__PURE__ */ React.createElement("i", { + className: "Loader fa fa-circle-notch fa-spin" + })) : images.length > 0 ? images?.map((image) => { + return /* @__PURE__ */ React.createElement(LibraryImage, { + key: image.id, + image, + onSelect + }); + }) : /* @__PURE__ */ React.createElement("div", { + className: "Library__NoContent" + }, /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__LIBRARY_NO_CONTENT" })))), /* @__PURE__ */ React.createElement("div", { + className: "Pagination" + }, /* @__PURE__ */ React.createElement("button", { + className: "Pagination__Button Pagination__Button--previous", + onClick: () => setOffset((old) => Math.max(old - limit, 0)), + disabled: offset2 === 0 + }, /* @__PURE__ */ React.createElement("i", { + className: "fa fa-chevron-left" + })), /* @__PURE__ */ React.createElement("div", { + className: "Pagination__Button Pagination__Button--page" + }, offset2 / limit + 1), /* @__PURE__ */ React.createElement("button", { + className: "Pagination__Button Pagination__Button--next", + onClick: () => { + if (!isPreviousData && (images?.length || 0) >= limit) { + setOffset((old) => old + limit); + } + }, + disabled: isPreviousData || (images?.length || 0) < limit + }, /* @__PURE__ */ React.createElement("i", { + className: "fa fa-chevron-right" + })))); + }; + function Library({ + isOpen, + setIsOpen, + limit = 20, + onSelect + }) { + const intl = useIntl(); + const [mode, setMode] = (0, import_react10.useState)("library"); + return /* @__PURE__ */ React.createElement(import_react_modal.default, { + isOpen, + onRequestClose: () => setIsOpen(false), + className: mode === "upload" ? "Modal-Upload" : "Modal-Library", + ariaHideApp: false, + overlayClassName: "Overlay" + }, /* @__PURE__ */ React.createElement("div", { + className: "Modal__Wrapper" + }, /* @__PURE__ */ React.createElement("div", { + className: "Modal__Header" + }, /* @__PURE__ */ React.createElement("button", { + onClick: () => setIsOpen(false), + className: "Modal__Header__Close" + }, /* @__PURE__ */ React.createElement(SvgXmark, null)), /* @__PURE__ */ React.createElement("div", { + className: "Modal__Header__Title" + }, mode === "upload" ? /* @__PURE__ */ React.createElement("button", { + className: "mr-2", + onClick: () => setMode("library") + }, /* @__PURE__ */ React.createElement("i", { + className: "fas fa-chevron-left" + })) : null, mode === "library" ? intl.formatMessage({ id: "BlockImage__LIBRARY_MODAL_TITLE" }) : intl.formatMessage({ + id: "BlockImage__LIBRARY_MODAL_TITLE_UPLOAD" + }))), /* @__PURE__ */ React.createElement("div", { + className: "Modal__Content" + }, mode === "library" ? /* @__PURE__ */ React.createElement(import_react10.Suspense, { + fallback: /* @__PURE__ */ React.createElement("div", { + className: "Modal__Content__Loader" + }, /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__LIBRARY_LOADING" })), /* @__PURE__ */ React.createElement("i", { + className: "Loader fa fa-circle-notch fa-spin" + })) + }, /* @__PURE__ */ React.createElement(ErrorBoundary_default, null, /* @__PURE__ */ React.createElement(LibraryContent, { + onSelect, + limit, + setMode + }))) : /* @__PURE__ */ React.createElement(UploadImage, { + onSelect, + uploadModes: ["local"] + })))); + } + function WrappedComponent(props) { + return /* @__PURE__ */ React.createElement(provider_default, { + locale, + defaultLocale: "fr", + messages: messages[locale] || messages["fr"] + }, /* @__PURE__ */ React.createElement(QueryClientProvider, { + client: u + }, /* @__PURE__ */ React.createElement(Library, { + ...props + }))); + } + + // ../../node_modules/react-hot-toast/dist/index.mjs + var import_react11 = __toESM(require_react(), 1); + var import_react12 = __toESM(require_react(), 1); + var d2 = __toESM(require_react(), 1); + + // ../../node_modules/goober/dist/goober.modern.js + var e = { data: "" }; + var t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e; + var l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g; + var a = /\/\*[^]*?\*\/| +/g; + var n2 = /\n+/g; + var o2 = (e2, t2) => { + let r = "", l2 = "", a2 = ""; + for (let n4 in e2) { + let c2 = e2[n4]; + "@" == n4[0] ? "i" == n4[1] ? r = n4 + " " + c2 + ";" : l2 += "f" == n4[1] ? o2(c2, n4) : n4 + "{" + o2(c2, "k" == n4[1] ? "" : t2) + "}" : "object" == typeof c2 ? l2 += o2(c2, t2 ? t2.replace(/([^,])+/g, (e3) => n4.replace(/(^:.*)|([^,])+/g, (t3) => /&/.test(t3) ? t3.replace(/&/g, e3) : e3 ? e3 + " " + t3 : t3)) : n4) : null != c2 && (n4 = /^--/.test(n4) ? n4 : n4.replace(/[A-Z]/g, "-$&").toLowerCase(), a2 += o2.p ? o2.p(n4, c2) : n4 + ":" + c2 + ";"); + } + return r + (t2 && a2 ? t2 + "{" + a2 + "}" : a2) + l2; + }; + var c = {}; + var s = (e2) => { + if ("object" == typeof e2) { + let t2 = ""; + for (let r in e2) + t2 += r + s(e2[r]); + return t2; + } + return e2; + }; + var i = (e2, t2, r, i2, p2) => { + let u4 = s(e2), d3 = c[u4] || (c[u4] = ((e3) => { + let t3 = 0, r2 = 11; + for (; t3 < e3.length; ) + r2 = 101 * r2 + e3.charCodeAt(t3++) >>> 0; + return "go" + r2; + })(u4)); + if (!c[d3]) { + let t3 = u4 !== e2 ? e2 : ((e3) => { + let t4, r2, o3 = [{}]; + for (; t4 = l.exec(e3.replace(a, "")); ) + t4[4] ? o3.shift() : t4[3] ? (r2 = t4[3].replace(n2, " ").trim(), o3.unshift(o3[0][r2] = o3[0][r2] || {})) : o3[0][t4[1]] = t4[2].replace(n2, " ").trim(); + return o3[0]; + })(e2); + c[d3] = o2(p2 ? { ["@keyframes " + d3]: t3 } : t3, r ? "" : "." + d3); + } + return ((e3, t3, r2) => { + -1 == t3.data.indexOf(e3) && (t3.data = r2 ? e3 + t3.data : t3.data + e3); + })(c[d3], t2, i2), d3; + }; + var p = (e2, t2, r) => e2.reduce((e3, l2, a2) => { + let n4 = t2[a2]; + if (n4 && n4.call) { + let e4 = n4(r), t3 = e4 && e4.props && e4.props.className || /^go/.test(e4) && e4; + n4 = t3 ? "." + t3 : e4 && "object" == typeof e4 ? e4.props ? "" : o2(e4, "") : false === e4 ? "" : e4; + } + return e3 + l2 + (null == n4 ? "" : n4); + }, ""); + function u2(e2) { + let r = this || {}, l2 = e2.call ? e2(r.p) : e2; + return i(l2.unshift ? l2.raw ? p(l2, [].slice.call(arguments, 1), r.p) : l2.reduce((e3, t2) => Object.assign(e3, t2 && t2.call ? t2(r.p) : t2), {}) : l2, t(r.target), r.g, r.o, r.k); + } + var d; + var f2; + var g; + var b = u2.bind({ g: 1 }); + var h = u2.bind({ k: 1 }); + function m(e2, t2, r, l2) { + o2.p = t2, d = e2, f2 = r, g = l2; + } + function j(e2, t2) { + let r = this || {}; + return function() { + let l2 = arguments; + function a2(n4, o3) { + let c2 = Object.assign({}, n4), s2 = c2.className || a2.className; + r.p = Object.assign({ theme: f2 && f2() }, c2), r.o = / *go\d+/.test(s2), c2.className = u2.apply(r, l2) + (s2 ? " " + s2 : ""), t2 && (c2.ref = o3); + let i2 = e2; + return e2[0] && (i2 = c2.as || e2, delete c2.as), g && i2[0] && g(c2), d(i2, c2); + } + return t2 ? t2(a2) : a2; + }; + } + + // ../../node_modules/react-hot-toast/dist/index.mjs + var f3 = __toESM(require_react(), 1); + var x = __toESM(require_react(), 1); + var H = (e2) => typeof e2 == "function"; + var u3 = (e2, t2) => H(e2) ? e2(t2) : e2; + var U = (() => { + let e2 = 0; + return () => (++e2).toString(); + })(); + var $ = (e2) => (t2) => { + t2 && setTimeout(() => { + let o3 = t2.getBoundingClientRect(); + e2(o3); + }); + }; + var S = (() => { + let e2; + return () => { + if (e2 === void 0 && typeof window < "u") { + let t2 = matchMedia("(prefers-reduced-motion: reduce)"); + e2 = !t2 || t2.matches; + } + return e2; + }; + })(); + var Q = 20; + var A = /* @__PURE__ */ new Map(); + var L = (e2) => { + if (A.has(e2)) + return; + let t2 = setTimeout(() => { + A.delete(e2), m2({ type: 4, toastId: e2 }); + }, 1e3); + A.set(e2, t2); + }; + var J = (e2) => { + let t2 = A.get(e2); + t2 && clearTimeout(t2); + }; + var E = (e2, t2) => { + switch (t2.type) { + case 0: + return { ...e2, toasts: [t2.toast, ...e2.toasts].slice(0, Q) }; + case 1: + return t2.toast.id && J(t2.toast.id), { ...e2, toasts: e2.toasts.map((a2) => a2.id === t2.toast.id ? { ...a2, ...t2.toast } : a2) }; + case 2: + let { toast: o3 } = t2; + return e2.toasts.find((a2) => a2.id === o3.id) ? E(e2, { type: 1, toast: o3 }) : E(e2, { type: 0, toast: o3 }); + case 3: + let { toastId: s2 } = t2; + return s2 ? L(s2) : e2.toasts.forEach((a2) => { + L(a2.id); + }), { ...e2, toasts: e2.toasts.map((a2) => a2.id === s2 || s2 === void 0 ? { ...a2, visible: false } : a2) }; + case 4: + return t2.toastId === void 0 ? { ...e2, toasts: [] } : { ...e2, toasts: e2.toasts.filter((a2) => a2.id !== t2.toastId) }; + case 5: + return { ...e2, pausedAt: t2.time }; + case 6: + let r = t2.time - (e2.pausedAt || 0); + return { ...e2, pausedAt: void 0, toasts: e2.toasts.map((a2) => ({ ...a2, pauseDuration: a2.pauseDuration + r })) }; + } + }; + var P = []; + var R = { toasts: [], pausedAt: void 0 }; + var m2 = (e2) => { + R = E(R, e2), P.forEach((t2) => { + t2(R); + }); + }; + var X = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }; + var v = (e2 = {}) => { + let [t2, o3] = (0, import_react11.useState)(R); + (0, import_react11.useEffect)(() => (P.push(o3), () => { + let r = P.indexOf(o3); + r > -1 && P.splice(r, 1); + }), [t2]); + let s2 = t2.toasts.map((r) => { + var a2, i2; + return { ...e2, ...e2[r.type], ...r, duration: r.duration || ((a2 = e2[r.type]) == null ? void 0 : a2.duration) || (e2 == null ? void 0 : e2.duration) || X[r.type], style: { ...e2.style, ...(i2 = e2[r.type]) == null ? void 0 : i2.style, ...r.style } }; + }); + return { ...t2, toasts: s2 }; + }; + var q = (e2, t2 = "blank", o3) => ({ createdAt: Date.now(), visible: true, type: t2, ariaProps: { role: "status", "aria-live": "polite" }, message: e2, pauseDuration: 0, ...o3, id: (o3 == null ? void 0 : o3.id) || U() }); + var g2 = (e2) => (t2, o3) => { + let s2 = q(t2, e2, o3); + return m2({ type: 2, toast: s2 }), s2.id; + }; + var n3 = (e2, t2) => g2("blank")(e2, t2); + n3.error = g2("error"); + n3.success = g2("success"); + n3.loading = g2("loading"); + n3.custom = g2("custom"); + n3.dismiss = (e2) => { + m2({ type: 3, toastId: e2 }); + }; + n3.remove = (e2) => m2({ type: 4, toastId: e2 }); + n3.promise = (e2, t2, o3) => { + let s2 = n3.loading(t2.loading, { ...o3, ...o3 == null ? void 0 : o3.loading }); + return e2.then((r) => (n3.success(u3(t2.success, r), { id: s2, ...o3, ...o3 == null ? void 0 : o3.success }), r)).catch((r) => { + n3.error(u3(t2.error, r), { id: s2, ...o3, ...o3 == null ? void 0 : o3.error }); + }), e2; + }; + var D = (e2) => { + let { toasts: t2, pausedAt: o3 } = v(e2); + (0, import_react12.useEffect)(() => { + if (o3) + return; + let r = Date.now(), a2 = t2.map((i2) => { + if (i2.duration === 1 / 0) + return; + let T = (i2.duration || 0) + i2.pauseDuration - (r - i2.createdAt); + if (T < 0) { + i2.visible && n3.dismiss(i2.id); + return; + } + return setTimeout(() => n3.dismiss(i2.id), T); + }); + return () => { + a2.forEach((i2) => i2 && clearTimeout(i2)); + }; + }, [t2, o3]); + let s2 = (0, import_react12.useMemo)(() => ({ startPause: () => { + m2({ type: 5, time: Date.now() }); + }, endPause: () => { + o3 && m2({ type: 6, time: Date.now() }); + }, updateHeight: (r, a2) => m2({ type: 1, toast: { id: r, height: a2 } }), calculateOffset: (r, a2) => { + let { reverseOrder: i2 = false, gutter: T = 8, defaultPosition: l2 } = a2 || {}, c2 = t2.filter((p2) => (p2.position || l2) === (r.position || l2) && p2.height), h2 = c2.findIndex((p2) => p2.id === r.id), b2 = c2.filter((p2, y) => y < h2 && p2.visible).length; + return c2.filter((p2) => p2.visible).slice(...i2 ? [b2 + 1] : [0, b2]).reduce((p2, y) => p2 + (y.height || 0) + T, 0); + } }), [t2, o3]); + return { toasts: t2, handlers: s2 }; + }; + var ee = h` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -40,7 +15992,8 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,F0=Ue` +}`; + var te = h` from { transform: scale(0); opacity: 0; @@ -48,7 +16001,8 @@ from { to { transform: scale(1); opacity: 1; -}`,B0=Ue` +}`; + var oe = h` from { transform: scale(0) rotate(90deg); opacity: 0; @@ -56,28 +16010,29 @@ from { to { transform: scale(1) rotate(90deg); opacity: 1; -}`,H0=ze("div")` +}`; + var k = j("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; - background: ${e=>e.primary||"#ff4b4b"}; + background: ${(e2) => e2.primary || "#ff4b4b"}; position: relative; transform: rotate(45deg); - animation: ${M0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${ee} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; - animation: ${F0} 0.15s ease-out forwards; + animation: ${te} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; - background: ${e=>e.secondary||"#fff"}; + background: ${(e2) => e2.secondary || "#fff"}; bottom: 9px; left: 4px; height: 2px; @@ -85,27 +16040,30 @@ to { } &:before { - animation: ${B0} 0.15s ease-out forwards; + animation: ${oe} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } -`,k0=Ue` +`; + var se = h` from { transform: rotate(0deg); } to { transform: rotate(360deg); } -`,U0=ze("div")` +`; + var V = j("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; - border-color: ${e=>e.secondary||"#e0e0e0"}; - border-right-color: ${e=>e.primary||"#616161"}; - animation: ${k0} 1s linear infinite; -`,j0=Ue` + border-color: ${(e2) => e2.secondary || "#e0e0e0"}; + border-right-color: ${(e2) => e2.primary || "#616161"}; + animation: ${se} 1s linear infinite; +`; + var ne = h` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -113,7 +16071,8 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,q0=Ue` +}`; + var ce = h` 0% { height: 0; width: 0; @@ -127,43 +16086,47 @@ to { 100% { opacity: 1; height: 10px; -}`,G0=ze("div")` +}`; + var _ = j("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; - background: ${e=>e.primary||"#61d345"}; + background: ${(e2) => e2.primary || "#61d345"}; position: relative; transform: rotate(45deg); - animation: ${j0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${ne} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; - animation: ${q0} 0.2s ease-out forwards; + animation: ${ce} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; - border-color: ${e=>e.secondary||"#fff"}; + border-color: ${(e2) => e2.secondary || "#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } -`,W0=ze("div")` +`; + var de = j("div")` position: absolute; -`,V0=ze("div")` +`; + var me = j("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; -`,$0=Ue` +`; + var ue = h` from { transform: scale(0.6); opacity: 0.4; @@ -171,20 +16134,30 @@ from { to { transform: scale(1); opacity: 1; -}`,Q0=ze("div")` +}`; + var le = j("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; - animation: ${$0} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${ue} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; -`,z0=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?vr.createElement(Q0,null,t):t:r==="blank"?null:vr.createElement(V0,null,vr.createElement(U0,{...n}),r!=="loading"&&vr.createElement(W0,null,r==="error"?vr.createElement(H0,{...n}):vr.createElement(G0,{...n})))},Y0=e=>` -0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} +`; + var M = ({ toast: e2 }) => { + let { icon: t2, type: o3, iconTheme: s2 } = e2; + return t2 !== void 0 ? typeof t2 == "string" ? f3.createElement(le, null, t2) : t2 : o3 === "blank" ? null : f3.createElement(me, null, f3.createElement(V, { ...s2 }), o3 !== "loading" && f3.createElement(de, null, o3 === "error" ? f3.createElement(k, { ...s2 }) : f3.createElement(_, { ...s2 }))); + }; + var fe = (e2) => ` +0% {transform: translate3d(0,${e2 * -200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} -`,X0=e=>` +`; + var Te = (e2) => ` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} -100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} -`,K0="0%{opacity:0;} 100%{opacity:1;}",Z0="0%{opacity:1;} 100%{opacity:0;}",J0=ze("div",dt.forwardRef)` +100% {transform: translate3d(0,${e2 * -150}%,-1px) scale(.6); opacity:0;} +`; + var ye = "0%{opacity:0;} 100%{opacity:1;}"; + var ge = "0%{opacity:1;} 100%{opacity:0;}"; + var xe = j("div", d2.forwardRef)` display: flex; align-items: center; background: #fff; @@ -196,19 +16169,358 @@ to { pointer-events: auto; padding: 8px 10px; border-radius: 8px; -`,eb=ze("div")` +`; + var he = j("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; -`,tb=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=xd()?[K0,Z0]:[Y0(r),X0(r)];return{animation:t?`${Ue(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ue(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},rb=dt.memo(({toast:e,position:t,style:r,children:n})=>{let o=e!=null&&e.height?tb(e.position||t||"top-center",e.visible):{opacity:0},i=dt.createElement(z0,{toast:e}),a=dt.createElement(eb,{...e.ariaProps},fi(e.message,e));return dt.createElement(J0,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:a}):dt.createElement(dt.Fragment,null,i,a))});_d(Hn.createElement);var nb=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:xd()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},ob=Bn` +`; + var be = (e2, t2) => { + let s2 = e2.includes("top") ? 1 : -1, [r, a2] = S() ? [ye, ge] : [fe(s2), Te(s2)]; + return { animation: t2 ? `${h(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${h(a2)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` }; + }; + var C = d2.memo(({ toast: e2, position: t2, style: o3, children: s2 }) => { + let r = e2 != null && e2.height ? be(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, a2 = d2.createElement(M, { toast: e2 }), i2 = d2.createElement(he, { ...e2.ariaProps }, u3(e2.message, e2)); + return d2.createElement(xe, { className: e2.className, style: { ...r, ...o3, ...e2.style } }, typeof s2 == "function" ? s2({ icon: a2, message: i2 }) : d2.createElement(d2.Fragment, null, a2, i2)); + }); + m(x.createElement); + var Pe = (e2, t2) => { + let o3 = e2.includes("top"), s2 = o3 ? { top: 0 } : { bottom: 0 }, r = e2.includes("center") ? { justifyContent: "center" } : e2.includes("right") ? { justifyContent: "flex-end" } : {}; + return { left: 0, right: 0, display: "flex", position: "absolute", transition: S() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t2 * (o3 ? 1 : -1)}px)`, ...s2, ...r }; + }; + var Re = u2` z-index: 9999; > * { pointer-events: auto; } -`,si=16,Od=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,containerStyle:i,containerClassName:a})=>{let{toasts:s,handlers:u}=N0(r);return Hn.createElement("div",{style:{position:"fixed",zIndex:9999,top:si,left:si,right:si,bottom:si,pointerEvents:"none",...i},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map(c=>{let l=c.position||t,p=u.calculateOffset(c,{reverseOrder:e,gutter:n,defaultPosition:t}),f=nb(l,p),m=c.height?void 0:A0(g=>{u.updateHeight(c.id,g.height)});return Hn.createElement("div",{ref:m,className:c.visible?ob:"",key:c.id,style:f},c.type==="custom"?fi(c.message,c):o?o(c):Hn.createElement(rb,{toast:c,position:l}))}))};var ib=({onSelect:e,isWide:t=!1})=>{let r=ve(),n=Pf(),{getRootProps:o,isDragActive:i}=sa({multiple:!1,accept:{"image/*":[".png",".gif",".jpeg",".jpg",".webp",".svg"]},noClick:!0,maxFiles:1,onDrop:async a=>{if(a){let s=new FormData;s.append("image",a[0]);let u=await n.mutateAsync(s);e(u)}},onDropRejected:a=>{a.length>1?Fe.error(r.formatMessage({id:"BlockImage__TOAST_MAX_FILE"})):Fe.error(r.formatMessage({id:"BlockImage__TOAST_WRONG_FILE_TYPE"}))}});return React.createElement("div",{className:`BlockImage__FromLocal ${i?"BlockImage__FromLocal--active":""}`,style:{width:t?"100%":"50%"},...o()},React.createElement("div",{className:"BlockImage__FromLocal__Icon"},React.createElement(dl,null)),i?r.formatMessage({id:"BlockImage__DROP_TO_UPLOAD"}):n.isLoading?React.createElement(React.Fragment,null,React.createElement("span",null,r.formatMessage({id:"DOWNLOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):React.createElement(React.Fragment,null,React.createElement("form",{onSubmit:a=>{a.preventDefault()}},React.createElement("label",{className:"BlockImage__Button",htmlFor:"image"},r.formatMessage({id:"BlockImage__DOWNLOAD"})),React.createElement("input",{className:"BlockImage__FromLocal__FileInput",type:"file",accept:"image/*",name:"image",id:"image",onChange:async a=>{if(a.target.files){let s=new FormData;s.append("image",a.target.files[0]);let u=await n.mutateAsync(s);e(u)}}}),React.createElement("span",null,r.formatMessage({id:"BlockImage__OR_DROP"})))))},ab=({onSelect:e,isWide:t=!1})=>{let[r,n]=(0,nt.useState)(!1),o=ve();return React.createElement("div",{className:"BlockImage__FromLibrary",style:{width:t?"100%":"50%"}},React.createElement("div",{className:"BlockImage__FromLibrary__Icon"},React.createElement(ml,null)),React.createElement("button",{className:"BlockImage__Button",style:{marginBottom:"0.25rem"},onClick:()=>{n(!0)}},React.createElement("span",null,o.formatMessage({id:"BlockImage__SELECT_BUTTON"}))),React.createElement("span",null,o.formatMessage({id:"BlockImage__SELECT"})),r?React.createElement(Nn,{isOpen:r,setIsOpen:n,onSelect:i=>{n(!1),e(i)}}):null)},sb=({id:e,fileName:t,setEditMode:r})=>{let n=ve(),{getUrlWithPrefix:o}=(0,nt.useContext)(Cd.LocaleContext);return e?React.createElement("div",{className:"BlockImage__Preview"},React.createElement("img",{src:o(`/image-library/${e}/full/^!220,220/0/default.webp`),alt:"",loading:"lazy",onError:i=>i.target.src="https://via.placeholder.com/220"}),React.createElement("div",{className:"BlockImage__Preview__Infos"},React.createElement("span",{className:"BlockImage__Preview__FileName"},t),React.createElement("button",{className:"BlockImage__Button",onClick:()=>{r(!0)}},n.formatMessage({id:"REPLACE"})))):null},ub=({image:e,onChange:t})=>{let[r,n]=(0,nt.useState)(e.title),[o,i]=(0,nt.useState)(e.link?.url||""),[a,s]=(0,nt.useState)(e.width||""),[u,c]=(0,nt.useState)(e.height||""),l=ve();return React.createElement("form",{className:"BlockImage__Infos__Form",onSubmit:p=>{p.preventDefault()}},React.createElement("div",null,React.createElement("label",null,l.formatMessage({id:"BlockImage__TITLE"})),React.createElement("input",{className:"Input__Text",type:"text",name:"title",value:r,placeholder:l.formatMessage({id:"BlockImage__TITLE"}),onChange:p=>n(p.target.value),onBlur:()=>t({title:r})})),React.createElement("div",null,React.createElement("label",null,l.formatMessage({id:"BlockImage__LINK"})," (",l.formatMessage({id:"OPTIONAL"}),")"),React.createElement("input",{className:"Input__Text",type:"text",name:"linkUrl",value:o,placeholder:l.formatMessage({id:"BlockImage__LINK_PLACEHOLDER"}),onChange:p=>i(p.target.value),onBlur:()=>t({link:{url:o}})})),React.createElement("div",null,React.createElement("label",null,l.formatMessage({id:"BlockImage__WIDTH"})," (",l.formatMessage({id:"OPTIONAL"}),")"),React.createElement("input",{className:"Input__Text",type:"text",name:"width",value:a,placeholder:l.formatMessage({id:"BlockImage__WIDTH__PLACEHOLDER"}),onChange:p=>s(p.target.value),onBlur:()=>t({width:a})})),React.createElement("div",null,React.createElement("label",null,l.formatMessage({id:"BlockImage__HEIGHT"})," (",l.formatMessage({id:"OPTIONAL"}),")"),React.createElement("input",{className:"Input__Text",type:"text",name:"height",value:u,placeholder:l.formatMessage({id:"BlockImage__HEIGHT__PLACEHOLDER"}),onChange:p=>c(p.target.value),onBlur:()=>t({height:u})})))},Mn=({onSelect:e,compact:t,uploadModes:r=["local","library"]})=>{let n={local:ib,library:ab};return React.createElement(Tr,{locale:Nt,defaultLocale:"fr",messages:Mt[Nt]||Mt.fr},React.createElement(Pr,{client:gn},React.createElement("div",{className:`BlockImage__Upload__Wrapper ${t?"BlockImage__Upload--light":""}`},r.map(o=>{let i=n[o];return React.createElement(i,{key:o,onSelect:e,isWide:r.length<2})}))))},lb=e=>{let{data:t,onUpdate:r}=e,[n,o]=(0,nt.useState)(null),[i,a]=(0,nt.useState)(!1),s=ve();(0,nt.useEffect)(()=>{if(t.id){o(t);return}a(!0)},[t]);let u=c=>{r(c),a(!1)};return React.createElement("div",{className:"BlockImage"},n&&!i?React.createElement("div",{className:"BlockImage__Infos"},React.createElement(sb,{id:n.id,fileName:n.fileName,setEditMode:a}),React.createElement(ub,{image:n,onChange:c=>{r({...t,...c})}})):null,i?React.createElement(React.Fragment,null,n?.id?React.createElement("span",{style:{marginBottom:"15px",display:"block",fontWeight:800,fontSize:"18px"}},s.formatMessage({id:"REPLACE_IMAGE"}),' "',n.title,'"'):null,React.createElement(Mn,{onSelect:u}),n?.id?React.createElement("button",{onClick:()=>{a(!1)},style:{marginTop:"15px"},className:"BlockImage__Button"},s.formatMessage({id:"CANCEL"})):null):null)},cb=e=>React.createElement(Tr,{locale:Nt,defaultLocale:"fr",messages:Mt[Nt]||Mt.fr},React.createElement(Pr,{client:gn},React.createElement(Od,{toastOptions:{success:{style:{background:"#EAFBF5",border:"1px solid #005A3A"}},error:{style:{background:"#FFEDED",border:"1px solid #D21919"}}}}),React.createElement(lb,{...e}))),fb={id:null,title:"",fileName:"",width:"",height:"",tags:[]},pb={id:"blockImage"},db={type:pb,component:cb,initialData:fb,title:{default:"Image",fr:"Image",en:"Image",es:"Imagen",it:"Immagine"},description:{default:"Display an image",fr:"Affiche une image",en:"Display an image",es:"Mostrar una imagen",it:"Mostra un immagine"},icon:pl,image:{default:""}},Td=db;var wd=W(qn());(0,wd.registerPlugin)(Td);var mb=Nn;return Rs(hb);})(); +`; + var O = 16; + var Oe = ({ reverseOrder: e2, position: t2 = "top-center", toastOptions: o3, gutter: s2, children: r, containerStyle: a2, containerClassName: i2 }) => { + let { toasts: T, handlers: l2 } = D(o3); + return x.createElement("div", { style: { position: "fixed", zIndex: 9999, top: O, left: O, right: O, bottom: O, pointerEvents: "none", ...a2 }, className: i2, onMouseEnter: l2.startPause, onMouseLeave: l2.endPause }, T.map((c2) => { + let h2 = c2.position || t2, b2 = l2.calculateOffset(c2, { reverseOrder: e2, gutter: s2, defaultPosition: t2 }), F = Pe(h2, b2), p2 = c2.height ? void 0 : $((y) => { + l2.updateHeight(c2.id, y.height); + }); + return x.createElement("div", { ref: p2, className: c2.visible ? Re : "", key: c2.id, style: F }, c2.type === "custom" ? u3(c2.message, c2) : r ? r(c2) : x.createElement(C, { toast: c2, position: h2 })); + })); + }; + + // src/Image/index.tsx + var FromLocal = ({ + onSelect, + isWide = false + }) => { + const intl = useIntl(); + const createImage = useCreateImage(); + const { getRootProps, isDragActive } = useDropzone({ + multiple: false, + accept: { + "image/*": [".png", ".gif", ".jpeg", ".jpg", ".webp", ".svg"] + }, + noClick: true, + maxFiles: 1, + onDrop: async (acceptedFiles) => { + if (acceptedFiles) { + const formData = new FormData(); + formData.append("image", acceptedFiles[0]); + const res = await createImage.mutateAsync(formData); + onSelect(res); + } + }, + onDropRejected: (rejectedFiles) => { + rejectedFiles.length > 1 ? n3.error(intl.formatMessage({ id: "BlockImage__TOAST_MAX_FILE" })) : n3.error( + intl.formatMessage({ id: "BlockImage__TOAST_WRONG_FILE_TYPE" }) + ); + } + }); + return /* @__PURE__ */ React.createElement("div", { + className: `BlockImage__FromLocal ${isDragActive ? "BlockImage__FromLocal--active" : ""}`, + style: { width: isWide ? "100%" : "50%" }, + ...getRootProps() + }, /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__FromLocal__Icon" + }, /* @__PURE__ */ React.createElement(SvgDownload, null)), isDragActive ? intl.formatMessage({ id: "BlockImage__DROP_TO_UPLOAD" }) : !createImage.isLoading ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("form", { + onSubmit: (e2) => { + e2.preventDefault(); + } + }, /* @__PURE__ */ React.createElement("label", { + className: "BlockImage__Button", + htmlFor: "image" + }, intl.formatMessage({ id: "BlockImage__DOWNLOAD" })), /* @__PURE__ */ React.createElement("input", { + className: "BlockImage__FromLocal__FileInput", + type: "file", + accept: "image/*", + name: "image", + id: "image", + onChange: async (e2) => { + if (e2.target.files) { + const formData = new FormData(); + formData.append("image", e2.target.files[0]); + const res = await createImage.mutateAsync(formData); + onSelect(res); + } + } + }), /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__OR_DROP" })))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "DOWNLOADING" })), /* @__PURE__ */ React.createElement("i", { + className: "Loader fa fa-circle-notch fa-spin" + }))); + }; + var FromLibrary = ({ + onSelect, + isWide = false + }) => { + const [isOpen, setIsOpen] = (0, import_react13.useState)(false); + const intl = useIntl(); + return /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__FromLibrary", + style: { width: isWide ? "100%" : "50%" } + }, /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__FromLibrary__Icon" + }, /* @__PURE__ */ React.createElement(SvgMediatheque, null)), /* @__PURE__ */ React.createElement("button", { + className: "BlockImage__Button", + style: { marginBottom: "0.25rem" }, + onClick: () => { + setIsOpen(true); + } + }, /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__SELECT_BUTTON" }))), /* @__PURE__ */ React.createElement("span", null, intl.formatMessage({ id: "BlockImage__SELECT" })), isOpen ? /* @__PURE__ */ React.createElement(WrappedComponent, { + isOpen, + setIsOpen, + onSelect: (image) => { + setIsOpen(false); + onSelect(image); + } + }) : null); + }; + var Preview = ({ + id, + fileName, + setEditMode + }) => { + const intl = useIntl(); + const { getUrlWithPrefix } = (0, import_react13.useContext)(import_blocks_editor2.LocaleContext); + if (!id) + return null; + return /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__Preview" + }, /* @__PURE__ */ React.createElement("img", { + src: getUrlWithPrefix( + `/image-library/${id}/full/^!220,220/0/default.webp` + ), + alt: "", + loading: "lazy", + onError: (e2) => e2.target.src = `https://via.placeholder.com/220` + }), /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__Preview__Infos" + }, /* @__PURE__ */ React.createElement("span", { + className: "BlockImage__Preview__FileName" + }, fileName), /* @__PURE__ */ React.createElement("button", { + className: "BlockImage__Button", + onClick: () => { + setEditMode(true); + } + }, intl.formatMessage({ id: "REPLACE" })))); + }; + var ImageInfos = ({ + image, + onChange + }) => { + const [title, setTitle] = (0, import_react13.useState)(image.title); + const [url, setUrl] = (0, import_react13.useState)(image.link?.url || ""); + const [width, setWidth] = (0, import_react13.useState)(image.width || ""); + const [height, setHeight] = (0, import_react13.useState)(image.height || ""); + const intl = useIntl(); + return /* @__PURE__ */ React.createElement("form", { + className: "BlockImage__Infos__Form", + onSubmit: (e2) => { + e2.preventDefault(); + } + }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, intl.formatMessage({ id: "BlockImage__TITLE" })), /* @__PURE__ */ React.createElement("input", { + className: "Input__Text", + type: "text", + name: "title", + value: title, + placeholder: intl.formatMessage({ id: "BlockImage__TITLE" }), + onChange: (e2) => setTitle(e2.target.value), + onBlur: () => onChange({ title }) + })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, intl.formatMessage({ id: "BlockImage__LINK" }), " (", intl.formatMessage({ id: "OPTIONAL" }), ")"), /* @__PURE__ */ React.createElement("input", { + className: "Input__Text", + type: "text", + name: "linkUrl", + value: url, + placeholder: intl.formatMessage({ + id: "BlockImage__LINK_PLACEHOLDER" + }), + onChange: (e2) => setUrl(e2.target.value), + onBlur: () => onChange({ link: { url } }) + })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, intl.formatMessage({ id: "BlockImage__WIDTH" }), " (", intl.formatMessage({ id: "OPTIONAL" }), ")"), /* @__PURE__ */ React.createElement("input", { + className: "Input__Text", + type: "text", + name: "width", + value: width, + placeholder: intl.formatMessage({ + id: "BlockImage__WIDTH__PLACEHOLDER" + }), + onChange: (e2) => setWidth(e2.target.value), + onBlur: () => onChange({ width }) + })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, intl.formatMessage({ id: "BlockImage__HEIGHT" }), " (", intl.formatMessage({ id: "OPTIONAL" }), ")"), /* @__PURE__ */ React.createElement("input", { + className: "Input__Text", + type: "text", + name: "height", + value: height, + placeholder: intl.formatMessage({ + id: "BlockImage__HEIGHT__PLACEHOLDER" + }), + onChange: (e2) => setHeight(e2.target.value), + onBlur: () => onChange({ height }) + }))); + }; + var UploadImage = ({ + onSelect, + compact, + uploadModes = ["local", "library"] + }) => { + const uploadModesComponents = { + local: FromLocal, + library: FromLibrary + }; + return /* @__PURE__ */ React.createElement(provider_default, { + locale, + defaultLocale: "fr", + messages: messages[locale] || messages["fr"] + }, /* @__PURE__ */ React.createElement(QueryClientProvider, { + client: u + }, /* @__PURE__ */ React.createElement("div", { + className: `BlockImage__Upload__Wrapper ${compact ? "BlockImage__Upload--light" : ""}` + }, uploadModes.map((mode) => { + const Component2 = uploadModesComponents[mode]; + return /* @__PURE__ */ React.createElement(Component2, { + key: mode, + onSelect, + isWide: uploadModes.length < 2 + }); + })))); + }; + var BlockImageComponent = (props) => { + const { data, onUpdate } = props; + const [image, setImage] = (0, import_react13.useState)(null); + const [isEditMode, setEditMode] = (0, import_react13.useState)(false); + const intl = useIntl(); + (0, import_react13.useEffect)(() => { + if (data.id) { + setImage(data); + return; + } + setEditMode(true); + }, [data]); + const onSelect = (image2) => { + onUpdate(image2); + setEditMode(false); + }; + return /* @__PURE__ */ React.createElement("div", { + className: "BlockImage" + }, image && !isEditMode ? /* @__PURE__ */ React.createElement("div", { + className: "BlockImage__Infos" + }, /* @__PURE__ */ React.createElement(Preview, { + id: image.id, + fileName: image.fileName, + setEditMode + }), /* @__PURE__ */ React.createElement(ImageInfos, { + image, + onChange: (values) => { + onUpdate({ ...data, ...values }); + } + })) : null, isEditMode ? /* @__PURE__ */ React.createElement(React.Fragment, null, image?.id ? /* @__PURE__ */ React.createElement("span", { + style: { + marginBottom: "15px", + display: "block", + fontWeight: 800, + fontSize: "18px" + } + }, intl.formatMessage({ id: "REPLACE_IMAGE" }), ' "', image.title, '"') : null, /* @__PURE__ */ React.createElement(UploadImage, { + onSelect + }), image?.id ? /* @__PURE__ */ React.createElement("button", { + onClick: () => { + setEditMode(false); + }, + style: { marginTop: "15px" }, + className: "BlockImage__Button" + }, intl.formatMessage({ id: "CANCEL" })) : null) : null); + }; + var WrappedComponent2 = (props) => { + return /* @__PURE__ */ React.createElement(provider_default, { + locale, + defaultLocale: "fr", + messages: messages[locale] || messages["fr"] + }, /* @__PURE__ */ React.createElement(QueryClientProvider, { + client: u + }, /* @__PURE__ */ React.createElement(Oe, { + toastOptions: { + success: { + style: { + background: "#EAFBF5", + border: "1px solid #005A3A" + } + }, + error: { + style: { + background: "#FFEDED", + border: "1px solid #D21919" + } + } + } + }), /* @__PURE__ */ React.createElement(BlockImageComponent, { + ...props + }))); + }; + var initialData = { + id: null, + title: "", + fileName: "", + width: "", + height: "", + tags: [] + }; + var moduleType = { + id: "blockImage" + }; + var blockImage = { + type: moduleType, + component: WrappedComponent2, + initialData, + title: { + default: "Image", + fr: "Image", + en: "Image", + es: "Imagen", + it: "Immagine" + }, + description: { + default: "Display an image", + fr: "Affiche une image", + en: "Display an image", + es: "Mostrar una imagen", + it: "Mostra un immagine" + }, + icon: SvgImage, + image: { + default: "" + } + }; + var Image_default = blockImage; + + // src/index.tsx + var import_blocks_editor3 = __toESM(require_blocks_editor()); + (0, import_blocks_editor3.registerPlugin)(Image_default); + var src_default = WrappedComponent; + return __toCommonJS(src_exports); +})(); +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ /*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. @@ -226,7 +16538,7 @@ to { * http://api.jqueryui.com/category/ui-core/ */ /** @license React v16.13.1 - * react-is.production.min.js + * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * diff --git a/templates/backOffice/default/tb-plugin/vendor/index.global.js.map b/templates/backOffice/default/tb-plugin/vendor/index.global.js.map index 7ddb01e..1e012e7 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.global.js.map +++ b/templates/backOffice/default/tb-plugin/vendor/index.global.js.map @@ -1 +1 @@ -{"version":3,"sources":["external-global:@thelia/blocks-editor","external-global:react","../../../node_modules/tslib/tslib.js","../../../node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/react-is/index.js","../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/attr-accept/dist/es/index.js","external-global:react-dom","../../../node_modules/axios/lib/helpers/bind.js","../../../node_modules/axios/lib/utils.js","../../../node_modules/axios/lib/helpers/buildURL.js","../../../node_modules/axios/lib/core/InterceptorManager.js","../../../node_modules/axios/lib/helpers/normalizeHeaderName.js","../../../node_modules/axios/lib/core/enhanceError.js","../../../node_modules/axios/lib/core/createError.js","../../../node_modules/axios/lib/core/settle.js","../../../node_modules/axios/lib/helpers/cookies.js","../../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../node_modules/axios/lib/helpers/combineURLs.js","../../../node_modules/axios/lib/core/buildFullPath.js","../../../node_modules/axios/lib/helpers/parseHeaders.js","../../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../node_modules/axios/lib/cancel/Cancel.js","../../../node_modules/axios/lib/adapters/xhr.js","../../../node_modules/axios/lib/defaults.js","../../../node_modules/axios/lib/core/transformData.js","../../../node_modules/axios/lib/cancel/isCancel.js","../../../node_modules/axios/lib/core/dispatchRequest.js","../../../node_modules/axios/lib/core/mergeConfig.js","../../../node_modules/axios/lib/env/data.js","../../../node_modules/axios/lib/helpers/validator.js","../../../node_modules/axios/lib/core/Axios.js","../../../node_modules/axios/lib/cancel/CancelToken.js","../../../node_modules/axios/lib/helpers/spread.js","../../../node_modules/axios/lib/helpers/isAxiosError.js","../../../node_modules/axios/lib/axios.js","../../../node_modules/axios/index.js","../../../node_modules/react-modal/lib/helpers/tabbable.js","../../../node_modules/react-modal/lib/helpers/focusManager.js","../../../node_modules/react-modal/lib/helpers/scopeTab.js","../../../node_modules/warning/warning.js","../../../node_modules/exenv/index.js","../../../node_modules/react-modal/lib/helpers/safeHTMLElement.js","../../../node_modules/react-modal/lib/helpers/ariaAppHider.js","../../../node_modules/react-modal/lib/helpers/classList.js","../../../node_modules/react-modal/lib/helpers/portalOpenInstances.js","../../../node_modules/react-modal/lib/helpers/bodyTrap.js","../../../node_modules/react-modal/lib/components/ModalPortal.js","../../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../../../node_modules/react-modal/lib/components/Modal.js","../../../node_modules/react-modal/lib/index.js","../src/index.tsx","../src/Image/index.tsx","../../../node_modules/tslib/modules/index.js","../../../node_modules/react-intl/lib/src/components/createFormattedComponent.js","../../../node_modules/react-intl/lib/src/components/useIntl.js","../../../node_modules/react-intl/lib/src/components/injectIntl.js","../../../node_modules/react-intl/lib/src/utils.js","../../../node_modules/@formatjs/ecma402-abstract/lib/utils.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../node_modules/@formatjs/fast-memoize/lib/index.js","../../../node_modules/intl-messageformat/lib/src/error.js","../../../node_modules/intl-messageformat/lib/src/formatters.js","../../../node_modules/intl-messageformat/lib/src/core.js","../../../node_modules/@formatjs/intl/lib/src/error.js","../../../node_modules/@formatjs/intl/lib/src/utils.js","../../../node_modules/@formatjs/intl/lib/src/message.js","../../../node_modules/@formatjs/intl/lib/src/dateTime.js","../../../node_modules/@formatjs/intl/lib/src/displayName.js","../../../node_modules/@formatjs/intl/lib/src/list.js","../../../node_modules/@formatjs/intl/lib/src/plural.js","../../../node_modules/@formatjs/intl/lib/src/relativeTime.js","../../../node_modules/@formatjs/intl/lib/src/number.js","../../../node_modules/@formatjs/intl/lib/src/create-intl.js","../../../node_modules/react-intl/lib/src/components/provider.js","../../../node_modules/react-intl/lib/index.js","../src/Image/assets/image.svg","../src/Image/assets/download.svg","../src/Image/assets/mediatheque.svg","../src/utils/intl.ts","../../../node_modules/react-dropzone/dist/es/index.js","../../../node_modules/file-selector/src/file.ts","../../../node_modules/file-selector/src/file-selector.ts","../../../node_modules/react-dropzone/dist/es/utils/index.js","../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../node_modules/react-query/es/core/subscribable.js","../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../node_modules/react-query/es/core/utils.js","../../../node_modules/react-query/es/core/focusManager.js","../../../node_modules/react-query/es/core/onlineManager.js","../../../node_modules/react-query/es/core/retryer.js","../../../node_modules/react-query/es/core/notifyManager.js","../../../node_modules/react-query/es/core/logger.js","../../../node_modules/react-query/es/core/query.js","../../../node_modules/react-query/es/core/queryCache.js","../../../node_modules/react-query/es/core/mutation.js","../../../node_modules/react-query/es/core/mutationCache.js","../../../node_modules/react-query/es/core/infiniteQueryBehavior.js","../../../node_modules/react-query/es/core/queryClient.js","../../../node_modules/react-query/es/core/queryObserver.js","../../../node_modules/react-query/es/core/mutationObserver.js","../../../node_modules/react-query/es/react/reactBatchedUpdates.js","../../../node_modules/react-query/es/react/setBatchUpdatesFn.js","../../../node_modules/react-query/es/react/logger.js","../../../node_modules/react-query/es/react/setLogger.js","../../../node_modules/react-query/es/react/QueryClientProvider.js","../../../node_modules/react-query/es/react/QueryErrorResetBoundary.js","../../../node_modules/react-query/es/react/useMutation.js","../../../node_modules/react-query/es/react/utils.js","../../../node_modules/react-query/es/react/useBaseQuery.js","../../../node_modules/react-query/es/react/useQuery.js","../../fetcher/src/index.ts","../src/utils/queries.tsx","../src/Library/assets/xmark.svg","../src/Library/assets/trash.svg","../src/Library/assets/tag-xmark.svg","../src/Library/index.tsx","../src/Input/Input.tsx","../../../node_modules/@popperjs/core/lib/enums.js","../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../../node_modules/@popperjs/core/lib/utils/math.js","../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../../node_modules/@popperjs/core/lib/utils/within.js","../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../../node_modules/@popperjs/core/lib/utils/debounce.js","../../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../../node_modules/@popperjs/core/lib/createPopper.js","../../../node_modules/@popperjs/core/lib/popper.js","../../../node_modules/tippy.js/src/constants.ts","../../../node_modules/tippy.js/src/utils.ts","../../../node_modules/tippy.js/src/dom-utils.ts","../../../node_modules/tippy.js/src/bindGlobalEventListeners.ts","../../../node_modules/tippy.js/src/browser.ts","../../../node_modules/tippy.js/src/validation.ts","../../../node_modules/tippy.js/src/props.ts","../../../node_modules/tippy.js/src/template.ts","../../../node_modules/tippy.js/src/createTippy.ts","../../../node_modules/tippy.js/src/index.ts","../../../node_modules/tippy.js/src/addons/createSingleton.ts","../../../node_modules/tippy.js/src/addons/delegate.ts","../../../node_modules/tippy.js/src/plugins/animateFill.ts","../../../node_modules/tippy.js/src/plugins/followCursor.ts","../../../node_modules/tippy.js/src/plugins/inlinePositioning.ts","../../../node_modules/tippy.js/src/plugins/sticky.ts","../../../node_modules/tippy.js/build/base.js","../../../node_modules/@tippyjs/react/src/utils.js","../../../node_modules/@tippyjs/react/src/util-hooks.js","../../../node_modules/@tippyjs/react/src/className-plugin.js","../../../node_modules/@tippyjs/react/src/Tippy.js","../../../node_modules/@tippyjs/react/src/useSingleton.js","../../../node_modules/@tippyjs/react/src/forwardRef.js","../../../node_modules/@tippyjs/react/src/index.js","../src/Input/InputWrapper.tsx","../src/ErrorBoundary.tsx","../../../node_modules/react-hot-toast/src/core/types.ts","../../../node_modules/react-hot-toast/src/core/utils.ts","../../../node_modules/react-hot-toast/src/core/store.ts","../../../node_modules/react-hot-toast/src/core/toast.ts","../../../node_modules/react-hot-toast/src/core/use-toaster.ts","../../../node_modules/react-hot-toast/src/components/toast-bar.tsx","../../../node_modules/react-hot-toast/src/components/toast-icon.tsx","../../../node_modules/react-hot-toast/src/components/error.tsx","../../../node_modules/react-hot-toast/src/components/loader.tsx","../../../node_modules/react-hot-toast/src/components/checkmark.tsx","../../../node_modules/react-hot-toast/src/components/toaster.tsx","../../../node_modules/react-hot-toast/src/index.ts","../../../node_modules/goober/dist/goober.modern.js"],"sourcesContent":["module.exports = TheliaBlocks;","module.exports = React;","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n});\r\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","module.exports = ReactDOM;","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.25.0\"\n};","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n if (!config.url) {\n throw new Error('Provided config url is not valid');\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n if (!config.url) {\n throw new Error('Provided config url is not valid');\n }\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar tabbableNode = /input|select|textarea|button|object|iframe/;\n\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n\n // If the node is empty, this is good enough\n if (zeroSize && !element.innerHTML) return true;\n\n try {\n // Otherwise we need to check some styles\n var style = window.getComputedStyle(element);\n return zeroSize ? style.getPropertyValue(\"overflow\") !== \"visible\" ||\n // if 'overflow: visible' set, check if there is actually any overflow\n element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue(\"display\") == \"none\";\n } catch (exception) {\n // eslint-disable-next-line no-console\n console.warn(\"Failed to inspect element style\");\n return false;\n }\n}\n\nfunction visible(element) {\n var parentElement = element;\n var rootNode = element.getRootNode && element.getRootNode();\n while (parentElement) {\n if (parentElement === document.body) break;\n\n // if we are not hidden yet, skip to checking outside the Web Component\n if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;\n\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n return true;\n}\n\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\n\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n var descendants = [].slice.call(element.querySelectorAll(\"*\"), 0).reduce(function (finished, el) {\n return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));\n }, []);\n return descendants.filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n focusLaterElements = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n console.log(\"focusManager ----------\");\n focusLaterElements.forEach(function (f) {\n var check = f || {};\n console.log(check.nodeName, check.className, check.id);\n });\n console.log(\"end focusManager ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getActiveElement() {\n var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n\n return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;\n}\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n var activeElement = getActiveElement();\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar EE = _exenv2.default;\n\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\n\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\n\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\n\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\n\nexports.default = SafeHTMLElement;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar globalElement = null;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n if (globalElement) {\n if (globalElement.removeAttribute) {\n globalElement.removeAttribute(\"aria-hidden\");\n } else if (globalElement.length != null) {\n globalElement.forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n } else {\n document.querySelectorAll(globalElement).forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n }\n }\n globalElement = null;\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var check = globalElement || {};\n console.log(\"ariaAppHider ----------\");\n console.log(check.nodeName, check.className, check.id);\n console.log(\"end ariaAppHider ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"react-modal: App element is not defined.\", \"Please use `Modal.setAppElement(el)` or set `appElement={el}`.\", \"This is needed so screen readers don't see main content\", \"when modal is opened. It is not recommended, but you can opt-out\", \"by setting `ariaHideApp={false}`.\"].join(\" \"));\n\n return [];\n }\n}\n\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction removeClass(at, cls) {\n at.classList.remove(cls);\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n var htmlElement = document.getElementsByTagName(\"html\")[0];\n for (var cls in htmlClassList) {\n removeClass(htmlElement, htmlClassList[cls]);\n }\n\n var body = document.body;\n for (var _cls in docBodyClassList) {\n removeClass(body, docBodyClassList[_cls]);\n }\n\n htmlClassList = {};\n docBodyClassList = {};\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n \";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n \";\n }\n\n classes = document.body.className;\n\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n \";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n \";\n }\n\n buffer += \"\\n\";\n\n console.log(buffer);\n }\n}\n/* eslint-enable no-console */\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.log = log;\nexports.resetState = resetState;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n\n _classCallCheck(this, PortalOpenInstances);\n\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n\n this.openInstances = [];\n this.subscribers = [];\n};\n\nvar portalOpenInstances = new PortalOpenInstances();\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n portalOpenInstances = new PortalOpenInstances();\n}\n/* eslint-enable no-console */\n\nexports.default = portalOpenInstances;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n console.log(\"bodyTrap ----------\");\n console.log(instances.length);\n var _arr2 = [before, after];\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var item = _arr2[_i2];\n var check = item || {};\n console.log(check.nodeName, check.className, check.id);\n }\n console.log(\"edn bodyTrap ----------\");\n}\n/* eslint-enable no-console */\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before && !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.openAnimationFrame = requestAnimationFrame(function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n cancelAnimationFrame(this.openAnimationFrame);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar createHTMLElement = function createHTMLElement(name) {\n return document.createElement(name);\n};\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nif (process.env.NODE_ENV !== \"production\") {\n Modal.setCreateHTMLElement = function (fn) {\n return createHTMLElement = fn;\n };\n}\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require(\"./components/Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","import Image, { UploadImage } from \"./Image\";\nimport { registerPlugin } from \"@thelia/blocks-editor\";\nimport Library from \"./Library\";\nimport { LibraryImage } from \"./types/types\";\n\nregisterPlugin(Image);\n\nexport default Library;\n\nexport { UploadImage };\nexport type { LibraryImage };\n","import {\n BlockModuleComponentProps,\n BlockPluginDefinition,\n LocaleContext,\n} from \"@thelia/blocks-editor\";\nimport { useContext, useEffect, useState } from \"react\";\nimport { IntlProvider, useIntl } from \"react-intl\";\nimport { ReactComponent as Icon } from \"./assets/image.svg\";\nimport { ReactComponent as DownloadIcon } from \"./assets/download.svg\";\nimport { ReactComponent as MediathequeIcon } from \"./assets/mediatheque.svg\";\nimport { locale, messages } from \"../utils/intl\";\nimport { useDropzone } from \"react-dropzone\";\nimport Library from \"../Library\";\nimport { LibraryImage } from \"../types/types\";\nimport { QueryClientProvider } from \"react-query\";\nimport { useCreateImage } from \"../utils/queries\";\nimport { Toaster, toast } from \"react-hot-toast\";\nimport { queryClient } from \"@thelia/fetcher\";\n\nimport \"./Image.css\";\n\nconst FromLocal = ({\n onSelect,\n isWide = false,\n}: {\n onSelect: (value: LibraryImage) => void;\n isWide?: boolean;\n}) => {\n const intl = useIntl();\n const createImage = useCreateImage();\n\n const { getRootProps, isDragActive } = useDropzone({\n multiple: false,\n accept: {\n \"image/*\": [\".png\", \".gif\", \".jpeg\", \".jpg\", \".webp\", \".svg\"],\n },\n noClick: true,\n maxFiles: 1,\n onDrop: async (acceptedFiles) => {\n if (acceptedFiles) {\n const formData = new FormData();\n formData.append(\"image\", acceptedFiles[0]);\n const res = await createImage.mutateAsync(formData);\n\n onSelect(res);\n }\n },\n onDropRejected: (rejectedFiles) => {\n rejectedFiles.length > 1\n ? toast.error(intl.formatMessage({ id: \"BlockImage__TOAST_MAX_FILE\" }))\n : toast.error(\n intl.formatMessage({ id: \"BlockImage__TOAST_WRONG_FILE_TYPE\" })\n );\n },\n });\n\n return (\n \n
\n \n
\n {isDragActive ? (\n intl.formatMessage({ id: \"BlockImage__DROP_TO_UPLOAD\" })\n ) : !createImage.isLoading ? (\n <>\n {\n e.preventDefault();\n }}\n >\n \n {\n if (e.target.files) {\n const formData = new FormData();\n formData.append(\"image\", e.target.files[0]);\n const res = await createImage.mutateAsync(formData);\n\n onSelect(res);\n }\n }}\n />\n {intl.formatMessage({ id: \"BlockImage__OR_DROP\" })}\n \n \n ) : (\n <>\n {intl.formatMessage({ id: \"DOWNLOADING\" })}\n \n \n )}\n
\n );\n};\n\nconst FromLibrary = ({\n onSelect,\n isWide = false,\n}: {\n onSelect: (value: LibraryImage) => void;\n isWide?: boolean;\n}) => {\n const [isOpen, setIsOpen] = useState(false);\n const intl = useIntl();\n\n return (\n \n
\n \n
\n {\n setIsOpen(true);\n }}\n >\n {intl.formatMessage({ id: \"BlockImage__SELECT_BUTTON\" })}\n \n\n {intl.formatMessage({ id: \"BlockImage__SELECT\" })}\n\n {isOpen ? (\n {\n setIsOpen(false);\n onSelect(image);\n }}\n />\n ) : null}\n \n );\n};\n\nconst Preview = ({\n id,\n fileName,\n setEditMode,\n}: {\n id: LibraryImage[\"id\"] | null;\n fileName: LibraryImage[\"fileName\"];\n setEditMode: Function;\n}) => {\n const intl = useIntl();\n const { getUrlWithPrefix } = useContext(LocaleContext);\n\n if (!id) return null;\n return (\n
\n \n ((\n e.target as HTMLImageElement\n ).src = `https://via.placeholder.com/220`)\n }\n />\n
\n {fileName}\n {\n setEditMode(true);\n }}\n >\n {intl.formatMessage({ id: \"REPLACE\" })}\n \n
\n
\n );\n};\n\nconst ImageInfos = ({\n image,\n onChange,\n}: {\n image: LibraryImage;\n onChange: (data: Partial) => void;\n}) => {\n const [title, setTitle] = useState(image.title);\n const [url, setUrl] = useState(image.link?.url || \"\");\n const [width, setWidth] = useState(image.width || \"\");\n const [height, setHeight] = useState(image.height || \"\");\n\n const intl = useIntl();\n\n return (\n {\n e.preventDefault();\n }}\n >\n
\n \n setTitle(e.target.value)}\n onBlur={() => onChange({ title: title })}\n />\n
\n
\n \n setUrl(e.target.value)}\n onBlur={() => onChange({ link: { url: url } })}\n />\n
\n
\n \n setWidth(e.target.value)}\n onBlur={() => onChange({ width })}\n />\n
\n
\n \n setHeight(e.target.value)}\n onBlur={() => onChange({ height })}\n />\n
\n \n );\n};\n\nexport const UploadImage = ({\n onSelect,\n compact,\n uploadModes = [\"local\", \"library\"],\n}: {\n onSelect: (image: LibraryImage) => void;\n compact?: boolean;\n uploadModes?: (\"local\" | \"library\")[];\n}) => {\n const uploadModesComponents = {\n local: FromLocal,\n library: FromLibrary,\n };\n\n return (\n \n \n \n {uploadModes.map((mode) => {\n const Component = uploadModesComponents[mode];\n\n return (\n \n );\n })}\n \n \n
\n );\n};\n\nconst BlockImageComponent = (\n props: BlockModuleComponentProps\n) => {\n const { data, onUpdate } = props;\n\n const [image, setImage] = useState(null);\n const [isEditMode, setEditMode] = useState(false);\n\n const intl = useIntl();\n\n useEffect(() => {\n if (data.id) {\n setImage(data);\n return;\n }\n\n setEditMode(true);\n }, [data]);\n\n const onSelect = (image: LibraryImage) => {\n onUpdate(image);\n setEditMode(false);\n };\n\n return (\n
\n {image && !isEditMode ? (\n
\n \n {\n onUpdate({ ...data, ...values });\n }}\n />\n
\n ) : null}\n {isEditMode ? (\n <>\n {image?.id ? (\n \n {intl.formatMessage({ id: \"REPLACE_IMAGE\" })} \"{image.title}\"\n \n ) : null}\n \n {image?.id ? (\n {\n setEditMode(false);\n }}\n style={{ marginTop: \"15px\" }}\n className=\"BlockImage__Button\"\n >\n {intl.formatMessage({ id: \"CANCEL\" })}\n \n ) : null}\n \n ) : null}\n
\n );\n};\n\nconst WrappedComponent = (props: BlockModuleComponentProps) => {\n return (\n \n \n \n \n \n \n );\n};\n\nconst initialData: LibraryImage = {\n id: null,\n title: \"\",\n fileName: \"\",\n width: \"\",\n height: \"\",\n tags: [],\n};\n\nconst moduleType = {\n id: \"blockImage\",\n};\n\nconst blockImage: BlockPluginDefinition = {\n type: moduleType,\n component: WrappedComponent,\n initialData,\n title: {\n default: \"Image\",\n fr: \"Image\",\n en: \"Image\",\n es: \"Imagen\",\n it: \"Immagine\",\n },\n description: {\n default: \"Display an image\",\n fr: \"Affiche une image\",\n en: \"Display an image\",\n es: \"Mostrar una imagen\",\n it: \"Mostra un immagine\",\n },\n icon: Icon,\n image: {\n default: \"\",\n },\n};\n\nexport default blockImage;\n","import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n};\r\n","import { __rest } from \"tslib\";\nimport * as React from 'react';\nimport useIntl from './useIntl';\nvar DisplayName;\n(function (DisplayName) {\n DisplayName[\"formatDate\"] = \"FormattedDate\";\n DisplayName[\"formatTime\"] = \"FormattedTime\";\n DisplayName[\"formatNumber\"] = \"FormattedNumber\";\n DisplayName[\"formatList\"] = \"FormattedList\";\n // Note that this DisplayName is the locale display name, not to be confused with\n // the name of the enum, which is for React component display name in dev tools.\n DisplayName[\"formatDisplayName\"] = \"FormattedDisplayName\";\n})(DisplayName || (DisplayName = {}));\nvar DisplayNameParts;\n(function (DisplayNameParts) {\n DisplayNameParts[\"formatDate\"] = \"FormattedDateParts\";\n DisplayNameParts[\"formatTime\"] = \"FormattedTimeParts\";\n DisplayNameParts[\"formatNumber\"] = \"FormattedNumberParts\";\n DisplayNameParts[\"formatList\"] = \"FormattedListParts\";\n})(DisplayNameParts || (DisplayNameParts = {}));\nexport var FormattedNumberParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatNumberToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport var FormattedListParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatListToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport function createFormattedDateTimePartsComponent(name) {\n var ComponentParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n var formattedParts = name === 'formatDate'\n ? intl.formatDateToParts(date, formatProps)\n : intl.formatTimeToParts(date, formatProps);\n return children(formattedParts);\n };\n ComponentParts.displayName = DisplayNameParts[name];\n return ComponentParts;\n}\nexport function createFormattedComponent(name) {\n var Component = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props\n // TODO: fix TS type definition for localeMatcher upstream\n , [\"value\", \"children\"]);\n // TODO: fix TS type definition for localeMatcher upstream\n var formattedValue = intl[name](value, formatProps);\n if (typeof children === 'function') {\n return children(formattedValue);\n }\n var Text = intl.textComponent || React.Fragment;\n return React.createElement(Text, null, formattedValue);\n };\n Component.displayName = DisplayName[name];\n return Component;\n}\n","import * as React from 'react';\nimport { Context } from './injectIntl';\nimport { invariantIntlContext } from '../utils';\nexport default function useIntl() {\n var intl = React.useContext(Context);\n invariantIntlContext(intl);\n return intl;\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariantIntlContext } from '../utils';\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n}\n// TODO: We should provide initial value here\nvar IntlContext = React.createContext(null);\nvar IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;\nexport var Provider = IntlProvider;\nexport var Context = IntlContext;\nexport default function injectIntl(WrappedComponent, options) {\n var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;\n var WithIntl = function (props) { return (React.createElement(IntlConsumer, null, function (intl) {\n var _a;\n if (enforceContext) {\n invariantIntlContext(intl);\n }\n var intlProp = (_a = {}, _a[intlPropName] = intl, _a);\n return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));\n })); };\n WithIntl.displayName = \"injectIntl(\".concat(getDisplayName(WrappedComponent), \")\");\n WithIntl.WrappedComponent = WrappedComponent;\n if (forwardRef) {\n return hoistNonReactStatics(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);\n }\n return hoistNonReactStatics(WithIntl, WrappedComponent);\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG } from '@formatjs/intl';\nexport function invariantIntlContext(intl) {\n invariant(intl, '[React Intl] Could not find required `intl` object. ' +\n ' needs to exist in the component ancestry.');\n}\nexport var DEFAULT_INTL_CONFIG = __assign(__assign({}, CORE_DEFAULT_INTL_CONFIG), { textComponent: React.Fragment });\n/**\n * Takes a `formatXMLElementFn`, and composes it in function, which passes\n * argument `parts` through, assigning unique key to each part, to prevent\n * \"Each child in a list should have a unique \"key\"\" React error.\n * @param formatXMLElementFn\n */\nexport function assignUniqueKeysToParts(formatXMLElementFn) {\n return function (parts) {\n // eslint-disable-next-line prefer-rest-params\n return formatXMLElementFn(React.Children.toArray(parts));\n };\n}\nexport function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n if (!objA || !objB) {\n return false;\n }\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n if (bKeys.length !== len) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n if (objA[key] !== objB[key] ||\n !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n return true;\n}\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __spreadArray } from \"tslib\";\nimport { parse } from '@formatjs/icu-messageformat-parser';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, {\n ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag,\n locale: this.resolvedLocale,\n });\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n return _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MissingTranslationError, MessageFormatError } from './error';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport var formatMessage = function (_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n};\n","import { __assign } from \"tslib\";\nimport { filterProps, getNamedFormat } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n 'fractionalSecondDigits',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var timeZone = config.timeZone, locale = config.locale, onError = config.onError;\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});\n try {\n return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date time range.', e));\n }\n return String(from);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlErrorCode, IntlError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'style',\n 'type',\n 'fallback',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting display name.', e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlError, IntlErrorCode } from './error';\nvar LIST_FORMAT_OPTIONS = [\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });\n });\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting list.', e));\n }\n // @ts-ignore\n return values;\n}\n","import { filterProps } from './utils';\nimport { IntlFormatError } from './error';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nvar PLURAL_FORMAT_OPTIONS = ['type'];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar NUMBER_FORMAT_OPTIONS = [\n 'style',\n 'currency',\n 'currencyDisplay',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return [];\n}\n","import { __assign } from \"tslib\";\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatRelativeTime } from './relativeTime';\nimport { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';\nimport { formatPlural } from './plural';\nimport { formatMessage } from './message';\nimport { formatList, formatListToParts } from './list';\nimport { formatDisplayName } from './displayName';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __assign, __extends, __rest, __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { Provider } from './injectIntl';\nimport { DEFAULT_INTL_CONFIG, invariantIntlContext, assignUniqueKeysToParts, shallowEqual, } from '../utils';\nimport { formatMessage as coreFormatMessage, createIntl as coreCreateIntl, createIntlCache, } from '@formatjs/intl';\nimport { isFormatXMLElementFn, } from 'intl-messageformat';\nfunction processIntlConfig(config) {\n return {\n locale: config.locale,\n timeZone: config.timeZone,\n fallbackOnEmptyString: config.fallbackOnEmptyString,\n formats: config.formats,\n textComponent: config.textComponent,\n messages: config.messages,\n defaultLocale: config.defaultLocale,\n defaultFormats: config.defaultFormats,\n onError: config.onError,\n onWarn: config.onWarn,\n wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment,\n defaultRichTextElements: config.defaultRichTextElements,\n };\n}\nfunction assignUniqueKeysToFormatXMLElementFnArgument(values) {\n if (!values) {\n return values;\n }\n return Object.keys(values).reduce(function (acc, k) {\n var v = values[k];\n acc[k] = isFormatXMLElementFn(v)\n ? assignUniqueKeysToParts(v)\n : v;\n return acc;\n }, {});\n}\nvar formatMessage = function (config, formatters, descriptor, rawValues) {\n var rest = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n rest[_i - 4] = arguments[_i];\n }\n var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues);\n var chunks = coreFormatMessage.apply(void 0, __spreadArray([config,\n formatters,\n descriptor,\n values], rest, false));\n if (Array.isArray(chunks)) {\n return React.Children.toArray(chunks);\n }\n return chunks;\n};\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport var createIntl = function (_a, cache) {\n var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, [\"defaultRichTextElements\"]);\n var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);\n var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);\n var resolvedConfig = {\n locale: coreIntl.locale,\n timeZone: coreIntl.timeZone,\n fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,\n formats: coreIntl.formats,\n defaultLocale: coreIntl.defaultLocale,\n defaultFormats: coreIntl.defaultFormats,\n messages: coreIntl.messages,\n onError: coreIntl.onError,\n defaultRichTextElements: defaultRichTextElements,\n };\n return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });\n};\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cache = createIntlCache();\n _this.state = {\n cache: _this.cache,\n intl: createIntl(processIntlConfig(_this.props), _this.cache),\n prevConfig: processIntlConfig(_this.props),\n };\n return _this;\n }\n IntlProvider.getDerivedStateFromProps = function (props, _a) {\n var prevConfig = _a.prevConfig, cache = _a.cache;\n var config = processIntlConfig(props);\n if (!shallowEqual(prevConfig, config)) {\n return {\n intl: createIntl(config, cache),\n prevConfig: config,\n };\n }\n return null;\n };\n IntlProvider.prototype.render = function () {\n invariantIntlContext(this.state.intl);\n return React.createElement(Provider, { value: this.state.intl }, this.props.children);\n };\n IntlProvider.displayName = 'IntlProvider';\n IntlProvider.defaultProps = DEFAULT_INTL_CONFIG;\n return IntlProvider;\n}(React.PureComponent));\nexport default IntlProvider;\n","import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';\nimport injectIntl, { Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';\nimport useIntl from './src/components/useIntl';\nimport IntlProvider, { createIntl } from './src/components/provider';\nimport FormattedRelativeTime from './src/components/relative';\nimport FormattedPlural from './src/components/plural';\nimport FormattedMessage from './src/components/message';\nimport FormattedDateTimeRange from './src/components/dateTimeRange';\nexport { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, createIntl, injectIntl, useIntl, };\nexport { createIntlCache, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';\nexport function defineMessages(msgs) {\n return msgs;\n}\nexport function defineMessage(msg) {\n return msg;\n}\n// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`\nexport var FormattedDate = createFormattedComponent('formatDate');\nexport var FormattedTime = createFormattedComponent('formatTime');\n// @ts-ignore issue w/ TS Intl types\nexport var FormattedNumber = createFormattedComponent('formatNumber');\nexport var FormattedList = createFormattedComponent('formatList');\nexport var FormattedDisplayName = createFormattedComponent('formatDisplayName');\nexport var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');\nexport var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');\nexport { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';\n","import * as React from \"react\";\n\nconst SvgImage = props => ;\n\nexport { SvgImage as ReactComponent };","import * as React from \"react\";\n\nconst SvgDownload = props => ;\n\nexport { SvgDownload as ReactComponent };","import * as React from \"react\";\n\nconst SvgMediatheque = props => ;\n\nexport { SvgMediatheque as ReactComponent };","const getLocale = () => document.documentElement.lang || (navigator.languages && navigator.languages[0]) || navigator.language || 'en'\n\nexport const locale = getLocale()\n\nexport const messages: Record = {\n fr: {\n BlockImage__DOWNLOAD: \"Télécharger une image\",\n BlockImage__OR_DROP: \"ou glisser-déposer une image\",\n BlockImage__SELECT_BUTTON: \"Sélectionner une image\",\n BlockImage__SELECT: \"depuis votre médiathèque\",\n BlockImage__TITLE: \"Titre de l'image\",\n BlockImage__LINK: \"Lien de l'image\",\n BlockImage__HEIGHT: \"Hauteur de l'image\",\n BlockImage__WIDTH: \"Largeur de l'image\",\n BlockImage__HEIGHT__PLACEHOLDER: \"Indiquez la hauteur de l'image (ex: 100px, 50%, auto)\",\n BlockImage__WIDTH__PLACEHOLDER: \"Indiquez la largeur de l'image (ex: 100px, 50%, auto)\",\n BlockImage__LINK_PLACEHOLDER: \"Lien au clic sur l'image\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Rechercher une image\",\n BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: \"Uploader une image\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Rechercher dans la médiathèque\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtrer par tag\",\n BlockImage__LIBRARY_LOADING: \"Chargement de la librairie...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Votre image n'a pas pu être téléchargée. Veuillez vérifier que votre fichier est bien une image.\",\n BlockImage__TOAST_MAX_FILE: \"Veuillez uploader une seule image.\",\n BlockImage__DROP_TO_UPLOAD: \"Relacher pour uploader votre image\",\n BlockImage__LIBRARY_NO_CONTENT: \"Aucune image trouvée\",\n BlockImage__LIBRARY_SEARCHING: \"Recherche en cours...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configuration des tags de\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Ajouter un ou plusieurs tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Sélectionnez un ou plusieurs tag\",\n\n REPLACE: \"Remplacer\",\n REPLACE_IMAGE: \"Remplacer l'image\",\n OPTIONAL: \"Optionnel\",\n CANCEL: \"Annuler\",\n DELETE: \"Supprimer\",\n SEARCH_BY: \"Référence, nom, ...\",\n LOADING: \"Chargement...\",\n DOWNLOADING: \"Téléchargement...\",\n ALL_TAGS: \"Tous les tags\",\n CHOOSE: \"Choisir\",\n },\n en: {\n BlockImage__DOWNLOAD: \"Download an image\",\n BlockImage__OR_DROP: \"or drop an image\",\n BlockImage__SELECT_BUTTON: \"Select an image\",\n BlockImage__SELECT: \"from your library\",\n BlockImage__TITLE: \"Image title\",\n BlockImage__LINK: \"Image link\",\n BlockImage__HEIGHT: \"Image height\",\n BlockImage__WIDTH: \"Image width\",\n BlockImage__HEIGHT__PLACEHOLDER: \"Indicate the height of the image (ex: 100px, 50%, auto)\",\n BlockImage__WIDTH__PLACEHOLDER: \"Indicate the width of the image (ex: 100px, 50%, auto)\",\n BlockImage__LINK_PLACEHOLDER: \"Link on click on image\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Search an image\",\n BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: \"Upload an image\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Search in the library\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filter by tag\",\n BlockImage__LIBRARY_LOADING: \"Loading library...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Your image could not be uploaded. Please check that your file is an image.\",\n BlockImage__TOAST_MAX_FILE: \"Please upload only one image.\",\n BlockImage__DROP_TO_UPLOAD: \"Release to upload your image\",\n BlockImage__LIBRARY_NO_CONTENT: \"No image found\",\n BlockImage__LIBRARY_SEARCHING: \"Searching...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configure tags of\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Add one or more tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Select one or more tag\",\n\n REPLACE: \"Replace\",\n REPLACE_IMAGE: \"Replace image\",\n OPTIONAL: \"Optional\",\n CANCEL: \"Cancel\",\n DELETE: \"Delete\",\n SEARCH_BY: \"Reference, name, ...\",\n LOADING: \"Loading...\",\n DOWNLOADING: \"Downloading...\",\n ALL_TAGS: \"All tags\",\n CHOOSE: \"Choose\",\n },\n es: {\n BlockImage__DOWNLOAD: \"Descargar una imagen\",\n BlockImage__OR_DROP: \"o arrastrar una imagen\",\n BlockImage__SELECT_BUTTON: \"Seleccionar una imagen\",\n BlockImage__SELECT: \"de tu biblioteca\",\n BlockImage__TITLE: \"Título de la imagen\",\n BlockImage__LINK: \"Enlace de la imagen\",\n BlockImage__HEIGHT: \"Altura de la imagen\",\n BlockImage__WIDTH: \"Ancho de la imagen\",\n BlockImage__HEIGHT__PLACEHOLDER: \"Indica la altura de la imagen (ex: 100px, 50%, auto)\",\n BlockImage__WIDTH__PLACEHOLDER: \"Indica el ancho de la imagen (ex: 100px, 50%, auto)\",\n BlockImage__LINK_PLACEHOLDER: \"Enlace al hacer clic en la imagen\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Buscar una imagen\",\n BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: \"Subir una imagen\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Buscar en la biblioteca\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtrar por tag\",\n BlockImage__LIBRARY_LOADING: \"Cargando la biblioteca...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.\",\n BlockImage__TOAST_MAX_FILE: \"Por favor sube solo una imagen.\",\n BlockImage__DROP_TO_UPLOAD: \"Suelte para subir tu imagen\",\n BlockImage__LIBRARY_NO_CONTENT: \"No se encontraron imagenes\",\n BlockImage__LIBRARY_SEARCHING: \"Buscando...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configurar tags de\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Agregar uno o más tags\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Seleccionar uno o más tags\",\n\n REPLACE: \"Reemplazar\",\n REPLACE_IMAGE: \"Reemplazar imagen\",\n OPTIONAL: \"Opcional\",\n CANCEL: \"Cancelar\",\n DELETE: \"Eliminar\",\n SEARCH_BY: \"Referencia, nombre, ...\",\n LOADING: \"Cargando...\",\n DOWNLOADING: \"Descargando...\",\n ALL_TAGS: \"Todos los tags\",\n CHOOSE: \"Elegir\",\n },\n it: {\n BlockImage__DOWNLOAD: \"Scarica un immagine\",\n BlockImage__OR_DROP: \"o trascina un immagine\",\n BlockImage__SELECT_BUTTON: \"Seleziona un immagine\",\n BlockImage__SELECT: \"dalla tua libreria\",\n BlockImage__TITLE: \"Titolo dell immagine\",\n BlockImage__LINK: \"Link dell immagine\",\n BlockImage__HEIGHT: \"Altezza dell immagine\",\n BlockImage__WIDTH: \"Larghezza dell immagine\",\n BlockImage__HEIGHT__PLACEHOLDER: \"Indica l altezza dell immagine (ex: 100px, 50%, auto)\",\n BlockImage__WIDTH__PLACEHOLDER: \"Indica la larghezza dell immagine (ex: 100px, 50%, auto)\",\n BlockImage__LINK_PLACEHOLDER: \"Link al click sull immagine\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Cerca un immagine\",\n BlockImage__LIBRARY_MODAL_TITLE_UPLOAD: \"Carica un immagine\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Cerca nella libreria\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtra per tag\",\n BlockImage__LIBRARY_LOADING: \"Caricamento della libreria...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"La tua immagine non può essere caricata. Per favore verifica che il tuo file sia un immagine.\",\n BlockImage__TOAST_MAX_FILE: \"Per favore carica solo una immagine.\",\n BlockImage__DROP_TO_UPLOAD: \"Rilascia per caricare la tua immagine\",\n BlockImage__LIBRARY_NO_CONTENT: \"Nessuna immagine trovata\",\n BlockImage__LIBRARY_SEARCHING: \"Ricerca in corso...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configura i tag di\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Aggiungi uno o più tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Seleziona uno o più tag\",\n\n REPLACE: \"Sostituisci\",\n REPLACE_IMAGE: \"Sostituisci immagine\",\n OPTIONAL: \"Opzionale\",\n CANCEL: \"Annulla\", \n DELETE: \"Elimina\",\n SEARCH_BY: \"Riferimento, nome, ...\",\n LOADING: \"Caricamento...\",\n DOWNLOADING: \"Scaricare...\",\n ALL_TAGS: \"Tutti i tag\",\n CHOOSE: \"Scegli\",\n }\n}","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { fromEvent } from \"file-selector\";\nimport { acceptPropAsAcceptAttr, allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, canUseFileSystemAccessAPI, isAbort, isEvtWithFiles, isIeOrEdge, isPropagationStopped, isSecurityError, onDocumentDragOver, pickerOptionsFromAccept, TOO_MANY_FILES_REJECTION } from \"./utils/index\";\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *

Drag 'n' drop some files here, or click to select files

\n *
\n * )}\n *
\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = \"Dropzone\"; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: true,\n autoFocus: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n */\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Set to true to focus the root element on render\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Cb for when there's some error from any of the promises.\n *\n * @param {Error} error\n */\n onError: PropTypes.func,\n\n /**\n * Custom validation function. It must return null if there's no errors.\n * @param {File} file\n * @returns {FileError|FileError[]|null}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state.\n *\n * @typedef {object} DropzoneState\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\n/**\n * An object with the dropzone methods.\n *\n * @typedef {object} DropzoneMethods\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *

Drag and drop some files here, or click to select files

\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {import(\"./utils\").AcceptProp} [props.accept] Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {boolean} autoFocus Set to true to auto focus the root element.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n * @param {(error: Error) => void} [props.onError]\n *\n * @returns {DropzoneState & DropzoneMethods}\n */\n\nexport function useDropzone() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n accept = _defaultProps$props.accept,\n disabled = _defaultProps$props.disabled,\n getFilesFromEvent = _defaultProps$props.getFilesFromEvent,\n maxSize = _defaultProps$props.maxSize,\n minSize = _defaultProps$props.minSize,\n multiple = _defaultProps$props.multiple,\n maxFiles = _defaultProps$props.maxFiles,\n onDragEnter = _defaultProps$props.onDragEnter,\n onDragLeave = _defaultProps$props.onDragLeave,\n onDragOver = _defaultProps$props.onDragOver,\n onDrop = _defaultProps$props.onDrop,\n onDropAccepted = _defaultProps$props.onDropAccepted,\n onDropRejected = _defaultProps$props.onDropRejected,\n onFileDialogCancel = _defaultProps$props.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$props.onFileDialogOpen,\n useFsAccessApi = _defaultProps$props.useFsAccessApi,\n autoFocus = _defaultProps$props.autoFocus,\n preventDropOnDocument = _defaultProps$props.preventDropOnDocument,\n noClick = _defaultProps$props.noClick,\n noKeyboard = _defaultProps$props.noKeyboard,\n noDrag = _defaultProps$props.noDrag,\n noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,\n onError = _defaultProps$props.onError,\n validator = _defaultProps$props.validator;\n\n var acceptAttr = useMemo(function () {\n return acceptPropAsAcceptAttr(accept);\n }, [accept]);\n var pickerTypes = useMemo(function () {\n return pickerOptionsFromAccept(accept);\n }, [accept]);\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === \"function\" ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === \"function\" ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n /**\n * @constant\n * @type {React.MutableRefObject}\n */\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive;\n var fsAccessApiWorksRef = useRef(typeof window !== \"undefined\" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (!fsAccessApiWorksRef.current && isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: \"closeDialog\"\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener(\"focus\", onWindowFocus, false);\n return function () {\n window.removeEventListener(\"focus\", onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener(\"dragover\", onDocumentDragOver, false);\n document.addEventListener(\"drop\", onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener(\"dragover\", onDocumentDragOver);\n document.removeEventListener(\"drop\", onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true\n\n useEffect(function () {\n if (!disabled && autoFocus && rootRef.current) {\n rootRef.current.focus();\n }\n\n return function () {};\n }, [rootRef, autoFocus, disabled]);\n var onErrCb = useCallback(function (e) {\n if (onError) {\n onError(e);\n } else {\n // Let the user know something's gone wrong if they haven't provided the onError cb.\n console.error(e);\n }\n }, [onError]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var fileCount = files.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: files,\n accept: acceptAttr,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles,\n validator: validator\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n dispatch({\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isDragActive: true,\n type: \"setDraggedFiles\"\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = \"copy\";\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n type: \"setDraggedFiles\",\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, acceptAttr),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: \"setFiles\"\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n\n dispatch({\n type: \"reset\"\n });\n }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n // No point to use FS access APIs if context is not secure\n // https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection\n if (fsAccessApiWorksRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: pickerTypes\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n setFiles(files, null);\n dispatch({\n type: \"closeDialog\"\n });\n }).catch(function (e) {\n // AbortError means the user canceled\n if (isAbort(e)) {\n onFileDialogCancelCb(e);\n dispatch({\n type: \"closeDialog\"\n });\n } else if (isSecurityError(e)) {\n fsAccessApiWorksRef.current = false; // CORS, so cannot use this API\n // Try using the input\n\n if (inputRef.current) {\n inputRef.current.value = null;\n inputRef.current.click();\n } else {\n onErrCb(new Error(\"Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.\"));\n }\n } else {\n onErrCb(e);\n }\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.key === \" \" || event.key === \"Enter\" || event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: \"focus\"\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: \"blur\"\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? \"ref\" : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === \"string\" && role !== \"\" ? role : \"presentation\"\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? \"ref\" : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: acceptAttr,\n multiple: multiple,\n type: \"file\",\n style: {\n display: \"none\"\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n/**\n * @param {DropzoneState} state\n * @param {{type: string} & DropzoneState} action\n * @returns {DropzoneState}\n */\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case \"focus\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case \"blur\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case \"openDialog\":\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case \"closeDialog\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case \"setDraggedFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragActive: action.isDragActive,\n isDragAccept: action.isDragAccept,\n isDragReject: action.isDragReject\n });\n\n case \"setFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case \"reset\":\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from \"./utils\";",null,null,"function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from \"attr-accept\"; // Error codes\n\nexport var FILE_INVALID_TYPE = \"file-invalid-type\";\nexport var FILE_TOO_LARGE = \"file-too-large\";\nexport var FILE_TOO_SMALL = \"file-too-small\";\nexport var TOO_MANY_FILES = \"too-many-files\";\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(\", \")) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: \"Too many files\"\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === \"application/x-moz-file\" || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n/**\n *\n * @param {object} options\n * @param {File[]} options.files\n * @param {string|string[]} [options.accept]\n * @param {number} [options.minSize]\n * @param {number} [options.maxSize]\n * @param {boolean} [options.multiple]\n * @param {number} [options.maxFiles]\n * @param {(f: File) => FileError|FileError[]|null} [options.validator]\n * @returns\n */\n\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles,\n validator = _ref.validator;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n var customErrors = validator ? validator(file) : null;\n return accepted && sizeMatch && !customErrors;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === \"function\") {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== \"undefined\") {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === \"Files\" || type === \"application/x-moz-file\";\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === \"object\" && item !== null && item.kind === \"file\";\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf(\"MSIE\") !== -1 || userAgent.indexOf(\"Trident/\") !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf(\"Edge/\") !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return \"showOpenFilePicker\" in window;\n}\n/**\n * Convert the `{accept}` dropzone prop to the\n * `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n *\n * @param {AcceptProp} accept\n * @returns {{accept: string[]}[]}\n */\n\nexport function pickerOptionsFromAccept(accept) {\n if (isDefined(accept)) {\n var acceptForPicker = Object.entries(accept).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n mimeType = _ref3[0],\n ext = _ref3[1];\n\n var ok = true;\n\n if (!isMIMEType(mimeType)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.\"));\n ok = false;\n }\n\n if (!Array.isArray(ext) || !ext.every(isExt)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because an invalid file extension was provided.\"));\n ok = false;\n }\n\n return ok;\n }).reduce(function (agg, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n mimeType = _ref5[0],\n ext = _ref5[1];\n\n return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));\n }, {});\n return [{\n accept: acceptForPicker\n }];\n }\n\n return accept;\n}\n/**\n * Convert the `{accept}` dropzone prop to an array of MIME types/extensions.\n * @param {AcceptProp} accept\n * @returns {string}\n */\n\nexport function acceptPropAsAcceptAttr(accept) {\n if (isDefined(accept)) {\n return Object.entries(accept).reduce(function (a, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n mimeType = _ref7[0],\n ext = _ref7[1];\n\n return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));\n }, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these\n .filter(function (v) {\n return isMIMEType(v) || isExt(v);\n }).join(\",\");\n }\n\n return undefined;\n}\n/**\n * Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is an abort exception.\n */\n\nexport function isAbort(v) {\n return v instanceof DOMException && (v.name === \"AbortError\" || v.code === v.ABORT_ERR);\n}\n/**\n * Check if v is a security error.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is a security error.\n */\n\nexport function isSecurityError(v) {\n return v instanceof DOMException && (v.name === \"SecurityError\" || v.code === v.SECURITY_ERR);\n}\n/**\n * Check if v is a MIME type string.\n *\n * See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.\n *\n * @param {string} v\n */\n\nexport function isMIMEType(v) {\n return v === \"audio/*\" || v === \"video/*\" || v === \"image/*\" || v === \"text/*\" || /\\w+\\/[-+.\\w]+/g.test(v);\n}\n/**\n * Check if v is a file extension.\n * @param {string} v\n */\n\nexport function isExt(v) {\n return /^.*\\.[\\w]+$/.test(v);\n}\n/**\n * @typedef {Object.} AcceptProp\n */\n\n/**\n * @typedef {object} FileError\n * @property {string} message\n * @property {ErrorCode|string} code\n */\n\n/**\n * @typedef {\"file-invalid-type\"|\"file-too-large\"|\"file-too-small\"|\"too-many-files\"} ErrorCode\n */","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export var Subscribable = /*#__PURE__*/function () {\n function Subscribable() {\n this.listeners = [];\n }\n\n var _proto = Subscribable.prototype;\n\n _proto.subscribe = function subscribe(listener) {\n var _this = this;\n\n var callback = listener || function () {\n return undefined;\n };\n\n this.listeners.push(callback);\n this.onSubscribe();\n return function () {\n _this.listeners = _this.listeners.filter(function (x) {\n return x !== callback;\n });\n\n _this.onUnsubscribe();\n };\n };\n\n _proto.hasListeners = function hasListeners() {\n return this.listeners.length > 0;\n };\n\n _proto.onSubscribe = function onSubscribe() {// Do nothing\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {// Do nothing\n };\n\n return Subscribable;\n}();","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// TYPES\n// UTILS\nexport var isServer = typeof window === 'undefined';\nexport function noop() {\n return undefined;\n}\nexport function functionalUpdate(updater, input) {\n return typeof updater === 'function' ? updater(input) : updater;\n}\nexport function isValidTimeout(value) {\n return typeof value === 'number' && value >= 0 && value !== Infinity;\n}\nexport function ensureQueryKeyArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function difference(array1, array2) {\n return array1.filter(function (x) {\n return array2.indexOf(x) === -1;\n });\n}\nexport function replaceAt(array, index, value) {\n var copy = array.slice(0);\n copy[index] = value;\n return copy;\n}\nexport function timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nexport function parseQueryArgs(arg1, arg2, arg3) {\n if (!isQueryKey(arg1)) {\n return arg1;\n }\n\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n queryKey: arg1,\n queryFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n queryKey: arg1\n });\n}\nexport function parseMutationArgs(arg1, arg2, arg3) {\n if (isQueryKey(arg1)) {\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n mutationKey: arg1,\n mutationFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n mutationKey: arg1\n });\n }\n\n if (typeof arg1 === 'function') {\n return _extends({}, arg2, {\n mutationFn: arg1\n });\n }\n\n return _extends({}, arg1);\n}\nexport function parseFilterArgs(arg1, arg2, arg3) {\n return isQueryKey(arg1) ? [_extends({}, arg2, {\n queryKey: arg1\n }), arg3] : [arg1 || {}, arg2];\n}\nexport function parseMutationFilterArgs(arg1, arg2) {\n return isQueryKey(arg1) ? _extends({}, arg2, {\n mutationKey: arg1\n }) : arg1;\n}\nexport function mapQueryStatusFilter(active, inactive) {\n if (active === true && inactive === true || active == null && inactive == null) {\n return 'all';\n } else if (active === false && inactive === false) {\n return 'none';\n } else {\n // At this point, active|inactive can only be true|false or false|true\n // so, when only one value is provided, the missing one has to be the negated value\n var isActive = active != null ? active : !inactive;\n return isActive ? 'active' : 'inactive';\n }\n}\nexport function matchQuery(filters, query) {\n var active = filters.active,\n exact = filters.exact,\n fetching = filters.fetching,\n inactive = filters.inactive,\n predicate = filters.predicate,\n queryKey = filters.queryKey,\n stale = filters.stale;\n\n if (isQueryKey(queryKey)) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n\n var queryStatusFilter = mapQueryStatusFilter(active, inactive);\n\n if (queryStatusFilter === 'none') {\n return false;\n } else if (queryStatusFilter !== 'all') {\n var isActive = query.isActive();\n\n if (queryStatusFilter === 'active' && !isActive) {\n return false;\n }\n\n if (queryStatusFilter === 'inactive' && isActive) {\n return false;\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false;\n }\n\n if (typeof fetching === 'boolean' && query.isFetching() !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(query)) {\n return false;\n }\n\n return true;\n}\nexport function matchMutation(filters, mutation) {\n var exact = filters.exact,\n fetching = filters.fetching,\n predicate = filters.predicate,\n mutationKey = filters.mutationKey;\n\n if (isQueryKey(mutationKey)) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n\n if (exact) {\n if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n\n if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(mutation)) {\n return false;\n }\n\n return true;\n}\nexport function hashQueryKeyByOptions(queryKey, options) {\n var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;\n return hashFn(queryKey);\n}\n/**\n * Default query keys hash function.\n */\n\nexport function hashQueryKey(queryKey) {\n var asArray = ensureQueryKeyArray(queryKey);\n return stableValueHash(asArray);\n}\n/**\n * Hashes the value into a stable hash.\n */\n\nexport function stableValueHash(value) {\n return JSON.stringify(value, function (_, val) {\n return isPlainObject(val) ? Object.keys(val).sort().reduce(function (result, key) {\n result[key] = val[key];\n return result;\n }, {}) : val;\n });\n}\n/**\n * Checks if key `b` partially matches with key `a`.\n */\n\nexport function partialMatchKey(a, b) {\n return partialDeepEqual(ensureQueryKeyArray(a), ensureQueryKeyArray(b));\n}\n/**\n * Checks if `b` partially matches with `a`.\n */\n\nexport function partialDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some(function (key) {\n return !partialDeepEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\n\nexport function replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n\n var array = Array.isArray(a) && Array.isArray(b);\n\n if (array || isPlainObject(a) && isPlainObject(b)) {\n var aSize = array ? a.length : Object.keys(a).length;\n var bItems = array ? b : Object.keys(b);\n var bSize = bItems.length;\n var copy = array ? [] : {};\n var equalItems = 0;\n\n for (var i = 0; i < bSize; i++) {\n var key = array ? i : bItems[i];\n copy[key] = replaceEqualDeep(a[key], b[key]);\n\n if (copy[key] === a[key]) {\n equalItems++;\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n\n return b;\n}\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\n\nexport function shallowEqualObjects(a, b) {\n if (a && !b || b && !a) {\n return false;\n }\n\n for (var key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n} // Copied from: https://github.com/jonschlinkert/is-plain-object\n\nexport function isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n } // If has modified constructor\n\n\n var ctor = o.constructor;\n\n if (typeof ctor === 'undefined') {\n return true;\n } // If has modified prototype\n\n\n var prot = ctor.prototype;\n\n if (!hasObjectPrototype(prot)) {\n return false;\n } // If constructor does not have an Object-specific method\n\n\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false;\n } // Most likely a plain Object\n\n\n return true;\n}\n\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isQueryKey(value) {\n return typeof value === 'string' || Array.isArray(value);\n}\nexport function isError(value) {\n return value instanceof Error;\n}\nexport function sleep(timeout) {\n return new Promise(function (resolve) {\n setTimeout(resolve, timeout);\n });\n}\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\n\nexport function scheduleMicrotask(callback) {\n Promise.resolve().then(callback).catch(function (error) {\n return setTimeout(function () {\n throw error;\n });\n });\n}\nexport function getAbortController() {\n if (typeof AbortController === 'function') {\n return new AbortController();\n }\n}","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { Subscribable } from './subscribable';\nimport { isServer } from './utils';\nexport var FocusManager = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(FocusManager, _Subscribable);\n\n function FocusManager() {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n\n _this.setup = function (onFocus) {\n var _window;\n\n if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {\n var listener = function listener() {\n return onFocus();\n }; // Listen to visibillitychange and focus\n\n\n window.addEventListener('visibilitychange', listener, false);\n window.addEventListener('focus', listener, false);\n return function () {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener);\n window.removeEventListener('focus', listener);\n };\n }\n };\n\n return _this;\n }\n\n var _proto = FocusManager.prototype;\n\n _proto.onSubscribe = function onSubscribe() {\n if (!this.cleanup) {\n this.setEventListener(this.setup);\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.hasListeners()) {\n var _this$cleanup;\n\n (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n this.cleanup = undefined;\n }\n };\n\n _proto.setEventListener = function setEventListener(setup) {\n var _this$cleanup2,\n _this2 = this;\n\n this.setup = setup;\n (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n this.cleanup = setup(function (focused) {\n if (typeof focused === 'boolean') {\n _this2.setFocused(focused);\n } else {\n _this2.onFocus();\n }\n });\n };\n\n _proto.setFocused = function setFocused(focused) {\n this.focused = focused;\n\n if (focused) {\n this.onFocus();\n }\n };\n\n _proto.onFocus = function onFocus() {\n this.listeners.forEach(function (listener) {\n listener();\n });\n };\n\n _proto.isFocused = function isFocused() {\n if (typeof this.focused === 'boolean') {\n return this.focused;\n } // document global can be unavailable in react native\n\n\n if (typeof document === 'undefined') {\n return true;\n }\n\n return [undefined, 'visible', 'prerender'].includes(document.visibilityState);\n };\n\n return FocusManager;\n}(Subscribable);\nexport var focusManager = new FocusManager();","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { Subscribable } from './subscribable';\nimport { isServer } from './utils';\nexport var OnlineManager = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(OnlineManager, _Subscribable);\n\n function OnlineManager() {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n\n _this.setup = function (onOnline) {\n var _window;\n\n if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {\n var listener = function listener() {\n return onOnline();\n }; // Listen to online\n\n\n window.addEventListener('online', listener, false);\n window.addEventListener('offline', listener, false);\n return function () {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', listener);\n window.removeEventListener('offline', listener);\n };\n }\n };\n\n return _this;\n }\n\n var _proto = OnlineManager.prototype;\n\n _proto.onSubscribe = function onSubscribe() {\n if (!this.cleanup) {\n this.setEventListener(this.setup);\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.hasListeners()) {\n var _this$cleanup;\n\n (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n this.cleanup = undefined;\n }\n };\n\n _proto.setEventListener = function setEventListener(setup) {\n var _this$cleanup2,\n _this2 = this;\n\n this.setup = setup;\n (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n this.cleanup = setup(function (online) {\n if (typeof online === 'boolean') {\n _this2.setOnline(online);\n } else {\n _this2.onOnline();\n }\n });\n };\n\n _proto.setOnline = function setOnline(online) {\n this.online = online;\n\n if (online) {\n this.onOnline();\n }\n };\n\n _proto.onOnline = function onOnline() {\n this.listeners.forEach(function (listener) {\n listener();\n });\n };\n\n _proto.isOnline = function isOnline() {\n if (typeof this.online === 'boolean') {\n return this.online;\n }\n\n if (typeof navigator === 'undefined' || typeof navigator.onLine === 'undefined') {\n return true;\n }\n\n return navigator.onLine;\n };\n\n return OnlineManager;\n}(Subscribable);\nexport var onlineManager = new OnlineManager();","import { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { sleep } from './utils';\n\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1000 * Math.pow(2, failureCount), 30000);\n}\n\nexport function isCancelable(value) {\n return typeof (value == null ? void 0 : value.cancel) === 'function';\n}\nexport var CancelledError = function CancelledError(options) {\n this.revert = options == null ? void 0 : options.revert;\n this.silent = options == null ? void 0 : options.silent;\n};\nexport function isCancelledError(value) {\n return value instanceof CancelledError;\n} // CLASS\n\nexport var Retryer = function Retryer(config) {\n var _this = this;\n\n var cancelRetry = false;\n var cancelFn;\n var continueFn;\n var promiseResolve;\n var promiseReject;\n this.abort = config.abort;\n\n this.cancel = function (cancelOptions) {\n return cancelFn == null ? void 0 : cancelFn(cancelOptions);\n };\n\n this.cancelRetry = function () {\n cancelRetry = true;\n };\n\n this.continueRetry = function () {\n cancelRetry = false;\n };\n\n this.continue = function () {\n return continueFn == null ? void 0 : continueFn();\n };\n\n this.failureCount = 0;\n this.isPaused = false;\n this.isResolved = false;\n this.isTransportCancelable = false;\n this.promise = new Promise(function (outerResolve, outerReject) {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n\n var resolve = function resolve(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onSuccess == null ? void 0 : config.onSuccess(value);\n continueFn == null ? void 0 : continueFn();\n promiseResolve(value);\n }\n };\n\n var reject = function reject(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onError == null ? void 0 : config.onError(value);\n continueFn == null ? void 0 : continueFn();\n promiseReject(value);\n }\n };\n\n var pause = function pause() {\n return new Promise(function (continueResolve) {\n continueFn = continueResolve;\n _this.isPaused = true;\n config.onPause == null ? void 0 : config.onPause();\n }).then(function () {\n continueFn = undefined;\n _this.isPaused = false;\n config.onContinue == null ? void 0 : config.onContinue();\n });\n }; // Create loop function\n\n\n var run = function run() {\n // Do nothing if already resolved\n if (_this.isResolved) {\n return;\n }\n\n var promiseOrValue; // Execute query\n\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n } // Create callback to cancel this fetch\n\n\n cancelFn = function cancelFn(cancelOptions) {\n if (!_this.isResolved) {\n reject(new CancelledError(cancelOptions));\n _this.abort == null ? void 0 : _this.abort(); // Cancel transport if supported\n\n if (isCancelable(promiseOrValue)) {\n try {\n promiseOrValue.cancel();\n } catch (_unused) {}\n }\n }\n }; // Check if the transport layer support cancellation\n\n\n _this.isTransportCancelable = isCancelable(promiseOrValue);\n Promise.resolve(promiseOrValue).then(resolve).catch(function (error) {\n var _config$retry, _config$retryDelay;\n\n // Stop if the fetch is already resolved\n if (_this.isResolved) {\n return;\n } // Do we need to retry the request?\n\n\n var retry = (_config$retry = config.retry) != null ? _config$retry : 3;\n var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;\n var delay = typeof retryDelay === 'function' ? retryDelay(_this.failureCount, error) : retryDelay;\n var shouldRetry = retry === true || typeof retry === 'number' && _this.failureCount < retry || typeof retry === 'function' && retry(_this.failureCount, error);\n\n if (cancelRetry || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error);\n return;\n }\n\n _this.failureCount++; // Notify on fail\n\n config.onFail == null ? void 0 : config.onFail(_this.failureCount, error); // Delay\n\n sleep(delay) // Pause if the document is not visible or when the device is offline\n .then(function () {\n if (!focusManager.isFocused() || !onlineManager.isOnline()) {\n return pause();\n }\n }).then(function () {\n if (cancelRetry) {\n reject(error);\n } else {\n run();\n }\n });\n });\n }; // Start loop\n\n\n run();\n};","import { scheduleMicrotask } from './utils'; // TYPES\n\n// CLASS\nexport var NotifyManager = /*#__PURE__*/function () {\n function NotifyManager() {\n this.queue = [];\n this.transactions = 0;\n\n this.notifyFn = function (callback) {\n callback();\n };\n\n this.batchNotifyFn = function (callback) {\n callback();\n };\n }\n\n var _proto = NotifyManager.prototype;\n\n _proto.batch = function batch(callback) {\n var result;\n this.transactions++;\n\n try {\n result = callback();\n } finally {\n this.transactions--;\n\n if (!this.transactions) {\n this.flush();\n }\n }\n\n return result;\n };\n\n _proto.schedule = function schedule(callback) {\n var _this = this;\n\n if (this.transactions) {\n this.queue.push(callback);\n } else {\n scheduleMicrotask(function () {\n _this.notifyFn(callback);\n });\n }\n }\n /**\n * All calls to the wrapped function will be batched.\n */\n ;\n\n _proto.batchCalls = function batchCalls(callback) {\n var _this2 = this;\n\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this2.schedule(function () {\n callback.apply(void 0, args);\n });\n };\n };\n\n _proto.flush = function flush() {\n var _this3 = this;\n\n var queue = this.queue;\n this.queue = [];\n\n if (queue.length) {\n scheduleMicrotask(function () {\n _this3.batchNotifyFn(function () {\n queue.forEach(function (callback) {\n _this3.notifyFn(callback);\n });\n });\n });\n }\n }\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n ;\n\n _proto.setNotifyFunction = function setNotifyFunction(fn) {\n this.notifyFn = fn;\n }\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n ;\n\n _proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn) {\n this.batchNotifyFn = fn;\n };\n\n return NotifyManager;\n}(); // SINGLETON\n\nexport var notifyManager = new NotifyManager();","// TYPES\n// FUNCTIONS\nvar logger = console;\nexport function getLogger() {\n return logger;\n}\nexport function setLogger(newLogger) {\n logger = newLogger;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getAbortController, functionalUpdate, isValidTimeout, noop, replaceEqualDeep, timeUntilStale, ensureQueryKeyArray } from './utils';\nimport { notifyManager } from './notifyManager';\nimport { getLogger } from './logger';\nimport { Retryer, isCancelledError } from './retryer'; // TYPES\n\n// CLASS\nexport var Query = /*#__PURE__*/function () {\n function Query(config) {\n this.abortSignalConsumed = false;\n this.hadObservers = false;\n this.defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.initialState = config.state || this.getDefaultState(this.options);\n this.state = this.initialState;\n this.meta = config.meta;\n this.scheduleGc();\n }\n\n var _proto = Query.prototype;\n\n _proto.setOptions = function setOptions(options) {\n var _this$options$cacheTi;\n\n this.options = _extends({}, this.defaultOptions, options);\n this.meta = options == null ? void 0 : options.meta; // Default to 5 minutes if not cache time is set\n\n this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 5 * 60 * 1000);\n };\n\n _proto.setDefaultOptions = function setDefaultOptions(options) {\n this.defaultOptions = options;\n };\n\n _proto.scheduleGc = function scheduleGc() {\n var _this = this;\n\n this.clearGcTimeout();\n\n if (isValidTimeout(this.cacheTime)) {\n this.gcTimeout = setTimeout(function () {\n _this.optionalRemove();\n }, this.cacheTime);\n }\n };\n\n _proto.clearGcTimeout = function clearGcTimeout() {\n if (this.gcTimeout) {\n clearTimeout(this.gcTimeout);\n this.gcTimeout = undefined;\n }\n };\n\n _proto.optionalRemove = function optionalRemove() {\n if (!this.observers.length) {\n if (this.state.isFetching) {\n if (this.hadObservers) {\n this.scheduleGc();\n }\n } else {\n this.cache.remove(this);\n }\n }\n };\n\n _proto.setData = function setData(updater, options) {\n var _this$options$isDataE, _this$options;\n\n var prevData = this.state.data; // Get the new data\n\n var data = functionalUpdate(updater, prevData); // Use prev data if an isDataEqual function is defined and returns `true`\n\n if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) {\n data = prevData;\n } else if (this.options.structuralSharing !== false) {\n // Structurally share data between prev and new data if needed\n data = replaceEqualDeep(prevData, data);\n } // Set data and mark it as cached\n\n\n this.dispatch({\n data: data,\n type: 'success',\n dataUpdatedAt: options == null ? void 0 : options.updatedAt\n });\n return data;\n };\n\n _proto.setState = function setState(state, setStateOptions) {\n this.dispatch({\n type: 'setState',\n state: state,\n setStateOptions: setStateOptions\n });\n };\n\n _proto.cancel = function cancel(options) {\n var _this$retryer;\n\n var promise = this.promise;\n (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n };\n\n _proto.destroy = function destroy() {\n this.clearGcTimeout();\n this.cancel({\n silent: true\n });\n };\n\n _proto.reset = function reset() {\n this.destroy();\n this.setState(this.initialState);\n };\n\n _proto.isActive = function isActive() {\n return this.observers.some(function (observer) {\n return observer.options.enabled !== false;\n });\n };\n\n _proto.isFetching = function isFetching() {\n return this.state.isFetching;\n };\n\n _proto.isStale = function isStale() {\n return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function (observer) {\n return observer.getCurrentResult().isStale;\n });\n };\n\n _proto.isStaleByTime = function isStaleByTime(staleTime) {\n if (staleTime === void 0) {\n staleTime = 0;\n }\n\n return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n };\n\n _proto.onFocus = function onFocus() {\n var _this$retryer2;\n\n var observer = this.observers.find(function (x) {\n return x.shouldFetchOnWindowFocus();\n });\n\n if (observer) {\n observer.refetch();\n } // Continue fetch if currently paused\n\n\n (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();\n };\n\n _proto.onOnline = function onOnline() {\n var _this$retryer3;\n\n var observer = this.observers.find(function (x) {\n return x.shouldFetchOnReconnect();\n });\n\n if (observer) {\n observer.refetch();\n } // Continue fetch if currently paused\n\n\n (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();\n };\n\n _proto.addObserver = function addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer);\n this.hadObservers = true; // Stop the query from being garbage collected\n\n this.clearGcTimeout();\n this.cache.notify({\n type: 'observerAdded',\n query: this,\n observer: observer\n });\n }\n };\n\n _proto.removeObserver = function removeObserver(observer) {\n if (this.observers.indexOf(observer) !== -1) {\n this.observers = this.observers.filter(function (x) {\n return x !== observer;\n });\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.retryer) {\n if (this.retryer.isTransportCancelable || this.abortSignalConsumed) {\n this.retryer.cancel({\n revert: true\n });\n } else {\n this.retryer.cancelRetry();\n }\n }\n\n if (this.cacheTime) {\n this.scheduleGc();\n } else {\n this.cache.remove(this);\n }\n }\n\n this.cache.notify({\n type: 'observerRemoved',\n query: this,\n observer: observer\n });\n }\n };\n\n _proto.getObserversCount = function getObserversCount() {\n return this.observers.length;\n };\n\n _proto.invalidate = function invalidate() {\n if (!this.state.isInvalidated) {\n this.dispatch({\n type: 'invalidate'\n });\n }\n };\n\n _proto.fetch = function fetch(options, fetchOptions) {\n var _this2 = this,\n _this$options$behavio,\n _context$fetchOptions,\n _abortController$abor;\n\n if (this.state.isFetching) {\n if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) {\n // Silently cancel current fetch if the user wants to cancel refetches\n this.cancel({\n silent: true\n });\n } else if (this.promise) {\n var _this$retryer4;\n\n // make sure that retries that were potentially cancelled due to unmounts can continue\n (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching\n\n return this.promise;\n }\n } // Update config if passed, otherwise the config from the last execution is used\n\n\n if (options) {\n this.setOptions(options);\n } // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n\n\n if (!this.options.queryFn) {\n var observer = this.observers.find(function (x) {\n return x.options.queryFn;\n });\n\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n\n var queryKey = ensureQueryKeyArray(this.queryKey);\n var abortController = getAbortController(); // Create query function context\n\n var queryFnContext = {\n queryKey: queryKey,\n pageParam: undefined,\n meta: this.meta\n };\n Object.defineProperty(queryFnContext, 'signal', {\n enumerable: true,\n get: function get() {\n if (abortController) {\n _this2.abortSignalConsumed = true;\n return abortController.signal;\n }\n\n return undefined;\n }\n }); // Create fetch function\n\n var fetchFn = function fetchFn() {\n if (!_this2.options.queryFn) {\n return Promise.reject('Missing queryFn');\n }\n\n _this2.abortSignalConsumed = false;\n return _this2.options.queryFn(queryFnContext);\n }; // Trigger behavior hook\n\n\n var context = {\n fetchOptions: fetchOptions,\n options: this.options,\n queryKey: queryKey,\n state: this.state,\n fetchFn: fetchFn,\n meta: this.meta\n };\n\n if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) {\n var _this$options$behavio2;\n\n (_this$options$behavio2 = this.options.behavior) == null ? void 0 : _this$options$behavio2.onFetch(context);\n } // Store state in case the current fetch needs to be reverted\n\n\n this.revertState = this.state; // Set to fetching state if not already in it\n\n if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {\n var _context$fetchOptions2;\n\n this.dispatch({\n type: 'fetch',\n meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta\n });\n } // Try to fetch the data\n\n\n this.retryer = new Retryer({\n fn: context.fetchFn,\n abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController),\n onSuccess: function onSuccess(data) {\n _this2.setData(data); // Notify cache callback\n\n\n _this2.cache.config.onSuccess == null ? void 0 : _this2.cache.config.onSuccess(data, _this2); // Remove query after fetching if cache time is 0\n\n if (_this2.cacheTime === 0) {\n _this2.optionalRemove();\n }\n },\n onError: function onError(error) {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n _this2.dispatch({\n type: 'error',\n error: error\n });\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n _this2.cache.config.onError == null ? void 0 : _this2.cache.config.onError(error, _this2); // Log error\n\n getLogger().error(error);\n } // Remove query after fetching if cache time is 0\n\n\n if (_this2.cacheTime === 0) {\n _this2.optionalRemove();\n }\n },\n onFail: function onFail() {\n _this2.dispatch({\n type: 'failed'\n });\n },\n onPause: function onPause() {\n _this2.dispatch({\n type: 'pause'\n });\n },\n onContinue: function onContinue() {\n _this2.dispatch({\n type: 'continue'\n });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay\n });\n this.promise = this.retryer.promise;\n return this.promise;\n };\n\n _proto.dispatch = function dispatch(action) {\n var _this3 = this;\n\n this.state = this.reducer(this.state, action);\n notifyManager.batch(function () {\n _this3.observers.forEach(function (observer) {\n observer.onQueryUpdate(action);\n });\n\n _this3.cache.notify({\n query: _this3,\n type: 'queryUpdated',\n action: action\n });\n });\n };\n\n _proto.getDefaultState = function getDefaultState(options) {\n var data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;\n var hasInitialData = typeof options.initialData !== 'undefined';\n var initialDataUpdatedAt = hasInitialData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n var hasData = typeof data !== 'undefined';\n return {\n data: data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchMeta: null,\n isFetching: false,\n isInvalidated: false,\n isPaused: false,\n status: hasData ? 'success' : 'idle'\n };\n };\n\n _proto.reducer = function reducer(state, action) {\n var _action$meta, _action$dataUpdatedAt;\n\n switch (action.type) {\n case 'failed':\n return _extends({}, state, {\n fetchFailureCount: state.fetchFailureCount + 1\n });\n\n case 'pause':\n return _extends({}, state, {\n isPaused: true\n });\n\n case 'continue':\n return _extends({}, state, {\n isPaused: false\n });\n\n case 'fetch':\n return _extends({}, state, {\n fetchFailureCount: 0,\n fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,\n isFetching: true,\n isPaused: false\n }, !state.dataUpdatedAt && {\n error: null,\n status: 'loading'\n });\n\n case 'success':\n return _extends({}, state, {\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),\n error: null,\n fetchFailureCount: 0,\n isFetching: false,\n isInvalidated: false,\n isPaused: false,\n status: 'success'\n });\n\n case 'error':\n var error = action.error;\n\n if (isCancelledError(error) && error.revert && this.revertState) {\n return _extends({}, this.revertState);\n }\n\n return _extends({}, state, {\n error: error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n isFetching: false,\n isPaused: false,\n status: 'error'\n });\n\n case 'invalidate':\n return _extends({}, state, {\n isInvalidated: true\n });\n\n case 'setState':\n return _extends({}, state, action.state);\n\n default:\n return state;\n }\n };\n\n return Query;\n}();","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { hashQueryKeyByOptions, matchQuery, parseFilterArgs } from './utils';\nimport { Query } from './query';\nimport { notifyManager } from './notifyManager';\nimport { Subscribable } from './subscribable';\n// CLASS\nexport var QueryCache = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(QueryCache, _Subscribable);\n\n function QueryCache(config) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.config = config || {};\n _this.queries = [];\n _this.queriesMap = {};\n return _this;\n }\n\n var _proto = QueryCache.prototype;\n\n _proto.build = function build(client, options, state) {\n var _options$queryHash;\n\n var queryKey = options.queryKey;\n var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options);\n var query = this.get(queryHash);\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey: queryKey,\n queryHash: queryHash,\n options: client.defaultQueryOptions(options),\n state: state,\n defaultOptions: client.getQueryDefaults(queryKey),\n meta: options.meta\n });\n this.add(query);\n }\n\n return query;\n };\n\n _proto.add = function add(query) {\n if (!this.queriesMap[query.queryHash]) {\n this.queriesMap[query.queryHash] = query;\n this.queries.push(query);\n this.notify({\n type: 'queryAdded',\n query: query\n });\n }\n };\n\n _proto.remove = function remove(query) {\n var queryInMap = this.queriesMap[query.queryHash];\n\n if (queryInMap) {\n query.destroy();\n this.queries = this.queries.filter(function (x) {\n return x !== query;\n });\n\n if (queryInMap === query) {\n delete this.queriesMap[query.queryHash];\n }\n\n this.notify({\n type: 'queryRemoved',\n query: query\n });\n }\n };\n\n _proto.clear = function clear() {\n var _this2 = this;\n\n notifyManager.batch(function () {\n _this2.queries.forEach(function (query) {\n _this2.remove(query);\n });\n });\n };\n\n _proto.get = function get(queryHash) {\n return this.queriesMap[queryHash];\n };\n\n _proto.getAll = function getAll() {\n return this.queries;\n };\n\n _proto.find = function find(arg1, arg2) {\n var _parseFilterArgs = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs[0];\n\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.queries.find(function (query) {\n return matchQuery(filters, query);\n });\n };\n\n _proto.findAll = function findAll(arg1, arg2) {\n var _parseFilterArgs2 = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs2[0];\n\n return Object.keys(filters).length > 0 ? this.queries.filter(function (query) {\n return matchQuery(filters, query);\n }) : this.queries;\n };\n\n _proto.notify = function notify(event) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(event);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n var _this4 = this;\n\n notifyManager.batch(function () {\n _this4.queries.forEach(function (query) {\n query.onFocus();\n });\n });\n };\n\n _proto.onOnline = function onOnline() {\n var _this5 = this;\n\n notifyManager.batch(function () {\n _this5.queries.forEach(function (query) {\n query.onOnline();\n });\n });\n };\n\n return QueryCache;\n}(Subscribable);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getLogger } from './logger';\nimport { notifyManager } from './notifyManager';\nimport { Retryer } from './retryer';\nimport { noop } from './utils'; // TYPES\n\n// CLASS\nexport var Mutation = /*#__PURE__*/function () {\n function Mutation(config) {\n this.options = _extends({}, config.defaultOptions, config.options);\n this.mutationId = config.mutationId;\n this.mutationCache = config.mutationCache;\n this.observers = [];\n this.state = config.state || getDefaultState();\n this.meta = config.meta;\n }\n\n var _proto = Mutation.prototype;\n\n _proto.setState = function setState(state) {\n this.dispatch({\n type: 'setState',\n state: state\n });\n };\n\n _proto.addObserver = function addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer);\n }\n };\n\n _proto.removeObserver = function removeObserver(observer) {\n this.observers = this.observers.filter(function (x) {\n return x !== observer;\n });\n };\n\n _proto.cancel = function cancel() {\n if (this.retryer) {\n this.retryer.cancel();\n return this.retryer.promise.then(noop).catch(noop);\n }\n\n return Promise.resolve();\n };\n\n _proto.continue = function _continue() {\n if (this.retryer) {\n this.retryer.continue();\n return this.retryer.promise;\n }\n\n return this.execute();\n };\n\n _proto.execute = function execute() {\n var _this = this;\n\n var data;\n var restored = this.state.status === 'loading';\n var promise = Promise.resolve();\n\n if (!restored) {\n this.dispatch({\n type: 'loading',\n variables: this.options.variables\n });\n promise = promise.then(function () {\n // Notify cache callback\n _this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this);\n }).then(function () {\n return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables);\n }).then(function (context) {\n if (context !== _this.state.context) {\n _this.dispatch({\n type: 'loading',\n context: context,\n variables: _this.state.variables\n });\n }\n });\n }\n\n return promise.then(function () {\n return _this.executeMutation();\n }).then(function (result) {\n data = result; // Notify cache callback\n\n _this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this);\n }).then(function () {\n return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'success',\n data: data\n });\n\n return data;\n }).catch(function (error) {\n // Notify cache callback\n _this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); // Log error\n\n getLogger().error(error);\n return Promise.resolve().then(function () {\n return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(undefined, error, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'error',\n error: error\n });\n\n throw error;\n });\n });\n };\n\n _proto.executeMutation = function executeMutation() {\n var _this2 = this,\n _this$options$retry;\n\n this.retryer = new Retryer({\n fn: function fn() {\n if (!_this2.options.mutationFn) {\n return Promise.reject('No mutationFn found');\n }\n\n return _this2.options.mutationFn(_this2.state.variables);\n },\n onFail: function onFail() {\n _this2.dispatch({\n type: 'failed'\n });\n },\n onPause: function onPause() {\n _this2.dispatch({\n type: 'pause'\n });\n },\n onContinue: function onContinue() {\n _this2.dispatch({\n type: 'continue'\n });\n },\n retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,\n retryDelay: this.options.retryDelay\n });\n return this.retryer.promise;\n };\n\n _proto.dispatch = function dispatch(action) {\n var _this3 = this;\n\n this.state = reducer(this.state, action);\n notifyManager.batch(function () {\n _this3.observers.forEach(function (observer) {\n observer.onMutationUpdate(action);\n });\n\n _this3.mutationCache.notify(_this3);\n });\n };\n\n return Mutation;\n}();\nexport function getDefaultState() {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isPaused: false,\n status: 'idle',\n variables: undefined\n };\n}\n\nfunction reducer(state, action) {\n switch (action.type) {\n case 'failed':\n return _extends({}, state, {\n failureCount: state.failureCount + 1\n });\n\n case 'pause':\n return _extends({}, state, {\n isPaused: true\n });\n\n case 'continue':\n return _extends({}, state, {\n isPaused: false\n });\n\n case 'loading':\n return _extends({}, state, {\n context: action.context,\n data: undefined,\n error: null,\n isPaused: false,\n status: 'loading',\n variables: action.variables\n });\n\n case 'success':\n return _extends({}, state, {\n data: action.data,\n error: null,\n status: 'success',\n isPaused: false\n });\n\n case 'error':\n return _extends({}, state, {\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n isPaused: false,\n status: 'error'\n });\n\n case 'setState':\n return _extends({}, state, action.state);\n\n default:\n return state;\n }\n}","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { notifyManager } from './notifyManager';\nimport { Mutation } from './mutation';\nimport { matchMutation, noop } from './utils';\nimport { Subscribable } from './subscribable'; // TYPES\n\n// CLASS\nexport var MutationCache = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(MutationCache, _Subscribable);\n\n function MutationCache(config) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.config = config || {};\n _this.mutations = [];\n _this.mutationId = 0;\n return _this;\n }\n\n var _proto = MutationCache.prototype;\n\n _proto.build = function build(client, options, state) {\n var mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.mutationId,\n options: client.defaultMutationOptions(options),\n state: state,\n defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined,\n meta: options.meta\n });\n this.add(mutation);\n return mutation;\n };\n\n _proto.add = function add(mutation) {\n this.mutations.push(mutation);\n this.notify(mutation);\n };\n\n _proto.remove = function remove(mutation) {\n this.mutations = this.mutations.filter(function (x) {\n return x !== mutation;\n });\n mutation.cancel();\n this.notify(mutation);\n };\n\n _proto.clear = function clear() {\n var _this2 = this;\n\n notifyManager.batch(function () {\n _this2.mutations.forEach(function (mutation) {\n _this2.remove(mutation);\n });\n });\n };\n\n _proto.getAll = function getAll() {\n return this.mutations;\n };\n\n _proto.find = function find(filters) {\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.mutations.find(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.findAll = function findAll(filters) {\n return this.mutations.filter(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.notify = function notify(mutation) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(mutation);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n this.resumePausedMutations();\n };\n\n _proto.onOnline = function onOnline() {\n this.resumePausedMutations();\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n var pausedMutations = this.mutations.filter(function (x) {\n return x.state.isPaused;\n });\n return notifyManager.batch(function () {\n return pausedMutations.reduce(function (promise, mutation) {\n return promise.then(function () {\n return mutation.continue().catch(noop);\n });\n }, Promise.resolve());\n });\n };\n\n return MutationCache;\n}(Subscribable);","import { isCancelable } from './retryer';\nimport { getAbortController } from './utils';\nexport function infiniteQueryBehavior() {\n return {\n onFetch: function onFetch(context) {\n context.fetchFn = function () {\n var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;\n\n var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;\n var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;\n var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;\n var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';\n var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';\n var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];\n var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];\n var abortController = getAbortController();\n var abortSignal = abortController == null ? void 0 : abortController.signal;\n var newPageParams = oldPageParams;\n var cancelled = false; // Get query function\n\n var queryFn = context.options.queryFn || function () {\n return Promise.reject('Missing queryFn');\n };\n\n var buildNewPages = function buildNewPages(pages, param, page, previous) {\n newPageParams = previous ? [param].concat(newPageParams) : [].concat(newPageParams, [param]);\n return previous ? [page].concat(pages) : [].concat(pages, [page]);\n }; // Create function to fetch a page\n\n\n var fetchPage = function fetchPage(pages, manual, param, previous) {\n if (cancelled) {\n return Promise.reject('Cancelled');\n }\n\n if (typeof param === 'undefined' && !manual && pages.length) {\n return Promise.resolve(pages);\n }\n\n var queryFnContext = {\n queryKey: context.queryKey,\n signal: abortSignal,\n pageParam: param,\n meta: context.meta\n };\n var queryFnResult = queryFn(queryFnContext);\n var promise = Promise.resolve(queryFnResult).then(function (page) {\n return buildNewPages(pages, param, page, previous);\n });\n\n if (isCancelable(queryFnResult)) {\n var promiseAsAny = promise;\n promiseAsAny.cancel = queryFnResult.cancel;\n }\n\n return promise;\n };\n\n var promise; // Fetch first page?\n\n if (!oldPages.length) {\n promise = fetchPage([]);\n } // Fetch next page?\n else if (isFetchingNextPage) {\n var manual = typeof pageParam !== 'undefined';\n var param = manual ? pageParam : getNextPageParam(context.options, oldPages);\n promise = fetchPage(oldPages, manual, param);\n } // Fetch previous page?\n else if (isFetchingPreviousPage) {\n var _manual = typeof pageParam !== 'undefined';\n\n var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages);\n\n promise = fetchPage(oldPages, _manual, _param, true);\n } // Refetch pages\n else {\n (function () {\n newPageParams = [];\n var manual = typeof context.options.getNextPageParam === 'undefined';\n var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page\n\n promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages\n\n var _loop = function _loop(i) {\n promise = promise.then(function (pages) {\n var shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;\n\n if (shouldFetchNextPage) {\n var _param2 = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);\n\n return fetchPage(pages, manual, _param2);\n }\n\n return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));\n });\n };\n\n for (var i = 1; i < oldPages.length; i++) {\n _loop(i);\n }\n })();\n }\n\n var finalPromise = promise.then(function (pages) {\n return {\n pages: pages,\n pageParams: newPageParams\n };\n });\n var finalPromiseAsAny = finalPromise;\n\n finalPromiseAsAny.cancel = function () {\n cancelled = true;\n abortController == null ? void 0 : abortController.abort();\n\n if (isCancelable(promise)) {\n promise.cancel();\n }\n };\n\n return finalPromise;\n };\n }\n };\n}\nexport function getNextPageParam(options, pages) {\n return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);\n}\nexport function getPreviousPageParam(options, pages) {\n return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);\n}\n/**\n * Checks if there is a next page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasNextPage(options, pages) {\n if (options.getNextPageParam && Array.isArray(pages)) {\n var nextPageParam = getNextPageParam(options, pages);\n return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;\n }\n}\n/**\n * Checks if there is a previous page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasPreviousPage(options, pages) {\n if (options.getPreviousPageParam && Array.isArray(pages)) {\n var previousPageParam = getPreviousPageParam(options, pages);\n return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { hashQueryKey, noop, parseFilterArgs, parseQueryArgs, partialMatchKey, hashQueryKeyByOptions } from './utils';\nimport { QueryCache } from './queryCache';\nimport { MutationCache } from './mutationCache';\nimport { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { notifyManager } from './notifyManager';\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior';\n// CLASS\nexport var QueryClient = /*#__PURE__*/function () {\n function QueryClient(config) {\n if (config === void 0) {\n config = {};\n }\n\n this.queryCache = config.queryCache || new QueryCache();\n this.mutationCache = config.mutationCache || new MutationCache();\n this.defaultOptions = config.defaultOptions || {};\n this.queryDefaults = [];\n this.mutationDefaults = [];\n }\n\n var _proto = QueryClient.prototype;\n\n _proto.mount = function mount() {\n var _this = this;\n\n this.unsubscribeFocus = focusManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onFocus();\n\n _this.queryCache.onFocus();\n }\n });\n this.unsubscribeOnline = onlineManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onOnline();\n\n _this.queryCache.onOnline();\n }\n });\n };\n\n _proto.unmount = function unmount() {\n var _this$unsubscribeFocu, _this$unsubscribeOnli;\n\n (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);\n (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);\n };\n\n _proto.isFetching = function isFetching(arg1, arg2) {\n var _parseFilterArgs = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs[0];\n\n filters.fetching = true;\n return this.queryCache.findAll(filters).length;\n };\n\n _proto.isMutating = function isMutating(filters) {\n return this.mutationCache.findAll(_extends({}, filters, {\n fetching: true\n })).length;\n };\n\n _proto.getQueryData = function getQueryData(queryKey, filters) {\n var _this$queryCache$find;\n\n return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;\n };\n\n _proto.getQueriesData = function getQueriesData(queryKeyOrFilters) {\n return this.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref) {\n var queryKey = _ref.queryKey,\n state = _ref.state;\n var data = state.data;\n return [queryKey, data];\n });\n };\n\n _proto.setQueryData = function setQueryData(queryKey, updater, options) {\n var parsedOptions = parseQueryArgs(queryKey);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions);\n return this.queryCache.build(this, defaultedOptions).setData(updater, options);\n };\n\n _proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) {\n var _this2 = this;\n\n return notifyManager.batch(function () {\n return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref2) {\n var queryKey = _ref2.queryKey;\n return [queryKey, _this2.setQueryData(queryKey, updater, options)];\n });\n });\n };\n\n _proto.getQueryState = function getQueryState(queryKey, filters) {\n var _this$queryCache$find2;\n\n return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;\n };\n\n _proto.removeQueries = function removeQueries(arg1, arg2) {\n var _parseFilterArgs2 = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs2[0];\n\n var queryCache = this.queryCache;\n notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n queryCache.remove(query);\n });\n });\n };\n\n _proto.resetQueries = function resetQueries(arg1, arg2, arg3) {\n var _this3 = this;\n\n var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs3[0],\n options = _parseFilterArgs3[1];\n\n var queryCache = this.queryCache;\n\n var refetchFilters = _extends({}, filters, {\n active: true\n });\n\n return notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n query.reset();\n });\n return _this3.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) {\n var _this4 = this;\n\n var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs4[0],\n _parseFilterArgs4$ = _parseFilterArgs4[1],\n cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$;\n\n if (typeof cancelOptions.revert === 'undefined') {\n cancelOptions.revert = true;\n }\n\n var promises = notifyManager.batch(function () {\n return _this4.queryCache.findAll(filters).map(function (query) {\n return query.cancel(cancelOptions);\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) {\n var _ref3,\n _filters$refetchActiv,\n _filters$refetchInact,\n _this5 = this;\n\n var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs5[0],\n options = _parseFilterArgs5[1];\n\n var refetchFilters = _extends({}, filters, {\n // if filters.refetchActive is not provided and filters.active is explicitly false,\n // e.g. invalidateQueries({ active: false }), we don't want to refetch active queries\n active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true,\n inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false\n });\n\n return notifyManager.batch(function () {\n _this5.queryCache.findAll(filters).forEach(function (query) {\n query.invalidate();\n });\n\n return _this5.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) {\n var _this6 = this;\n\n var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs6[0],\n options = _parseFilterArgs6[1];\n\n var promises = notifyManager.batch(function () {\n return _this6.queryCache.findAll(filters).map(function (query) {\n return query.fetch(undefined, _extends({}, options, {\n meta: {\n refetchPage: filters == null ? void 0 : filters.refetchPage\n }\n }));\n });\n });\n var promise = Promise.all(promises).then(noop);\n\n if (!(options == null ? void 0 : options.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652\n\n if (typeof defaultedOptions.retry === 'undefined') {\n defaultedOptions.retry = false;\n }\n\n var query = this.queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n };\n\n _proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) {\n return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n parsedOptions.behavior = infiniteQueryBehavior();\n return this.fetchQuery(parsedOptions);\n };\n\n _proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) {\n return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.cancelMutations = function cancelMutations() {\n var _this7 = this;\n\n var promises = notifyManager.batch(function () {\n return _this7.mutationCache.getAll().map(function (mutation) {\n return mutation.cancel();\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n return this.getMutationCache().resumePausedMutations();\n };\n\n _proto.executeMutation = function executeMutation(options) {\n return this.mutationCache.build(this, options).execute();\n };\n\n _proto.getQueryCache = function getQueryCache() {\n return this.queryCache;\n };\n\n _proto.getMutationCache = function getMutationCache() {\n return this.mutationCache;\n };\n\n _proto.getDefaultOptions = function getDefaultOptions() {\n return this.defaultOptions;\n };\n\n _proto.setDefaultOptions = function setDefaultOptions(options) {\n this.defaultOptions = options;\n };\n\n _proto.setQueryDefaults = function setQueryDefaults(queryKey, options) {\n var result = this.queryDefaults.find(function (x) {\n return hashQueryKey(queryKey) === hashQueryKey(x.queryKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.queryDefaults.push({\n queryKey: queryKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getQueryDefaults = function getQueryDefaults(queryKey) {\n var _this$queryDefaults$f;\n\n return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function (x) {\n return partialMatchKey(queryKey, x.queryKey);\n })) == null ? void 0 : _this$queryDefaults$f.defaultOptions : undefined;\n };\n\n _proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) {\n var result = this.mutationDefaults.find(function (x) {\n return hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.mutationDefaults.push({\n mutationKey: mutationKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getMutationDefaults = function getMutationDefaults(mutationKey) {\n var _this$mutationDefault;\n\n return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function (x) {\n return partialMatchKey(mutationKey, x.mutationKey);\n })) == null ? void 0 : _this$mutationDefault.defaultOptions : undefined;\n };\n\n _proto.defaultQueryOptions = function defaultQueryOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n var defaultedOptions = _extends({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, {\n _defaulted: true\n });\n\n if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n }\n\n return defaultedOptions;\n };\n\n _proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) {\n return this.defaultQueryOptions(options);\n };\n\n _proto.defaultMutationOptions = function defaultMutationOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n return _extends({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, {\n _defaulted: true\n });\n };\n\n _proto.clear = function clear() {\n this.queryCache.clear();\n this.mutationCache.clear();\n };\n\n return QueryClient;\n}();","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { isServer, isValidTimeout, noop, replaceEqualDeep, shallowEqualObjects, timeUntilStale } from './utils';\nimport { notifyManager } from './notifyManager';\nimport { focusManager } from './focusManager';\nimport { Subscribable } from './subscribable';\nimport { getLogger } from './logger';\nimport { isCancelledError } from './retryer';\nexport var QueryObserver = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(QueryObserver, _Subscribable);\n\n function QueryObserver(client, options) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.client = client;\n _this.options = options;\n _this.trackedProps = [];\n _this.selectError = null;\n\n _this.bindMethods();\n\n _this.setOptions(options);\n\n return _this;\n }\n\n var _proto = QueryObserver.prototype;\n\n _proto.bindMethods = function bindMethods() {\n this.remove = this.remove.bind(this);\n this.refetch = this.refetch.bind(this);\n };\n\n _proto.onSubscribe = function onSubscribe() {\n if (this.listeners.length === 1) {\n this.currentQuery.addObserver(this);\n\n if (shouldFetchOnMount(this.currentQuery, this.options)) {\n this.executeFetch();\n }\n\n this.updateTimers();\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.listeners.length) {\n this.destroy();\n }\n };\n\n _proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() {\n return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect);\n };\n\n _proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() {\n return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus);\n };\n\n _proto.destroy = function destroy() {\n this.listeners = [];\n this.clearTimers();\n this.currentQuery.removeObserver(this);\n };\n\n _proto.setOptions = function setOptions(options, notifyOptions) {\n var prevOptions = this.options;\n var prevQuery = this.currentQuery;\n this.options = this.client.defaultQueryObserverOptions(options);\n\n if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') {\n throw new Error('Expected enabled to be a boolean');\n } // Keep previous query key if the user does not supply one\n\n\n if (!this.options.queryKey) {\n this.options.queryKey = prevOptions.queryKey;\n }\n\n this.updateQuery();\n var mounted = this.hasListeners(); // Fetch if there are subscribers\n\n if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) {\n this.executeFetch();\n } // Update result\n\n\n this.updateResult(notifyOptions); // Update stale interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.updateStaleTimeout();\n }\n\n var nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) {\n this.updateRefetchInterval(nextRefetchInterval);\n }\n };\n\n _proto.getOptimisticResult = function getOptimisticResult(options) {\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return this.createResult(query, defaultedOptions);\n };\n\n _proto.getCurrentResult = function getCurrentResult() {\n return this.currentResult;\n };\n\n _proto.trackResult = function trackResult(result, defaultedOptions) {\n var _this2 = this;\n\n var trackedResult = {};\n\n var trackProp = function trackProp(key) {\n if (!_this2.trackedProps.includes(key)) {\n _this2.trackedProps.push(key);\n }\n };\n\n Object.keys(result).forEach(function (key) {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: function get() {\n trackProp(key);\n return result[key];\n }\n });\n });\n\n if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) {\n trackProp('error');\n }\n\n return trackedResult;\n };\n\n _proto.getNextResult = function getNextResult(options) {\n var _this3 = this;\n\n return new Promise(function (resolve, reject) {\n var unsubscribe = _this3.subscribe(function (result) {\n if (!result.isFetching) {\n unsubscribe();\n\n if (result.isError && (options == null ? void 0 : options.throwOnError)) {\n reject(result.error);\n } else {\n resolve(result);\n }\n }\n });\n });\n };\n\n _proto.getCurrentQuery = function getCurrentQuery() {\n return this.currentQuery;\n };\n\n _proto.remove = function remove() {\n this.client.getQueryCache().remove(this.currentQuery);\n };\n\n _proto.refetch = function refetch(options) {\n return this.fetch(_extends({}, options, {\n meta: {\n refetchPage: options == null ? void 0 : options.refetchPage\n }\n }));\n };\n\n _proto.fetchOptimistic = function fetchOptimistic(options) {\n var _this4 = this;\n\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return query.fetch().then(function () {\n return _this4.createResult(query, defaultedOptions);\n });\n };\n\n _proto.fetch = function fetch(fetchOptions) {\n var _this5 = this;\n\n return this.executeFetch(fetchOptions).then(function () {\n _this5.updateResult();\n\n return _this5.currentResult;\n });\n };\n\n _proto.executeFetch = function executeFetch(fetchOptions) {\n // Make sure we reference the latest query as the current one might have been removed\n this.updateQuery(); // Fetch\n\n var promise = this.currentQuery.fetch(this.options, fetchOptions);\n\n if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.updateStaleTimeout = function updateStaleTimeout() {\n var _this6 = this;\n\n this.clearStaleTimeout();\n\n if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n\n var time = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n\n var timeout = time + 1;\n this.staleTimeoutId = setTimeout(function () {\n if (!_this6.currentResult.isStale) {\n _this6.updateResult();\n }\n }, timeout);\n };\n\n _proto.computeRefetchInterval = function computeRefetchInterval() {\n var _this$options$refetch;\n\n return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;\n };\n\n _proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) {\n var _this7 = this;\n\n this.clearRefetchInterval();\n this.currentRefetchInterval = nextInterval;\n\n if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) {\n return;\n }\n\n this.refetchIntervalId = setInterval(function () {\n if (_this7.options.refetchIntervalInBackground || focusManager.isFocused()) {\n _this7.executeFetch();\n }\n }, this.currentRefetchInterval);\n };\n\n _proto.updateTimers = function updateTimers() {\n this.updateStaleTimeout();\n this.updateRefetchInterval(this.computeRefetchInterval());\n };\n\n _proto.clearTimers = function clearTimers() {\n this.clearStaleTimeout();\n this.clearRefetchInterval();\n };\n\n _proto.clearStaleTimeout = function clearStaleTimeout() {\n if (this.staleTimeoutId) {\n clearTimeout(this.staleTimeoutId);\n this.staleTimeoutId = undefined;\n }\n };\n\n _proto.clearRefetchInterval = function clearRefetchInterval() {\n if (this.refetchIntervalId) {\n clearInterval(this.refetchIntervalId);\n this.refetchIntervalId = undefined;\n }\n };\n\n _proto.createResult = function createResult(query, options) {\n var prevQuery = this.currentQuery;\n var prevOptions = this.options;\n var prevResult = this.currentResult;\n var prevResultState = this.currentResultState;\n var prevResultOptions = this.currentResultOptions;\n var queryChange = query !== prevQuery;\n var queryInitialState = queryChange ? query.state : this.currentQueryInitialState;\n var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult;\n var state = query.state;\n var dataUpdatedAt = state.dataUpdatedAt,\n error = state.error,\n errorUpdatedAt = state.errorUpdatedAt,\n isFetching = state.isFetching,\n status = state.status;\n var isPreviousData = false;\n var isPlaceholderData = false;\n var data; // Optimistically set result in fetching state if needed\n\n if (options.optimisticResults) {\n var mounted = this.hasListeners();\n var fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\n if (fetchOnMount || fetchOptionally) {\n isFetching = true;\n\n if (!dataUpdatedAt) {\n status = 'loading';\n }\n }\n } // Keep previous data if needed\n\n\n if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== 'error') {\n data = prevQueryResult.data;\n dataUpdatedAt = prevQueryResult.dataUpdatedAt;\n status = prevQueryResult.status;\n isPreviousData = true;\n } // Select data if needed\n else if (options.select && typeof state.data !== 'undefined') {\n // Memoize select result\n if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) {\n data = this.selectResult;\n } else {\n try {\n this.selectFn = options.select;\n data = options.select(state.data);\n\n if (options.structuralSharing !== false) {\n data = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, data);\n }\n\n this.selectResult = data;\n this.selectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n this.selectError = selectError;\n }\n }\n } // Use query data\n else {\n data = state.data;\n } // Show placeholder data if needed\n\n\n if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && (status === 'loading' || status === 'idle')) {\n var placeholderData; // Memoize placeholder data\n\n if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData;\n\n if (options.select && typeof placeholderData !== 'undefined') {\n try {\n placeholderData = options.select(placeholderData);\n\n if (options.structuralSharing !== false) {\n placeholderData = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, placeholderData);\n }\n\n this.selectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n this.selectError = selectError;\n }\n }\n }\n\n if (typeof placeholderData !== 'undefined') {\n status = 'success';\n data = placeholderData;\n isPlaceholderData = true;\n }\n }\n\n if (this.selectError) {\n error = this.selectError;\n data = this.selectResult;\n errorUpdatedAt = Date.now();\n status = 'error';\n }\n\n var result = {\n status: status,\n isLoading: status === 'loading',\n isSuccess: status === 'success',\n isError: status === 'error',\n isIdle: status === 'idle',\n data: data,\n dataUpdatedAt: dataUpdatedAt,\n error: error,\n errorUpdatedAt: errorUpdatedAt,\n failureCount: state.fetchFailureCount,\n errorUpdateCount: state.errorUpdateCount,\n isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,\n isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching: isFetching,\n isRefetching: isFetching && status !== 'loading',\n isLoadingError: status === 'error' && state.dataUpdatedAt === 0,\n isPlaceholderData: isPlaceholderData,\n isPreviousData: isPreviousData,\n isRefetchError: status === 'error' && state.dataUpdatedAt !== 0,\n isStale: isStale(query, options),\n refetch: this.refetch,\n remove: this.remove\n };\n return result;\n };\n\n _proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) {\n if (!prevResult) {\n return true;\n }\n\n var _this$options = this.options,\n notifyOnChangeProps = _this$options.notifyOnChangeProps,\n notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions;\n\n if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) {\n return true;\n }\n\n if (notifyOnChangeProps === 'tracked' && !this.trackedProps.length) {\n return true;\n }\n\n var includedProps = notifyOnChangeProps === 'tracked' ? this.trackedProps : notifyOnChangeProps;\n return Object.keys(result).some(function (key) {\n var typedKey = key;\n var changed = result[typedKey] !== prevResult[typedKey];\n var isIncluded = includedProps == null ? void 0 : includedProps.some(function (x) {\n return x === key;\n });\n var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function (x) {\n return x === key;\n });\n return changed && !isExcluded && (!includedProps || isIncluded);\n });\n };\n\n _proto.updateResult = function updateResult(notifyOptions) {\n var prevResult = this.currentResult;\n this.currentResult = this.createResult(this.currentQuery, this.options);\n this.currentResultState = this.currentQuery.state;\n this.currentResultOptions = this.options; // Only notify if something has changed\n\n if (shallowEqualObjects(this.currentResult, prevResult)) {\n return;\n } // Determine which callbacks to trigger\n\n\n var defaultNotifyOptions = {\n cache: true\n };\n\n if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) {\n defaultNotifyOptions.listeners = true;\n }\n\n this.notify(_extends({}, defaultNotifyOptions, notifyOptions));\n };\n\n _proto.updateQuery = function updateQuery() {\n var query = this.client.getQueryCache().build(this.client, this.options);\n\n if (query === this.currentQuery) {\n return;\n }\n\n var prevQuery = this.currentQuery;\n this.currentQuery = query;\n this.currentQueryInitialState = query.state;\n this.previousQueryResult = this.currentResult;\n\n if (this.hasListeners()) {\n prevQuery == null ? void 0 : prevQuery.removeObserver(this);\n query.addObserver(this);\n }\n };\n\n _proto.onQueryUpdate = function onQueryUpdate(action) {\n var notifyOptions = {};\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = true;\n } else if (action.type === 'error' && !isCancelledError(action.error)) {\n notifyOptions.onError = true;\n }\n\n this.updateResult(notifyOptions);\n\n if (this.hasListeners()) {\n this.updateTimers();\n }\n };\n\n _proto.notify = function notify(notifyOptions) {\n var _this8 = this;\n\n notifyManager.batch(function () {\n // First trigger the configuration callbacks\n if (notifyOptions.onSuccess) {\n _this8.options.onSuccess == null ? void 0 : _this8.options.onSuccess(_this8.currentResult.data);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(_this8.currentResult.data, null);\n } else if (notifyOptions.onError) {\n _this8.options.onError == null ? void 0 : _this8.options.onError(_this8.currentResult.error);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(undefined, _this8.currentResult.error);\n } // Then trigger the listeners\n\n\n if (notifyOptions.listeners) {\n _this8.listeners.forEach(function (listener) {\n listener(_this8.currentResult);\n });\n } // Then the cache listeners\n\n\n if (notifyOptions.cache) {\n _this8.client.getQueryCache().notify({\n query: _this8.currentQuery,\n type: 'observerResultsUpdated'\n });\n }\n });\n };\n\n return QueryObserver;\n}(Subscribable);\n\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false);\n}\n\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n var value = typeof field === 'function' ? field(query) : field;\n return value === 'always' || value !== false && isStale(query, options);\n }\n\n return false;\n}\n\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error') && isStale(query, options);\n}\n\nfunction isStale(query, options) {\n return query.isStaleByTime(options.staleTime);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { getDefaultState } from './mutation';\nimport { notifyManager } from './notifyManager';\nimport { Subscribable } from './subscribable';\n// CLASS\nexport var MutationObserver = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(MutationObserver, _Subscribable);\n\n function MutationObserver(client, options) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.client = client;\n\n _this.setOptions(options);\n\n _this.bindMethods();\n\n _this.updateResult();\n\n return _this;\n }\n\n var _proto = MutationObserver.prototype;\n\n _proto.bindMethods = function bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n };\n\n _proto.setOptions = function setOptions(options) {\n this.options = this.client.defaultMutationOptions(options);\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.listeners.length) {\n var _this$currentMutation;\n\n (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.removeObserver(this);\n }\n };\n\n _proto.onMutationUpdate = function onMutationUpdate(action) {\n this.updateResult(); // Determine which callbacks to trigger\n\n var notifyOptions = {\n listeners: true\n };\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = true;\n } else if (action.type === 'error') {\n notifyOptions.onError = true;\n }\n\n this.notify(notifyOptions);\n };\n\n _proto.getCurrentResult = function getCurrentResult() {\n return this.currentResult;\n };\n\n _proto.reset = function reset() {\n this.currentMutation = undefined;\n this.updateResult();\n this.notify({\n listeners: true\n });\n };\n\n _proto.mutate = function mutate(variables, options) {\n this.mutateOptions = options;\n\n if (this.currentMutation) {\n this.currentMutation.removeObserver(this);\n }\n\n this.currentMutation = this.client.getMutationCache().build(this.client, _extends({}, this.options, {\n variables: typeof variables !== 'undefined' ? variables : this.options.variables\n }));\n this.currentMutation.addObserver(this);\n return this.currentMutation.execute();\n };\n\n _proto.updateResult = function updateResult() {\n var state = this.currentMutation ? this.currentMutation.state : getDefaultState();\n\n var result = _extends({}, state, {\n isLoading: state.status === 'loading',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset\n });\n\n this.currentResult = result;\n };\n\n _proto.notify = function notify(options) {\n var _this2 = this;\n\n notifyManager.batch(function () {\n // First trigger the mutate callbacks\n if (_this2.mutateOptions) {\n if (options.onSuccess) {\n _this2.mutateOptions.onSuccess == null ? void 0 : _this2.mutateOptions.onSuccess(_this2.currentResult.data, _this2.currentResult.variables, _this2.currentResult.context);\n _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(_this2.currentResult.data, null, _this2.currentResult.variables, _this2.currentResult.context);\n } else if (options.onError) {\n _this2.mutateOptions.onError == null ? void 0 : _this2.mutateOptions.onError(_this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context);\n _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(undefined, _this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context);\n }\n } // Then trigger the listeners\n\n\n if (options.listeners) {\n _this2.listeners.forEach(function (listener) {\n listener(_this2.currentResult);\n });\n }\n });\n };\n\n return MutationObserver;\n}(Subscribable);","import ReactDOM from 'react-dom';\nexport var unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates;","import { notifyManager } from '../core';\nimport { unstable_batchedUpdates } from './reactBatchedUpdates';\nnotifyManager.setBatchNotifyFunction(unstable_batchedUpdates);","export var logger = console;","import { setLogger } from '../core';\nimport { logger } from './logger';\nsetLogger(logger);","import React from 'react';\nvar defaultContext = /*#__PURE__*/React.createContext(undefined);\nvar QueryClientSharingContext = /*#__PURE__*/React.createContext(false); // if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\n\nfunction getQueryClientContext(contextSharing) {\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext;\n }\n\n return window.ReactQueryClientContext;\n }\n\n return defaultContext;\n}\n\nexport var useQueryClient = function useQueryClient() {\n var queryClient = React.useContext(getQueryClientContext(React.useContext(QueryClientSharingContext)));\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one');\n }\n\n return queryClient;\n};\nexport var QueryClientProvider = function QueryClientProvider(_ref) {\n var client = _ref.client,\n _ref$contextSharing = _ref.contextSharing,\n contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing,\n children = _ref.children;\n React.useEffect(function () {\n client.mount();\n return function () {\n client.unmount();\n };\n }, [client]);\n var Context = getQueryClientContext(contextSharing);\n return /*#__PURE__*/React.createElement(QueryClientSharingContext.Provider, {\n value: contextSharing\n }, /*#__PURE__*/React.createElement(Context.Provider, {\n value: client\n }, children));\n};","import React from 'react'; // CONTEXT\n\nfunction createValue() {\n var _isReset = false;\n return {\n clearReset: function clearReset() {\n _isReset = false;\n },\n reset: function reset() {\n _isReset = true;\n },\n isReset: function isReset() {\n return _isReset;\n }\n };\n}\n\nvar QueryErrorResetBoundaryContext = /*#__PURE__*/React.createContext(createValue()); // HOOK\n\nexport var useQueryErrorResetBoundary = function useQueryErrorResetBoundary() {\n return React.useContext(QueryErrorResetBoundaryContext);\n}; // COMPONENT\n\nexport var QueryErrorResetBoundary = function QueryErrorResetBoundary(_ref) {\n var children = _ref.children;\n var value = React.useMemo(function () {\n return createValue();\n }, []);\n return /*#__PURE__*/React.createElement(QueryErrorResetBoundaryContext.Provider, {\n value: value\n }, typeof children === 'function' ? children(value) : children);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { notifyManager } from '../core/notifyManager';\nimport { noop, parseMutationArgs } from '../core/utils';\nimport { MutationObserver } from '../core/mutationObserver';\nimport { useQueryClient } from './QueryClientProvider';\nimport { shouldThrowError } from './utils'; // HOOK\n\nexport function useMutation(arg1, arg2, arg3) {\n var mountedRef = React.useRef(false);\n\n var _React$useState = React.useState(0),\n forceUpdate = _React$useState[1];\n\n var options = parseMutationArgs(arg1, arg2, arg3);\n var queryClient = useQueryClient();\n var obsRef = React.useRef();\n\n if (!obsRef.current) {\n obsRef.current = new MutationObserver(queryClient, options);\n } else {\n obsRef.current.setOptions(options);\n }\n\n var currentResult = obsRef.current.getCurrentResult();\n React.useEffect(function () {\n mountedRef.current = true;\n var unsubscribe = obsRef.current.subscribe(notifyManager.batchCalls(function () {\n if (mountedRef.current) {\n forceUpdate(function (x) {\n return x + 1;\n });\n }\n }));\n return function () {\n mountedRef.current = false;\n unsubscribe();\n };\n }, []);\n var mutate = React.useCallback(function (variables, mutateOptions) {\n obsRef.current.mutate(variables, mutateOptions).catch(noop);\n }, []);\n\n if (currentResult.error && shouldThrowError(undefined, obsRef.current.options.useErrorBoundary, [currentResult.error])) {\n throw currentResult.error;\n }\n\n return _extends({}, currentResult, {\n mutate: mutate,\n mutateAsync: currentResult.mutate\n });\n}","export function shouldThrowError(suspense, _useErrorBoundary, params) {\n // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n if (typeof _useErrorBoundary === 'function') {\n return _useErrorBoundary.apply(void 0, params);\n } // Allow useErrorBoundary to override suspense's throwing behavior\n\n\n if (typeof _useErrorBoundary === 'boolean') return _useErrorBoundary; // If suspense is enabled default to throwing errors\n\n return !!suspense;\n}","import React from 'react';\nimport { notifyManager } from '../core/notifyManager';\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary';\nimport { useQueryClient } from './QueryClientProvider';\nimport { shouldThrowError } from './utils';\nexport function useBaseQuery(options, Observer) {\n var mountedRef = React.useRef(false);\n\n var _React$useState = React.useState(0),\n forceUpdate = _React$useState[1];\n\n var queryClient = useQueryClient();\n var errorResetBoundary = useQueryErrorResetBoundary();\n var defaultedOptions = queryClient.defaultQueryObserverOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options\n\n defaultedOptions.optimisticResults = true; // Include callbacks in batch renders\n\n if (defaultedOptions.onError) {\n defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError);\n }\n\n if (defaultedOptions.onSuccess) {\n defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess);\n }\n\n if (defaultedOptions.onSettled) {\n defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled);\n }\n\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000;\n } // Set cache time to 1 if the option has been set to 0\n // when using suspense to prevent infinite loop of fetches\n\n\n if (defaultedOptions.cacheTime === 0) {\n defaultedOptions.cacheTime = 1;\n }\n }\n\n if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n defaultedOptions.retryOnMount = false;\n }\n }\n\n var _React$useState2 = React.useState(function () {\n return new Observer(queryClient, defaultedOptions);\n }),\n observer = _React$useState2[0];\n\n var result = observer.getOptimisticResult(defaultedOptions);\n React.useEffect(function () {\n mountedRef.current = true;\n errorResetBoundary.clearReset();\n var unsubscribe = observer.subscribe(notifyManager.batchCalls(function () {\n if (mountedRef.current) {\n forceUpdate(function (x) {\n return x + 1;\n });\n }\n })); // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n\n observer.updateResult();\n return function () {\n mountedRef.current = false;\n unsubscribe();\n };\n }, [errorResetBoundary, observer]);\n React.useEffect(function () {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setOptions(defaultedOptions, {\n listeners: false\n });\n }, [defaultedOptions, observer]); // Handle suspense\n\n if (defaultedOptions.suspense && result.isLoading) {\n throw observer.fetchOptimistic(defaultedOptions).then(function (_ref) {\n var data = _ref.data;\n defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null);\n }).catch(function (error) {\n errorResetBoundary.clearReset();\n defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error);\n });\n } // Handle error boundary\n\n\n if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, [result.error, observer.getCurrentQuery()])) {\n throw result.error;\n } // Handle result property usage tracking\n\n\n if (defaultedOptions.notifyOnChangeProps === 'tracked') {\n result = observer.trackResult(result, defaultedOptions);\n }\n\n return result;\n}","import { QueryObserver } from '../core';\nimport { parseQueryArgs } from '../core/utils';\nimport { useBaseQuery } from './useBaseQuery'; // HOOK\n\nexport function useQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n return useBaseQuery(parsedOptions, QueryObserver);\n}","import axios, { AxiosRequestConfig } from \"axios\";\nimport { QueryClient } from \"react-query\";\n\nconst instance = axios.create();\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n suspense: true,\n refetchOnWindowFocus: false,\n cacheTime: Infinity,\n },\n },\n});\n\nasync function fetcher(url: string, config: AxiosRequestConfig = {}) {\n try {\n const response = await instance({\n url,\n withCredentials: true,\n ...config,\n });\n return response.data;\n } catch (error: any) {\n throw Error(error);\n }\n}\n\nexport { queryClient, fetcher, instance };","import { useMutation, useQuery, useQueryClient } from \"react-query\";\nimport { ImageTag, LibraryImage } from \"../types/types\";\nimport { fetcher } from \"@thelia/fetcher\";\n\nexport function useLibraryImage(options: {\n id?: number | null;\n limit?: number | null;\n offset?: number;\n title?: string | null;\n tagId?: number | null;\n}) {\n return useQuery(\n [\"LibraryImage\", options],\n () =>\n fetcher(`/open_api/library/image`, {\n method: \"GET\",\n params: {\n id: options.id || null,\n limit: options.limit || 5,\n offset: options.offset || 0,\n title: options.title || null,\n tagId: options.tagId || null,\n },\n }),\n {\n keepPreviousData: true,\n onSuccess: (data: LibraryImage[]) => {},\n }\n );\n}\n\nexport function useLibraryImageById(id: number | null) {\n return useQuery(\n [\"LibraryImage\", id],\n () =>\n fetcher(`/open_api/library/image`, {\n method: \"GET\",\n params: {\n id: id || null,\n },\n }),\n {\n enabled: !!id,\n }\n );\n}\n\nexport function useCreateImage() {\n const queryClient = useQueryClient();\n return useMutation<\n LibraryImage,\n {\n message: string;\n statusCode: number;\n statusText: string;\n },\n FormData\n >(\n (data) => {\n return fetcher(`/open_api/library/image`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"multipart/form-data\",\n },\n data,\n });\n },\n {\n onSuccess: (data) => {\n queryClient.setQueryData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return [...oldData, data];\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useDeleteImage() {\n const queryClient = useQueryClient();\n return useMutation(\n (id: LibraryImage[\"id\"]) => {\n return fetcher(`/open_api/library/image/${id}`, {\n method: \"DELETE\",\n });\n },\n {\n onSuccess: (_, id) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.filter((i) => i.id !== id);\n }\n\n return oldData;\n });\n },\n }\n );\n}\nexport function useUpdateImage() {\n const queryClient = useQueryClient();\n return useMutation(\n (id: LibraryImage[\"id\"]) => {\n return fetcher(`/open_api/library/image/${id}`, {\n method: \"POST\",\n });\n },\n {\n onSuccess: (data, id) => {\n queryClient.setQueryData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((i) => (i.id === id ? data : i));\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useGetTags() {\n return useQuery(\n [\"LibraryTag\"],\n () =>\n fetcher(`/open_api/library/tag`, {\n method: \"GET\",\n }),\n {\n keepPreviousData: true,\n onSuccess: (data: ImageTag[\"tag\"][]) => {},\n }\n );\n}\n\nexport function useDeleteTagAssociation() {\n const queryClient = useQueryClient();\n\n return useMutation(\n (id: ImageTag[\"tag\"][\"id\"]) => {\n return fetcher(`/open_api/library/image_tag/${id}`, {\n method: \"DELETE\",\n });\n },\n {\n onSuccess: (data, id) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((image) => {\n if (image.tags && image.tags.length) {\n return {\n ...image,\n tags: image.tags.filter(\n ({ imageTag }: { imageTag: ImageTag[\"imageTag\"] }) =>\n imageTag.id !== id\n ),\n };\n }\n return image;\n });\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useAssociateTag() {\n const queryClient = useQueryClient();\n\n return useMutation(\n (data: { imageId: number | null; tagId: number }) => {\n return fetcher(`/open_api/library/image_tag`, {\n method: \"POST\",\n data,\n });\n },\n {\n onSuccess: (data: any) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((image) => {\n if (image.id === data.imageTag.imageId) {\n return {\n ...image,\n tags: [...image.tags, data],\n };\n }\n\n return image;\n });\n }\n\n return oldData;\n });\n },\n }\n );\n}\n","import * as React from \"react\";\n\nconst SvgXmark = props => ;\n\nexport { SvgXmark as ReactComponent };","import * as React from \"react\";\n\nconst SvgTrash = props => ;\n\nexport { SvgTrash as ReactComponent };","import * as React from \"react\";\n\nconst SvgTagXmark = props => ;\n\nexport { SvgTagXmark as ReactComponent };","import {\n useAssociateTag,\n useDeleteImage,\n useDeleteTagAssociation,\n useGetTags,\n useLibraryImage,\n} from \"../utils/queries\";\nimport { ReactComponent as XMarkIcon } from \"./assets/xmark.svg\";\nimport { ReactComponent as TrashIcon } from \"./assets/trash.svg\";\nimport { ReactComponent as TagXMarkIcon } from \"./assets/tag-xmark.svg\";\nimport ReactModal from \"react-modal\";\nimport { ImageTag, LibraryImage as LibraryImageType } from \"../types/types\";\nimport { Suspense, useContext, useState } from \"react\";\nimport { IntlProvider, useIntl } from \"react-intl\";\nimport Input from \"../Input\";\nimport ErrorBoundary from \"../ErrorBoundary\";\nimport { locale, messages } from \"../utils/intl\";\nimport { QueryClientProvider } from \"react-query\";\nimport { queryClient } from \"@thelia/fetcher\";\nimport \"./Library.css\";\nimport { LocaleContext } from \"@thelia/blocks-editor\";\nimport { UploadImage } from \"../Image\";\n\nconst TagsList = ({\n currentTags,\n onUpdate,\n}: {\n currentTags: ImageTag[];\n onUpdate: Function;\n}) => {\n const { data } = useGetTags();\n\n const tags =\n data?.filter(\n (tagFromServer) =>\n !currentTags.find(\n ({ tag }: { tag: ImageTag[\"tag\"] }) => tag.id === tagFromServer.id\n )\n ) || [];\n\n return (\n
    \n {tags?.length > 0 ? (\n tags.map((tag) => (\n {\n onUpdate(tag);\n }}\n className=\"TagList__Item\"\n >\n {tag.title}\n \n ))\n ) : (\n
  • \n No tags available.\n
  • \n )}\n
\n );\n};\n\nconst TagConfigurationModal = ({\n isOpen,\n setIsOpen,\n image,\n}: {\n isOpen: boolean;\n setIsOpen: Function;\n image: LibraryImageType;\n}) => {\n const [showTags, setShowTags] = useState(false);\n\n const intl = useIntl();\n\n const deleteTagAssociation = useDeleteTagAssociation();\n const associateTag = useAssociateTag();\n\n return (\n {\n setIsOpen(false);\n }}\n className=\"Modal-Tags\"\n overlayClassName=\"Overlay\"\n >\n
\n
\n {\n setIsOpen(false);\n }}\n className=\"Modal__Header__Close\"\n >\n \n \n\n
\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_IMAGE_TAG_CONFIG\" })}{\" \"}\n {image.title}\n
\n
\n\n
\n
\n \n
\n \n {image.tags.length\n ? image.tags.map(({ tag, imageTag }: ImageTag) => (\n \n {tag.title}\n \n deleteTagAssociation.mutate(imageTag.id || 57)\n }\n >\n \n \n
\n ))\n : !associateTag.isLoading\n ? intl.formatMessage({\n id: \"BlockImage__LIBRARY_IMAGE_SELECT_TAG\",\n })\n : null}\n\n {associateTag.isLoading && (\n
\n \n \n \n
\n )}\n
\n setShowTags(!showTags)}\n disabled={\n associateTag.isLoading || deleteTagAssociation.isLoading\n }\n >\n \n \n {showTags ? (\n \n \n
\n }\n >\n {\n associateTag.mutate({\n imageId: image.id,\n tagId: selectedTag.id,\n });\n setShowTags(false);\n }}\n />\n \n ) : null}\n
\n \n \n \n \n );\n};\n\nconst TagFilterOptions = () => {\n const intl = useIntl();\n\n const { data: tags } = useGetTags();\n\n return (\n <>\n \n {tags?.map((tag) => (\n \n ))}\n \n );\n};\n\nconst TagFilter = ({ setTagId }: { setTagId: Function }) => {\n const intl = useIntl();\n\n return (\n
\n
\n \n setTagId(e.target.value)}\n >\n {intl.formatMessage({ id: \"LOADING\" })}}\n >\n \n \n \n
\n );\n};\n\nconst LibraryImage = ({\n image,\n onSelect,\n}: {\n image: LibraryImageType;\n onSelect: (value: LibraryImageType) => void;\n}) => {\n const [isTagModalOpen, setIsTagModalOpen] = useState(false);\n\n const intl = useIntl();\n\n const deleteMutation = useDeleteImage();\n const { getUrlWithPrefix } = useContext(LocaleContext);\n\n return (\n <>\n
\n
\n {image.tags?.map(({ tag }: { tag: ImageTag[\"tag\"] }) => (\n \n {tag.title}\n \n ))}\n
\n\n \n {image.title}\n\n
\n {image.title}\n onSelect(image)}\n >\n {intl.formatMessage({ id: \"CHOOSE\" })}\n \n
\n setIsTagModalOpen(true)}\n >\n \n \n deleteMutation.mutate(image.id)}\n >\n \n \n
\n
\n
\n \n \n );\n};\n\nconst LibraryContent = ({\n limit = 20,\n onSelect,\n setMode,\n}: {\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n setMode: Function;\n}) => {\n const [offset, setOffset] = useState(0);\n const [title, setTitle] = useState(\"\");\n const [tagId, setTagId] = useState();\n\n const {\n data: images = [],\n isFetching,\n isPreviousData,\n } = useLibraryImage({\n offset,\n limit,\n title,\n tagId,\n });\n\n const intl = useIntl();\n\n return (\n
\n
\n setTitle(e.target.value)}\n label={intl.formatMessage({ id: \"BlockImage__LIBRARY_MODAL_SEARCH\" })}\n icon={}\n iconAlignment=\"right\"\n />\n\n \n\n setMode(\"upload\")}\n >\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_MODAL_TITLE_UPLOAD\" })}\n \n
\n\n
\n {isFetching ? (\n
\n \n {intl.formatMessage({ id: \"BlockImage__LIBRARY_SEARCHING\" })}\n \n \n
\n ) : images.length > 0 ? (\n images?.map((image) => {\n return (\n \n );\n })\n ) : (\n
\n \n {intl.formatMessage({ id: \"BlockImage__LIBRARY_NO_CONTENT\" })}\n \n
\n )}\n
\n\n
\n setOffset((old) => Math.max(old - limit, 0))}\n disabled={offset === 0}\n >\n \n \n
\n {offset / limit + 1}\n
\n {\n if (!isPreviousData && (images?.length || 0) >= limit) {\n setOffset((old) => old + limit);\n }\n }}\n disabled={isPreviousData || (images?.length || 0) < limit}\n >\n \n \n
\n
\n );\n};\n\nfunction Library({\n isOpen,\n setIsOpen,\n limit = 20,\n onSelect,\n}: {\n isOpen: boolean;\n setIsOpen: Function;\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n}) {\n const intl = useIntl();\n\n const [mode, setMode] = useState<\"upload\" | \"library\">(\"library\");\n\n return (\n setIsOpen(false)}\n className={mode === \"upload\" ? \"Modal-Upload\" : \"Modal-Library\"}\n ariaHideApp={false}\n overlayClassName=\"Overlay\"\n >\n
\n
\n setIsOpen(false)}\n className=\"Modal__Header__Close\"\n >\n \n \n\n
\n {mode === \"upload\" ? (\n \n ) : null}\n {mode === \"library\"\n ? intl.formatMessage({ id: \"BlockImage__LIBRARY_MODAL_TITLE\" })\n : intl.formatMessage({\n id: \"BlockImage__LIBRARY_MODAL_TITLE_UPLOAD\",\n })}\n
\n
\n\n
\n {mode === \"library\" ? (\n \n \n {intl.formatMessage({ id: \"BlockImage__LIBRARY_LOADING\" })}\n \n \n
\n }\n >\n \n \n \n \n ) : (\n \n )}\n
\n \n \n );\n}\n\nexport default function WrappedComponent(props: {\n isOpen: boolean;\n setIsOpen: Function;\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n}) {\n return (\n \n \n \n \n
\n );\n}\n","import {\n ChangeEvent,\n FocusEvent,\n forwardRef,\n InputHTMLAttributes,\n ReactNode,\n Ref,\n} from \"react\";\nimport InputWrapper from \"./InputWrapper\";\n\nconst InputIcon = ({\n icon,\n alignment = \"left\",\n}: {\n icon: ReactNode;\n alignment?: \"left\" | \"right\";\n}) => {\n return (\n \n {icon}\n \n );\n};\n\nconst Input = forwardRef(\n (\n {\n value,\n onChange,\n className = \"\",\n emphasize,\n placeholder,\n icon,\n iconAlignment = \"left\",\n type = \"text\",\n isValid,\n label,\n id,\n info,\n error,\n ...props\n }: {\n value: string;\n onChange: (event: ChangeEvent) => void;\n className?: string;\n emphasize?: boolean;\n placeholder?: string;\n icon?: ReactNode;\n iconAlignment?: \"left\" | \"right\";\n type?: \"text\" | \"password\" | \"email\";\n isValid?: boolean;\n label?: string;\n id: string;\n info?: ReactNode;\n error?: string;\n } & InputHTMLAttributes,\n ref: Ref\n ) => {\n return (\n \n
\n \n\n {icon && }\n\n {icon && isValid && iconAlignment === \"left\" && (\n }\n />\n )}\n
\n
\n );\n }\n);\n\nexport default Input;\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nexport default function getBoundingClientRect(element, includeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n var offsetHeight = element.offsetHeight;\n var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n\n if (offsetWidth > 0) {\n scaleX = round(rect.width) / offsetWidth || 1;\n }\n\n if (offsetHeight > 0) {\n scaleY = round(rect.height) / offsetHeight || 1;\n }\n }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","export const ROUND_ARROW =\n '';\n\nexport const BOX_CLASS = `__NAMESPACE_PREFIX__-box`;\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`;\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`;\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`;\nexport const SVG_ARROW_CLASS = `__NAMESPACE_PREFIX__-svg-arrow`;\n\nexport const TOUCH_OPTIONS = {passive: true, capture: true};\n\nexport const TIPPY_DEFAULT_APPEND_TO = () => document.body;\n","import {BasePlacement, Placement} from './types';\n\nexport function hasOwnProperty(\n obj: Record,\n key: string\n): boolean {\n return {}.hasOwnProperty.call(obj, key);\n}\n\nexport function getValueAtIndexOrReturn(\n value: T | [T | null, T | null],\n index: number,\n defaultValue: T | [T, T]\n): T {\n if (Array.isArray(value)) {\n const v = value[index];\n return v == null\n ? Array.isArray(defaultValue)\n ? defaultValue[index]\n : defaultValue\n : v;\n }\n\n return value;\n}\n\nexport function isType(value: any, type: string): boolean {\n const str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(`${type}]`) > -1;\n}\n\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value(...args) : value;\n}\n\nexport function debounce(\n fn: (arg: T) => void,\n ms: number\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n let timeout: any;\n\n return (arg): void => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(arg);\n }, ms);\n };\n}\n\nexport function removeProperties(obj: T, keys: string[]): Partial {\n const clone = {...obj};\n keys.forEach((key) => {\n delete (clone as any)[key];\n });\n return clone;\n}\n\nexport function splitBySpaces(value: string): string[] {\n return value.split(/\\s+/).filter(Boolean);\n}\n\nexport function normalizeToArray(value: T | T[]): T[] {\n return ([] as T[]).concat(value);\n}\n\nexport function pushIfUnique(arr: T[], value: T): void {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\n\nexport function appendPxIfNumber(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport function unique(arr: T[]): T[] {\n return arr.filter((item, index) => arr.indexOf(item) === index);\n}\n\nexport function getNumber(value: string | number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\nexport function getBasePlacement(placement: Placement): BasePlacement {\n return placement.split('-')[0] as BasePlacement;\n}\n\nexport function arrayFrom(value: ArrayLike): any[] {\n return [].slice.call(value);\n}\n\nexport function removeUndefinedProps(\n obj: Record\n): Partial> {\n return Object.keys(obj).reduce((acc, key) => {\n if (obj[key] !== undefined) {\n (acc as any)[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n","import {ReferenceElement, Targets} from './types';\nimport {PopperTreeData} from './types-internal';\nimport {arrayFrom, isType, normalizeToArray, getBasePlacement} from './utils';\n\nexport function div(): HTMLDivElement {\n return document.createElement('div');\n}\n\nexport function isElement(value: unknown): value is Element | DocumentFragment {\n return ['Element', 'Fragment'].some((type) => isType(value, type));\n}\n\nexport function isNodeList(value: unknown): value is NodeList {\n return isType(value, 'NodeList');\n}\n\nexport function isMouseEvent(value: unknown): value is MouseEvent {\n return isType(value, 'MouseEvent');\n}\n\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\n\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\n\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number\n): void {\n els.forEach((el) => {\n if (el) {\n el.style.transitionDuration = `${value}ms`;\n }\n });\n}\n\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden'\n): void {\n els.forEach((el) => {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n\nexport function getOwnerDocument(\n elementOrElements: Element | Element[]\n): Document {\n const [element] = normalizeToArray(elementOrElements);\n\n // Elements created via a