react-files-preview
Advanced tools
Comparing version 1.0.3 to 1.0.4
import P, { useState as We, useEffect as re } from "react"; | ||
import { useSelector as D, useDispatch as pe, Provider as Et } from "react-redux"; | ||
import { createSlice as _t, configureStore as St } from "@reduxjs/toolkit"; | ||
import { useSelector as D, useDispatch as pe } from "react-redux"; | ||
import { createSlice as Et } from "@reduxjs/toolkit"; | ||
var me = { exports: {} }, U = {}; | ||
@@ -15,3 +15,3 @@ /** | ||
var Ae; | ||
function Ct() { | ||
function _t() { | ||
if (Ae) | ||
@@ -44,9 +44,9 @@ return U; | ||
var He; | ||
function Nt() { | ||
function St() { | ||
return He || (He = 1, process.env.NODE_ENV !== "production" && function() { | ||
var t = P, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), x = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), Z = Symbol.iterator, H = "@@iterator"; | ||
var t = P, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), x = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), $ = Symbol.iterator, H = "@@iterator"; | ||
function q(e) { | ||
if (e === null || typeof e != "object") | ||
return null; | ||
var r = Z && e[Z] || e[H]; | ||
var r = $ && e[$] || e[H]; | ||
return typeof r == "function" ? r : null; | ||
@@ -285,3 +285,3 @@ } | ||
} | ||
var $ = e ? e.displayName || e.name : "", Ie = $ ? K($) : ""; | ||
var Z = e ? e.displayName || e.name : "", Ie = Z ? K(Z) : ""; | ||
return typeof e == "function" && X.set(e, Ie), Ie; | ||
@@ -611,4 +611,4 @@ } | ||
if (ue(T)) { | ||
for (var $ = 0; $ < T.length; $++) | ||
Me(T[$], e); | ||
for (var Z = 0; Z < T.length; Z++) | ||
Me(T[Z], e); | ||
Object.freeze && Object.freeze(T); | ||
@@ -633,5 +633,5 @@ } else | ||
} | ||
process.env.NODE_ENV === "production" ? me.exports = Ct() : me.exports = Nt(); | ||
process.env.NODE_ENV === "production" ? me.exports = _t() : me.exports = St(); | ||
var n = me.exports; | ||
const Le = ["image/jpeg", "image/jpg", "image/png"], Ue = _t({ | ||
const Le = ["image/jpeg", "image/jpg", "image/png"], Ue = Et({ | ||
name: "file", | ||
@@ -706,9 +706,10 @@ initialState: { | ||
storeFileState: Ye, | ||
storeFileData: Ot, | ||
removeFileData: Tt, | ||
getNextFile: kt, | ||
getPrevFile: Ft, | ||
appendFileData: $e, | ||
setComponentState: Pt | ||
} = Ue.actions, Dt = Ue.reducer; | ||
storeFileData: Ct, | ||
removeFileData: Nt, | ||
getNextFile: Ot, | ||
getPrevFile: Tt, | ||
appendFileData: Ze, | ||
setComponentState: kt | ||
} = Ue.actions; | ||
Ue.reducer; | ||
var qe = { | ||
@@ -720,3 +721,3 @@ color: void 0, | ||
attr: void 0 | ||
}, Ze = P.createContext && P.createContext(qe), M = globalThis && globalThis.__assign || function() { | ||
}, $e = P.createContext && P.createContext(qe), M = globalThis && globalThis.__assign || function() { | ||
return M = Object.assign || function(t) { | ||
@@ -730,3 +731,3 @@ for (var i, o = 1, l = arguments.length; o < l; o++) { | ||
}, M.apply(this, arguments); | ||
}, zt = globalThis && globalThis.__rest || function(t, i) { | ||
}, Ft = globalThis && globalThis.__rest || function(t, i) { | ||
var o = {}; | ||
@@ -749,3 +750,3 @@ for (var l in t) | ||
return function(i) { | ||
return P.createElement(Mt, M({ | ||
return P.createElement(Pt, M({ | ||
attr: M({}, t.attr) | ||
@@ -755,5 +756,5 @@ }, i), Ge(t.child)); | ||
} | ||
function Mt(t) { | ||
function Pt(t) { | ||
var i = function(o) { | ||
var l = t.attr, d = t.size, m = t.title, j = zt(t, ["attr", "size", "title"]), x = d || o.size || "1em", f; | ||
var l = t.attr, d = t.size, m = t.title, j = Ft(t, ["attr", "size", "title"]), x = d || o.size || "1em", f; | ||
return o.className && (f = o.className), t.className && (f = (f ? f + " " : "") + t.className), P.createElement("svg", M({ | ||
@@ -773,3 +774,3 @@ stroke: "currentColor", | ||
}; | ||
return Ze !== void 0 ? P.createElement(Ze.Consumer, null, function(o) { | ||
return $e !== void 0 ? P.createElement($e.Consumer, null, function(o) { | ||
return i(o); | ||
@@ -781,15 +782,15 @@ }) : i(qe); | ||
} | ||
function Vt(t) { | ||
function Dt(t) { | ||
return _({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" } }] })(t); | ||
} | ||
function It(t) { | ||
function zt(t) { | ||
return _({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" } }] })(t); | ||
} | ||
function At(t) { | ||
function Mt(t) { | ||
return _({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" } }, { tag: "path", attr: { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" } }] })(t); | ||
} | ||
function Ht(t) { | ||
function Vt(t) { | ||
return _({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" } }, { tag: "path", attr: { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" } }] })(t); | ||
} | ||
const Lt = ({ file: t, fileSrc: i }) => { | ||
const It = ({ file: t, fileSrc: i }) => { | ||
const [o, l] = We(null); | ||
@@ -820,3 +821,3 @@ re(() => { | ||
}; | ||
function $t(t) { | ||
function At(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z" } }, { tag: "path", attr: { d: "M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5z" } }] })(t); | ||
@@ -827,24 +828,24 @@ } | ||
} | ||
function Zt(t) { | ||
function Ht(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M5.523 10.424c.14-.082.293-.162.459-.238a7.878 7.878 0 0 1-.45.606c-.28.337-.498.516-.635.572a.266.266 0 0 1-.035.012.282.282 0 0 1-.026-.044c-.056-.11-.054-.216.04-.36.106-.165.319-.354.647-.548zm2.455-1.647c-.119.025-.237.05-.356.078a21.035 21.035 0 0 0 .5-1.05 11.96 11.96 0 0 0 .51.858c-.217.032-.436.07-.654.114zm2.525.939a3.888 3.888 0 0 1-.435-.41c.228.005.434.022.612.054.317.057.466.147.518.209a.095.095 0 0 1 .026.064.436.436 0 0 1-.06.2.307.307 0 0 1-.094.124.107.107 0 0 1-.069.015c-.09-.003-.258-.066-.498-.256zM8.278 4.97c-.04.244-.108.524-.2.829a4.86 4.86 0 0 1-.089-.346c-.076-.353-.087-.63-.046-.822.038-.177.11-.248.196-.283a.517.517 0 0 1 .145-.04c.013.03.028.092.032.198.005.122-.007.277-.038.465z" } }, { tag: "path", attr: { fillRule: "evenodd", d: "M4 0h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm.165 11.668c.09.18.23.343.438.419.207.075.412.04.58-.03.318-.13.635-.436.926-.786.333-.401.683-.927 1.021-1.51a11.64 11.64 0 0 1 1.997-.406c.3.383.61.713.91.95.28.22.603.403.934.417a.856.856 0 0 0 .51-.138c.155-.101.27-.247.354-.416.09-.181.145-.37.138-.563a.844.844 0 0 0-.2-.518c-.226-.27-.596-.4-.96-.465a5.76 5.76 0 0 0-1.335-.05 10.954 10.954 0 0 1-.98-1.686c.25-.66.437-1.284.52-1.794.036-.218.055-.426.048-.614a1.238 1.238 0 0 0-.127-.538.7.7 0 0 0-.477-.365c-.202-.043-.41 0-.601.077-.377.15-.576.47-.651.823-.073.34-.04.736.046 1.136.088.406.238.848.43 1.295a19.707 19.707 0 0 1-1.062 2.227 7.662 7.662 0 0 0-1.482.645c-.37.22-.699.48-.897.787-.21.326-.275.714-.08 1.103z" } }] })(t); | ||
} | ||
function Bt(t) { | ||
function Lt(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.517 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252.19.061.411.091.665.091.338 0 .624-.053.859-.158.236-.105.416-.252.539-.44.125-.189.187-.408.187-.656 0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357 2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384.125-.101.296-.152.512-.152.143 0 .266.023.37.068a.624.624 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15-.225.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.122.524.082.149.2.27.352.367.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326.505.505 0 0 1-.085.29.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.441 1.441 0 0 0-.489-.272 1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223-.25.148-.44.359-.572.632-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976.131.271.322.48.572.626.25.145.554.217.914.217.293 0 .554-.055.785-.164.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363.7.7 0 0 1-.272.25.874.874 0 0 1-.401.087.845.845 0 0 1-.478-.132.833.833 0 0 1-.299-.392 1.699 1.699 0 0 1-.102-.627v-.495Zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879l-1.327 4Z" } }] })(t); | ||
} | ||
function Wt(t) { | ||
function Zt(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-7.839 9.166v.522c0 .256-.039.47-.117.641a.861.861 0 0 1-.322.387.877.877 0 0 1-.469.126.883.883 0 0 1-.471-.126.868.868 0 0 1-.32-.386 1.55 1.55 0 0 1-.117-.642v-.522c0-.257.04-.471.117-.641a.868.868 0 0 1 .32-.387.868.868 0 0 1 .471-.129c.176 0 .332.043.469.13a.861.861 0 0 1 .322.386c.078.17.117.384.117.641Zm.803.519v-.513c0-.377-.068-.7-.205-.972a1.46 1.46 0 0 0-.589-.63c-.254-.147-.56-.22-.917-.22-.355 0-.662.073-.92.22a1.441 1.441 0 0 0-.589.627c-.136.271-.205.596-.205.975v.513c0 .375.069.7.205.973.137.271.333.48.59.627.257.144.564.216.92.216.357 0 .662-.072.916-.216.256-.147.452-.356.59-.627.136-.274.204-.598.204-.973ZM0 11.926v4h1.459c.402 0 .735-.08.999-.238a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.59-.68c-.263-.156-.598-.234-1.004-.234H0Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.141 1.141 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082H.79V12.57Zm7.422.483a1.732 1.732 0 0 0-.103.633v.495c0 .246.034.455.103.627a.834.834 0 0 0 .298.393.845.845 0 0 0 .478.131.868.868 0 0 0 .401-.088.699.699 0 0 0 .273-.248.8.8 0 0 0 .117-.364h.765v.076a1.268 1.268 0 0 1-.226.674c-.137.194-.32.345-.55.454a1.81 1.81 0 0 1-.786.164c-.36 0-.664-.072-.914-.216a1.424 1.424 0 0 1-.571-.627c-.13-.272-.194-.597-.194-.976v-.498c0-.379.066-.705.197-.978.13-.274.321-.485.571-.633.252-.149.556-.223.911-.223.219 0 .421.032.607.097.187.062.35.153.489.272a1.326 1.326 0 0 1 .466.964v.073H9.78a.85.85 0 0 0-.12-.38.7.7 0 0 0-.273-.261.802.802 0 0 0-.398-.097.814.814 0 0 0-.475.138.868.868 0 0 0-.301.398Z" } }] })(t); | ||
} | ||
function Ut(t) { | ||
function $t(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-6.839 9.688v-.522a1.54 1.54 0 0 0-.117-.641.861.861 0 0 0-.322-.387.862.862 0 0 0-.469-.129.868.868 0 0 0-.471.13.868.868 0 0 0-.32.386 1.54 1.54 0 0 0-.117.641v.522c0 .256.04.47.117.641a.868.868 0 0 0 .32.387.883.883 0 0 0 .471.126.877.877 0 0 0 .469-.126.861.861 0 0 0 .322-.386 1.55 1.55 0 0 0 .117-.642Zm.803-.516v.513c0 .375-.068.7-.205.973a1.47 1.47 0 0 1-.589.627c-.254.144-.56.216-.917.216a1.86 1.86 0 0 1-.92-.216 1.463 1.463 0 0 1-.589-.627 2.151 2.151 0 0 1-.205-.973v-.513c0-.379.069-.704.205-.975.137-.274.333-.483.59-.627.257-.147.564-.22.92-.22.357 0 .662.073.916.22.256.146.452.356.59.63.136.271.204.595.204.972ZM1 15.925v-3.999h1.459c.406 0 .741.078 1.005.235.264.156.46.382.589.68.13.296.196.655.196 1.074 0 .422-.065.784-.196 1.084-.131.301-.33.53-.595.689-.264.158-.597.237-.999.237H1Zm1.354-3.354H1.79v2.707h.563c.185 0 .346-.028.483-.082a.8.8 0 0 0 .334-.252c.088-.114.153-.254.196-.422a2.3 2.3 0 0 0 .068-.592c0-.3-.04-.552-.118-.753a.89.89 0 0 0-.354-.454c-.158-.102-.361-.152-.61-.152Zm6.756 1.116c0-.248.034-.46.103-.633a.868.868 0 0 1 .301-.398.814.814 0 0 1 .475-.138c.15 0 .283.032.398.097a.7.7 0 0 1 .273.26.85.85 0 0 1 .12.381h.765v-.073a1.33 1.33 0 0 0-.466-.964 1.44 1.44 0 0 0-.49-.272 1.836 1.836 0 0 0-.606-.097c-.355 0-.66.074-.911.223-.25.148-.44.359-.571.633-.131.273-.197.6-.197.978v.498c0 .379.065.704.194.976.13.271.321.48.571.627.25.144.555.216.914.216.293 0 .555-.054.785-.164.23-.11.414-.26.551-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.765a.8.8 0 0 1-.117.364.699.699 0 0 1-.273.248.874.874 0 0 1-.401.088.845.845 0 0 1-.478-.131.834.834 0 0 1-.298-.393 1.7 1.7 0 0 1-.103-.627v-.495Zm5.092-1.76h.894l-1.275 2.006 1.254 1.992h-.908l-.85-1.415h-.035l-.852 1.415h-.862l1.24-2.015-1.228-1.984h.932l.832 1.439h.035l.823-1.439Z" } }] })(t); | ||
} | ||
function Yt(t) { | ||
function Bt(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-4.911 9.67h-.443v-.609h.422a.688.688 0 0 0 .322-.073.558.558 0 0 0 .22-.2.505.505 0 0 0 .076-.284.49.49 0 0 0-.176-.392.652.652 0 0 0-.442-.15.74.74 0 0 0-.252.041.625.625 0 0 0-.193.112.496.496 0 0 0-.179.349H7.71c.006-.157.04-.302.102-.437.063-.135.153-.252.27-.352.117-.101.26-.18.428-.237.17-.057.364-.086.583-.088.279-.002.52.042.723.132.203.09.36.214.472.372a.91.91 0 0 1 .173.539.833.833 0 0 1-.12.478.96.96 0 0 1-.619.439v.041a1.008 1.008 0 0 1 .718.434.909.909 0 0 1 .144.521c.002.19-.037.359-.117.507a1.104 1.104 0 0 1-.329.378c-.14.101-.302.18-.486.234-.182.053-.376.08-.583.08-.3 0-.558-.051-.77-.153a1.206 1.206 0 0 1-.487-.41 1.094 1.094 0 0 1-.178-.563h.726a.457.457 0 0 0 .106.258.664.664 0 0 0 .249.179.98.98 0 0 0 .357.067.903.903 0 0 0 .384-.076.598.598 0 0 0 .252-.217.56.56 0 0 0 .088-.319.556.556 0 0 0-.334-.522.81.81 0 0 0-.372-.079ZM.706 15.925v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715v-3.999h-.8l-1.14 2.596h-.026l-1.14-2.596H0v4h.706Zm5.458-3.999h-1.6v4h.792v-1.342h.803c.287 0 .53-.058.732-.173.203-.118.357-.276.463-.475a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.475-.158-.677a1.175 1.175 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.381.574.574 0 0 1-.237.24.793.793 0 0 1-.375.082h-.66v-1.406h.66c.219 0 .39.06.513.182.123.12.184.295.184.521Z" } }] })(t); | ||
} | ||
function qt(t) { | ||
function Wt(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM.706 15.849v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715V11.85h-.8l-1.14 2.596h-.026L.805 11.85H0v3.999h.706Zm5.278-3.999h-1.6v3.999h.792v-1.342h.803c.287 0 .53-.057.732-.173.203-.117.357-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.237.241.794.794 0 0 1-.375.082h-.66V12.48h.66c.219 0 .39.06.513.181.123.122.184.296.184.522Zm1.505-.032c.266-.434.53-.867.791-1.301h1.14v2.62h.49v.638h-.49v.741h-.741v-.741H7.287v-.648c.235-.44.484-.876.747-1.31Zm-.029 1.298v.02h1.219v-2.021h-.041c-.201.318-.404.646-.607.984-.2.338-.391.677-.571 1.017Z" } }] })(t); | ||
} | ||
function Gt(t) { | ||
function Ut(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM6.472 15.29a1.176 1.176 0 0 1-.111-.449h.765a.578.578 0 0 0 .254.384c.07.049.154.087.25.114.095.028.202.041.319.041.164 0 .302-.023.413-.07a.559.559 0 0 0 .255-.193.507.507 0 0 0 .085-.29.387.387 0 0 0-.153-.326c-.101-.08-.255-.144-.462-.193l-.619-.143a1.72 1.72 0 0 1-.539-.214 1.001 1.001 0 0 1-.351-.367 1.068 1.068 0 0 1-.123-.524c0-.244.063-.457.19-.639.127-.181.303-.322.527-.422.225-.1.484-.149.777-.149.305 0 .564.05.78.152.216.102.383.239.5.41.12.17.186.359.2.566h-.75a.56.56 0 0 0-.12-.258.625.625 0 0 0-.247-.181.923.923 0 0 0-.369-.068c-.217 0-.388.05-.513.152a.472.472 0 0 0-.184.384c0 .121.048.22.143.3a.97.97 0 0 0 .405.175l.62.143c.217.05.406.12.566.211a1 1 0 0 1 .375.358c.09.148.135.335.135.56 0 .247-.063.466-.188.656a1.216 1.216 0 0 1-.539.439c-.234.105-.52.158-.858.158-.254 0-.476-.03-.665-.09a1.404 1.404 0 0 1-.478-.252 1.13 1.13 0 0 1-.29-.375Zm-2.945-3.358h-.893L1.81 13.37h-.036l-.832-1.438h-.93l1.227 1.983L0 15.931h.861l.853-1.415h.035l.85 1.415h.908L2.253 13.94l1.274-2.007Zm2.727 3.325H4.557v-3.325h-.79v4h2.487v-.675Z" } }] })(t); | ||
} | ||
function Jt(t) { | ||
function Yt(t) { | ||
return _({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { fillRule: "evenodd", d: "M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM7.86 14.841a1.13 1.13 0 0 0 .401.823c.13.108.29.192.479.252.19.061.411.091.665.091.338 0 .624-.053.858-.158.237-.105.416-.252.54-.44a1.17 1.17 0 0 0 .187-.656c0-.224-.045-.41-.135-.56a1.002 1.002 0 0 0-.375-.357 2.028 2.028 0 0 0-.565-.21l-.621-.144a.97.97 0 0 1-.405-.176.37.37 0 0 1-.143-.299c0-.156.061-.284.184-.384.125-.101.296-.152.513-.152.143 0 .266.023.37.068a.624.624 0 0 1 .245.181.56.56 0 0 1 .12.258h.75a1.093 1.093 0 0 0-.199-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.552.05-.777.15-.224.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.123.524.082.149.199.27.351.367.153.095.332.167.54.213l.618.144c.207.049.36.113.462.193a.387.387 0 0 1 .153.326.512.512 0 0 1-.085.29.558.558 0 0 1-.255.193c-.111.047-.25.07-.413.07-.117 0-.224-.013-.32-.04a.837.837 0 0 1-.249-.115.578.578 0 0 1-.255-.384h-.764Zm-3.726-2.909h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415H1.5l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Zm1.923 3.325h1.697v.674H5.266v-3.999h.791v3.325Zm7.636-3.325h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415h-.861l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Z" } }] })(t); | ||
@@ -855,3 +856,3 @@ } | ||
type: "application/pdf", | ||
icon: /* @__PURE__ */ n.jsx(Zt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Ht, { className: "text-white text-4xl" }), | ||
color: "bg-red-500" | ||
@@ -861,3 +862,3 @@ }, | ||
type: "text/csv", | ||
icon: /* @__PURE__ */ n.jsx(Bt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Lt, { className: "text-white text-4xl" }), | ||
color: "bg-emerald-600" | ||
@@ -867,3 +868,3 @@ }, | ||
type: "text/plain", | ||
icon: /* @__PURE__ */ n.jsx($t, { "data-testid": "preview-icon", className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(At, { "data-testid": "preview-icon", className: "text-white text-4xl" }), | ||
color: "bg-slate-500" | ||
@@ -873,3 +874,3 @@ }, | ||
type: "application/msword", | ||
icon: /* @__PURE__ */ n.jsx(Wt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Zt, { className: "text-white text-4xl" }), | ||
color: "bg-sky-600" | ||
@@ -879,3 +880,3 @@ }, | ||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
icon: /* @__PURE__ */ n.jsx(Ut, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx($t, { className: "text-white text-4xl" }), | ||
color: "bg-sky-600" | ||
@@ -885,3 +886,3 @@ }, | ||
type: "audio/mpeg", | ||
icon: /* @__PURE__ */ n.jsx(Yt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Bt, { className: "text-white text-4xl" }), | ||
color: "bg-cyan-500" | ||
@@ -891,3 +892,3 @@ }, | ||
type: "video/mp4", | ||
icon: /* @__PURE__ */ n.jsx(qt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Wt, { className: "text-white text-4xl" }), | ||
color: "bg-violet-500" | ||
@@ -897,3 +898,3 @@ }, | ||
type: "application/vnd.ms-excel", | ||
icon: /* @__PURE__ */ n.jsx(Gt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Ut, { className: "text-white text-4xl" }), | ||
color: "bg-emerald-600" | ||
@@ -903,6 +904,6 @@ }, | ||
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
icon: /* @__PURE__ */ n.jsx(Jt, { className: "text-white text-4xl" }), | ||
icon: /* @__PURE__ */ n.jsx(Yt, { className: "text-white text-4xl" }), | ||
color: "bg-emerald-600" | ||
} | ||
], Be = ["image/jpeg", "image/jpg", "image/png"], Kt = ({ file: t, index: i }) => { | ||
], Be = ["image/jpeg", "image/jpg", "image/png"], qt = ({ file: t, index: i }) => { | ||
const [o, l] = We(null); | ||
@@ -943,15 +944,8 @@ re(() => { | ||
), | ||
/* @__PURE__ */ n.jsx("div", { className: "h-5 w-44", children: o && /* @__PURE__ */ n.jsx(Lt, { file: t, fileSrc: o }) }) | ||
/* @__PURE__ */ n.jsx("div", { className: "h-5 w-44", children: o && /* @__PURE__ */ n.jsx(It, { file: t, fileSrc: o }) }) | ||
] }); | ||
}, Xt = St({ | ||
reducer: { | ||
file: Dt | ||
}, | ||
middleware: (t) => t({ | ||
serializableCheck: !1 | ||
}) | ||
}), Qt = () => { | ||
}, Gt = () => { | ||
const t = D((o) => o.file.fileData), i = D((o) => o.file.fileState); | ||
return /* @__PURE__ */ n.jsx("div", { className: "h-24 absolute bottom-5 right-0 left-0 flex items-center justify-center z-40", children: (i == null ? void 0 : i.index) !== null && /* @__PURE__ */ n.jsx("div", { className: "text-white z-40 self-end top-8 text-1xl", children: `${i.index + 1} of ${t == null ? void 0 : t.length}` }) }); | ||
}, er = () => { | ||
}, Jt = () => { | ||
const t = pe(), i = D((x) => x.file.fileState), o = D((x) => x.file.componentState), l = Xe.filter((x) => x.type == i.type), d = () => { | ||
@@ -970,5 +964,5 @@ t( | ||
}, m = () => { | ||
t(kt()); | ||
t(Ot()); | ||
}, j = () => { | ||
t(Ft()); | ||
t(Tt()); | ||
}; | ||
@@ -998,3 +992,3 @@ return i.zoom ? /* @__PURE__ */ n.jsxs("div", { children: [ | ||
children: [ | ||
/* @__PURE__ */ n.jsx(It, { className: "text-lg mt-1 font-extralight" }), | ||
/* @__PURE__ */ n.jsx(zt, { className: "text-lg mt-1 font-extralight" }), | ||
"Close" | ||
@@ -1011,3 +1005,3 @@ ] | ||
"data-testid": "prev-file", | ||
children: /* @__PURE__ */ n.jsx(At, {}) | ||
children: /* @__PURE__ */ n.jsx(Mt, {}) | ||
} | ||
@@ -1035,9 +1029,9 @@ ), | ||
"data-testid": "next-file", | ||
children: /* @__PURE__ */ n.jsx(Ht, {}) | ||
children: /* @__PURE__ */ n.jsx(Vt, {}) | ||
} | ||
) | ||
] }), | ||
o.showSliderCount ? /* @__PURE__ */ n.jsx(Qt, {}) : /* @__PURE__ */ n.jsx(n.Fragment, {}) | ||
o.showSliderCount ? /* @__PURE__ */ n.jsx(Gt, {}) : /* @__PURE__ */ n.jsx(n.Fragment, {}) | ||
] }) : null; | ||
}, nr = ({ | ||
}, er = ({ | ||
files: t, | ||
@@ -1057,3 +1051,3 @@ url: i, | ||
fileHeight: V, | ||
fileWidth: Z, | ||
fileWidth: $, | ||
onChange: H, | ||
@@ -1081,3 +1075,3 @@ onRemove: q, | ||
}); | ||
I(Ot({ files: [A] })); | ||
I(Ct({ files: [A] })); | ||
} | ||
@@ -1089,6 +1083,6 @@ } catch (g) { | ||
} | ||
h(), t.length > 0 && (J(t) || I($e({ files: t }))); | ||
h(), t.length > 0 && (J(t) || I(Ze({ files: t }))); | ||
}, [i, t]), re(() => { | ||
I( | ||
Pt({ | ||
kt({ | ||
downloadFile: o ?? !0, | ||
@@ -1100,63 +1094,26 @@ removeFile: l ?? !0, | ||
fileHeight: V ?? "h-32", | ||
fileWidth: Z ?? "w-44" | ||
fileWidth: $ ?? "w-44" | ||
}) | ||
); | ||
}, [o, l, d, m, V, Z, C]); | ||
}, [o, l, d, m, V, $, C]); | ||
const B = (h) => { | ||
const g = Array.from(h.target.files || []); | ||
J(g) || I($e({ files: g })); | ||
J(g) || I(Ze({ files: g })); | ||
}, ie = (h) => { | ||
I(Tt(h)), q && q(h); | ||
I(Nt(h)), q && q(h); | ||
}, le = (h) => { | ||
G && G(h); | ||
}; | ||
return w && w(z), ae.zoom ? /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(er, {}) }) : /* @__PURE__ */ n.jsx(Et, { store: Xt, children: /* @__PURE__ */ n.jsx("div", { className: "w-full mt-3", children: /* @__PURE__ */ n.jsx("div", { className: "flex flex-row max-h-2", children: /* @__PURE__ */ n.jsxs("div", { className: `${R ?? "basis-11/12"} mx-auto`, children: [ | ||
z.length > 0 ? /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between bg-gray-200 ", children: [ | ||
/* @__PURE__ */ n.jsx("div", { className: "h-10 text-sm pt-2 ml-2 font-medium", children: /* @__PURE__ */ n.jsx("span", { className: "bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300", children: `Files: ${z.length}` }) }), | ||
/* @__PURE__ */ n.jsxs( | ||
"label", | ||
{ | ||
htmlFor: "fileInput", | ||
className: "cursor-pointer py-1 px-2 mt-1 mr-2 mb-1 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700", | ||
children: [ | ||
"+ Add more", | ||
/* @__PURE__ */ n.jsx( | ||
"input", | ||
{ | ||
id: "fileInput", | ||
type: "file", | ||
onChange: (h) => { | ||
B(h), H && H(h); | ||
}, | ||
style: { display: "none" }, | ||
multiple: j, | ||
accept: x | ||
} | ||
) | ||
] | ||
} | ||
) | ||
] }) }) : /* @__PURE__ */ n.jsx(n.Fragment, {}), | ||
/* @__PURE__ */ n.jsx( | ||
"div", | ||
{ | ||
className: `${k && `overflow-auto ${k}`} flex flex-row flex-wrap gap-4 p-6 bg-stone-100 border border-gray-100 shadow dark:bg-gray-800 `, | ||
children: z.length > 0 ? z.map((h, g) => /* @__PURE__ */ n.jsxs("div", { className: "relative pb-5 group ", onClick: () => le(h), children: [ | ||
/* @__PURE__ */ n.jsx("div", { className: "ml-9", children: ne.removeFile ? /* @__PURE__ */ n.jsx( | ||
"button", | ||
{ | ||
"data-testid": "remove-file-button", | ||
onClick: () => ie(h), | ||
className: "absolute -top-1 right-0 z-10 text-black opacity-0 group-hover:opacity-100 transition-opacity", | ||
children: /* @__PURE__ */ n.jsx(Vt, {}) | ||
} | ||
) : /* @__PURE__ */ n.jsx(n.Fragment, {}) }), | ||
/* @__PURE__ */ n.jsx("div", { className: "clear-right", children: /* @__PURE__ */ n.jsx(Kt, { file: h, index: g }) }) | ||
] }, g)) : /* @__PURE__ */ n.jsxs( | ||
return w && w(z), ae.zoom ? /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(Jt, {}) }) : ( | ||
// <Provider store={store}> | ||
/* @__PURE__ */ n.jsx("div", { className: "w-full mt-3", children: /* @__PURE__ */ n.jsx("div", { className: "flex flex-row max-h-2", children: /* @__PURE__ */ n.jsxs("div", { className: `${R ?? "basis-11/12"} mx-auto`, children: [ | ||
z.length > 0 ? /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs("div", { className: "flex justify-between bg-gray-200 ", children: [ | ||
/* @__PURE__ */ n.jsx("div", { className: "h-10 text-sm pt-2 ml-2 font-medium", children: /* @__PURE__ */ n.jsx("span", { className: "bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300", children: `Files: ${z.length}` }) }), | ||
/* @__PURE__ */ n.jsxs( | ||
"label", | ||
{ | ||
htmlFor: "fileInput", | ||
className: "mx-auto cursor-pointer hover:underline flex items-center ", | ||
className: "cursor-pointer py-1 px-2 mt-1 mr-2 mb-1 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700", | ||
children: [ | ||
"Browse files", | ||
"+ Add more", | ||
/* @__PURE__ */ n.jsx( | ||
@@ -1170,5 +1127,5 @@ "input", | ||
}, | ||
multiple: j ?? !0, | ||
accept: x ?? "", | ||
style: { display: "none" } | ||
style: { display: "none" }, | ||
multiple: j, | ||
accept: x | ||
} | ||
@@ -1179,8 +1136,48 @@ ) | ||
) | ||
} | ||
) | ||
] }) }) }) }); | ||
] }) }) : /* @__PURE__ */ n.jsx(n.Fragment, {}), | ||
/* @__PURE__ */ n.jsx( | ||
"div", | ||
{ | ||
className: `${k && `overflow-auto ${k}`} flex flex-row flex-wrap gap-4 p-6 bg-stone-100 border border-gray-100 shadow dark:bg-gray-800 `, | ||
children: z.length > 0 ? z.map((h, g) => /* @__PURE__ */ n.jsxs("div", { className: "relative pb-5 group ", onClick: () => le(h), children: [ | ||
/* @__PURE__ */ n.jsx("div", { className: "ml-9", children: ne.removeFile ? /* @__PURE__ */ n.jsx( | ||
"button", | ||
{ | ||
"data-testid": "remove-file-button", | ||
onClick: () => ie(h), | ||
className: "absolute -top-1 right-0 z-10 text-black opacity-0 group-hover:opacity-100 transition-opacity", | ||
children: /* @__PURE__ */ n.jsx(Dt, {}) | ||
} | ||
) : /* @__PURE__ */ n.jsx(n.Fragment, {}) }), | ||
/* @__PURE__ */ n.jsx("div", { className: "clear-right", children: /* @__PURE__ */ n.jsx(qt, { file: h, index: g }) }) | ||
] }, g)) : /* @__PURE__ */ n.jsxs( | ||
"label", | ||
{ | ||
htmlFor: "fileInput", | ||
className: "mx-auto cursor-pointer hover:underline flex items-center ", | ||
children: [ | ||
"Browse files", | ||
/* @__PURE__ */ n.jsx( | ||
"input", | ||
{ | ||
id: "fileInput", | ||
type: "file", | ||
onChange: (h) => { | ||
B(h), H && H(h); | ||
}, | ||
multiple: j ?? !0, | ||
accept: x ?? "", | ||
style: { display: "none" } | ||
} | ||
) | ||
] | ||
} | ||
) | ||
} | ||
) | ||
] }) }) }) | ||
); | ||
}; | ||
export { | ||
nr as ReactFilesPreview | ||
er as ReactFilesPreview | ||
}; |
@@ -1,2 +0,2 @@ | ||
(function(D,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react-redux"),require("@reduxjs/toolkit")):typeof define=="function"&&define.amd?define(["exports","react","react-redux","@reduxjs/toolkit"],w):(D=typeof globalThis<"u"?globalThis:D||self,w(D.ReactFilesPreview={},D.React,D.reactRedux,D.toolkit))})(this,function(D,w,C,pe){"use strict";var ae={exports:{}},B={};/** | ||
(function(D,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("react-redux"),require("@reduxjs/toolkit")):typeof define=="function"&&define.amd?define(["exports","react","react-redux","@reduxjs/toolkit"],w):(D=typeof globalThis<"u"?globalThis:D||self,w(D.ReactFilesPreview={},D.React,D.reactRedux,D.toolkit))})(this,function(D,w,N,Ke){"use strict";var ae={exports:{}},B={};/** | ||
* @license React | ||
@@ -9,3 +9,3 @@ * react-jsx-runtime.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var ge;function Xe(){if(ge)return B;ge=1;var t=w,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function E(x,f,T){var _,O={},P=null,I=null;T!==void 0&&(P=""+T),f.key!==void 0&&(P=""+f.key),f.ref!==void 0&&(I=f.ref);for(_ in f)l.call(f,_)&&!m.hasOwnProperty(_)&&(O[_]=f[_]);if(x&&x.defaultProps)for(_ in f=x.defaultProps,f)O[_]===void 0&&(O[_]=f[_]);return{$$typeof:i,type:x,key:P,ref:I,props:O,_owner:d.current}}return B.Fragment=o,B.jsx=E,B.jsxs=E,B}var W={};/** | ||
*/var pe;function Xe(){if(pe)return B;pe=1;var t=w,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function E(x,f,C){var _,T={},P=null,I=null;C!==void 0&&(P=""+C),f.key!==void 0&&(P=""+f.key),f.ref!==void 0&&(I=f.ref);for(_ in f)l.call(f,_)&&!m.hasOwnProperty(_)&&(T[_]=f[_]);if(x&&x.defaultProps)for(_ in f=x.defaultProps,f)T[_]===void 0&&(T[_]=f[_]);return{$$typeof:i,type:x,key:P,ref:I,props:T,_owner:d.current}}return B.Fragment=o,B.jsx=E,B.jsxs=E,B}var W={};/** | ||
* @license React | ||
@@ -18,13 +18,13 @@ * react-jsx-runtime.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var xe;function Qe(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var t=w,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),x=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),U=Symbol.iterator,L="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=U&&e[U]||e[L];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];J("error",e,a)}}function J(e,r,a){{var s=k.ReactDebugCurrentFrame,v=s.getStackAddendum();v!==""&&(r+="%s",a=a.concat([v]));var p=a.map(function(u){return String(u)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var A=!1,V=!1,ne=!1,ie=!1,K=!1,Y;Y=Symbol.for("react.module.reference");function le(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===m||K||e===d||e===T||e===_||ie||e===I||A||V||ne||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===O||e.$$typeof===E||e.$$typeof===x||e.$$typeof===f||e.$$typeof===Y||e.getModuleId!==void 0))}function oe(e,r,a){var s=e.displayName;if(s)return s;var v=r.displayName||r.name||"";return v!==""?a+"("+v+")":a}function h(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case o:return"Portal";case m:return"Profiler";case d:return"StrictMode";case T:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return h(r)+".Consumer";case E:var a=e;return h(a._context)+".Provider";case f:return oe(e,e.render,"ForwardRef");case O:var s=e.displayName||null;return s!==null?s:g(e.type)||"Memo";case P:{var v=e,p=v._payload,u=v._init;try{return g(u(p))}catch{return null}}}return null}var N=Object.assign,H=0,ke,Ne,Fe,Pe,De,ze,Me;function Ve(){}Ve.__reactDisabledLog=!0;function Ct(){{if(H===0){ke=console.log,Ne=console.info,Fe=console.warn,Pe=console.error,De=console.group,ze=console.groupCollapsed,Me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function Tt(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:ke}),info:N({},e,{value:Ne}),warn:N({},e,{value:Fe}),error:N({},e,{value:Pe}),group:N({},e,{value:De}),groupCollapsed:N({},e,{value:ze}),groupEnd:N({},e,{value:Me})})}H<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var se=k.ReactCurrentDispatcher,ce;function X(e,r,a){{if(ce===void 0)try{throw Error()}catch(v){var s=v.stack.trim().match(/\n( *(at )?)/);ce=s&&s[1]||""}return` | ||
`+ce+e}}var ue=!1,Q;{var Ot=typeof WeakMap=="function"?WeakMap:Map;Q=new Ot}function Ie(e,r){if(!e||ue)return"";{var a=Q.get(e);if(a!==void 0)return a}var s;ue=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=se.current,se.current=null,Ct();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(z){s=z}Reflect.construct(e,[],u)}else{try{u.call()}catch(z){s=z}e.call(u.prototype)}}else{try{throw Error()}catch(z){s=z}e()}}catch(z){if(z&&s&&typeof z.stack=="string"){for(var c=z.stack.split(` | ||
*/var ge;function Qe(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&function(){var t=w,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),x=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),U=Symbol.iterator,L="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=U&&e[U]||e[L];return typeof r=="function"?r:null}var O=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];J("error",e,a)}}function J(e,r,a){{var s=O.ReactDebugCurrentFrame,v=s.getStackAddendum();v!==""&&(r+="%s",a=a.concat([v]));var p=a.map(function(u){return String(u)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var A=!1,V=!1,ne=!1,ie=!1,K=!1,Y;Y=Symbol.for("react.module.reference");function le(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===m||K||e===d||e===C||e===_||ie||e===I||A||V||ne||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===T||e.$$typeof===E||e.$$typeof===x||e.$$typeof===f||e.$$typeof===Y||e.getModuleId!==void 0))}function oe(e,r,a){var s=e.displayName;if(s)return s;var v=r.displayName||r.name||"";return v!==""?a+"("+v+")":a}function h(e){return e.displayName||"Context"}function g(e){if(e==null)return null;if(typeof e.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case o:return"Portal";case m:return"Profiler";case d:return"StrictMode";case C:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return h(r)+".Consumer";case E:var a=e;return h(a._context)+".Provider";case f:return oe(e,e.render,"ForwardRef");case T:var s=e.displayName||null;return s!==null?s:g(e.type)||"Memo";case P:{var v=e,p=v._payload,u=v._init;try{return g(u(p))}catch{return null}}}return null}var k=Object.assign,H=0,Oe,ke,Ne,Fe,Pe,De,ze;function Me(){}Me.__reactDisabledLog=!0;function _t(){{if(H===0){Oe=console.log,ke=console.info,Ne=console.warn,Fe=console.error,Pe=console.group,De=console.groupCollapsed,ze=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Me,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function Rt(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:Oe}),info:k({},e,{value:ke}),warn:k({},e,{value:Ne}),error:k({},e,{value:Fe}),group:k({},e,{value:Pe}),groupCollapsed:k({},e,{value:De}),groupEnd:k({},e,{value:ze})})}H<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var se=O.ReactCurrentDispatcher,ce;function X(e,r,a){{if(ce===void 0)try{throw Error()}catch(v){var s=v.stack.trim().match(/\n( *(at )?)/);ce=s&&s[1]||""}return` | ||
`+ce+e}}var ue=!1,Q;{var Ct=typeof WeakMap=="function"?WeakMap:Map;Q=new Ct}function Ve(e,r){if(!e||ue)return"";{var a=Q.get(e);if(a!==void 0)return a}var s;ue=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=se.current,se.current=null,_t();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(z){s=z}Reflect.construct(e,[],u)}else{try{u.call()}catch(z){s=z}e.call(u.prototype)}}else{try{throw Error()}catch(z){s=z}e()}}catch(z){if(z&&s&&typeof z.stack=="string"){for(var c=z.stack.split(` | ||
`),R=s.stack.split(` | ||
`),y=c.length-1,b=R.length-1;y>=1&&b>=0&&c[y]!==R[b];)b--;for(;y>=1&&b>=0;y--,b--)if(c[y]!==R[b]){if(y!==1||b!==1)do if(y--,b--,b<0||c[y]!==R[b]){var F=` | ||
`+c[y].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&Q.set(e,F),F}while(y>=1&&b>=0);break}}}finally{ue=!1,se.current=p,Tt(),Error.prepareStackTrace=v}var Z=e?e.displayName||e.name:"",Ke=Z?X(Z):"";return typeof e=="function"&&Q.set(e,Ke),Ke}function kt(e,r,a){return Ie(e,!1)}function Nt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ee(e,r,a){if(e==null)return"";if(typeof e=="function")return Ie(e,Nt(e));if(typeof e=="string")return X(e);switch(e){case T:return X("Suspense");case _:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return kt(e.render);case O:return ee(e.type,r,a);case P:{var s=e,v=s._payload,p=s._init;try{return ee(p(v),r,a)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,Ae={},He=k.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,a=ee(e.type,e._source,r?r.type:null);He.setExtraStackFrame(a)}else He.setExtraStackFrame(null)}function Ft(e,r,a,s,v){{var p=Function.call.bind(te);for(var u in e)if(p(e,u)){var c=void 0;try{if(typeof e[u]!="function"){var R=Error((s||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}c=e[u](r,u,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){c=y}c&&!(c instanceof Error)&&(re(v),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",a,u,typeof c),re(null)),c instanceof Error&&!(c.message in Ae)&&(Ae[c.message]=!0,re(v),j("Failed %s type: %s",a,c.message),re(null))}}}var Pt=Array.isArray;function fe(e){return Pt(e)}function Dt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function zt(e){try{return Le(e),!1}catch{return!0}}function Le(e){return""+e}function $e(e){if(zt(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt(e)),Le(e)}var q=k.ReactCurrentOwner,Mt={key:!0,ref:!0,__self:!0,__source:!0},Ze,Be,de;de={};function Vt(e){if(te.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function It(e){if(te.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function At(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var a=g(q.current.type);de[a]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',g(q.current.type),e.ref),de[a]=!0)}}function Ht(e,r){{var a=function(){Ze||(Ze=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Lt(e,r){{var a=function(){Be||(Be=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var $t=function(e,r,a,s,v,p,u){var c={$$typeof:i,type:e,key:r,ref:a,props:u,_owner:p};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function Zt(e,r,a,s,v){{var p,u={},c=null,R=null;a!==void 0&&($e(a),c=""+a),It(r)&&($e(r.key),c=""+r.key),Vt(r)&&(R=r.ref,At(r,v));for(p in r)te.call(r,p)&&!Mt.hasOwnProperty(p)&&(u[p]=r[p]);if(e&&e.defaultProps){var y=e.defaultProps;for(p in y)u[p]===void 0&&(u[p]=y[p])}if(c||R){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&Ht(u,b),R&&Lt(u,b)}return $t(e,c,R,v,s,q.current,u)}}var he=k.ReactCurrentOwner,We=k.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,a=ee(e.type,e._source,r?r.type:null);We.setExtraStackFrame(a)}else We.setExtraStackFrame(null)}var ve;ve=!1;function me(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function Ue(){{if(he.current){var e=g(he.current.type);if(e)return` | ||
`+c[y].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&Q.set(e,F),F}while(y>=1&&b>=0);break}}}finally{ue=!1,se.current=p,Rt(),Error.prepareStackTrace=v}var $=e?e.displayName||e.name:"",Je=$?X($):"";return typeof e=="function"&&Q.set(e,Je),Je}function Tt(e,r,a){return Ve(e,!1)}function Ot(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ee(e,r,a){if(e==null)return"";if(typeof e=="function")return Ve(e,Ot(e));if(typeof e=="string")return X(e);switch(e){case C:return X("Suspense");case _:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Tt(e.render);case T:return ee(e.type,r,a);case P:{var s=e,v=s._payload,p=s._init;try{return ee(p(v),r,a)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,Ie={},Ae=O.ReactDebugCurrentFrame;function re(e){if(e){var r=e._owner,a=ee(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(a)}else Ae.setExtraStackFrame(null)}function kt(e,r,a,s,v){{var p=Function.call.bind(te);for(var u in e)if(p(e,u)){var c=void 0;try{if(typeof e[u]!="function"){var R=Error((s||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}c=e[u](r,u,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){c=y}c&&!(c instanceof Error)&&(re(v),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",a,u,typeof c),re(null)),c instanceof Error&&!(c.message in Ie)&&(Ie[c.message]=!0,re(v),j("Failed %s type: %s",a,c.message),re(null))}}}var Nt=Array.isArray;function fe(e){return Nt(e)}function Ft(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Pt(e){try{return He(e),!1}catch{return!0}}function He(e){return""+e}function Le(e){if(Pt(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ft(e)),He(e)}var q=O.ReactCurrentOwner,Dt={key:!0,ref:!0,__self:!0,__source:!0},Ze,$e,de;de={};function zt(e){if(te.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Mt(e){if(te.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Vt(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var a=g(q.current.type);de[a]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',g(q.current.type),e.ref),de[a]=!0)}}function It(e,r){{var a=function(){Ze||(Ze=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function At(e,r){{var a=function(){$e||($e=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Ht=function(e,r,a,s,v,p,u){var c={$$typeof:i,type:e,key:r,ref:a,props:u,_owner:p};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function Lt(e,r,a,s,v){{var p,u={},c=null,R=null;a!==void 0&&(Le(a),c=""+a),Mt(r)&&(Le(r.key),c=""+r.key),zt(r)&&(R=r.ref,Vt(r,v));for(p in r)te.call(r,p)&&!Dt.hasOwnProperty(p)&&(u[p]=r[p]);if(e&&e.defaultProps){var y=e.defaultProps;for(p in y)u[p]===void 0&&(u[p]=y[p])}if(c||R){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&It(u,b),R&&At(u,b)}return Ht(e,c,R,v,s,q.current,u)}}var he=O.ReactCurrentOwner,Be=O.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,a=ee(e.type,e._source,r?r.type:null);Be.setExtraStackFrame(a)}else Be.setExtraStackFrame(null)}var ve;ve=!1;function me(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function We(){{if(he.current){var e=g(he.current.type);if(e)return` | ||
Check the render method of \``+e+"`."}return""}}function Bt(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return` | ||
Check the render method of \``+e+"`."}return""}}function Zt(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return` | ||
Check your code at `+r+":"+a+"."}return""}}var Ye={};function Wt(e){{var r=Ue();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=` | ||
Check your code at `+r+":"+a+"."}return""}}var Ue={};function $t(e){{var r=We();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=` | ||
Check the top-level render call using <`+a+">.")}return r}}function qe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Wt(r);if(Ye[a])return;Ye[a]=!0;var s="";e&&e._owner&&e._owner!==he.current&&(s=" It was passed a child from "+g(e._owner.type)+"."),$(e),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,s),$(null)}}function Ge(e,r){{if(typeof e!="object")return;if(fe(e))for(var a=0;a<e.length;a++){var s=e[a];me(s)&&qe(s,r)}else if(me(e))e._store&&(e._store.validated=!0);else if(e){var v=G(e);if(typeof v=="function"&&v!==e.entries)for(var p=v.call(e),u;!(u=p.next()).done;)me(u.value)&&qe(u.value,r)}}}function Ut(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===O))a=r.propTypes;else return;if(a){var s=g(r);Ft(a,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ve){ve=!0;var v=g(r);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yt(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var s=r[a];if(s!=="children"&&s!=="key"){$(e),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),$(null);break}}e.ref!==null&&($(e),j("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}function Je(e,r,a,s,v,p){{var u=le(e);if(!u){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=Bt(v);R?c+=R:c+=Ue();var y;e===null?y="null":fe(e)?y="array":e!==void 0&&e.$$typeof===i?(y="<"+(g(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,c)}var b=Zt(e,r,a,v,p);if(b==null)return b;if(u){var F=r.children;if(F!==void 0)if(s)if(fe(F)){for(var Z=0;Z<F.length;Z++)Ge(F[Z],e);Object.freeze&&Object.freeze(F)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ge(F,e)}return e===l?Yt(b):Ut(b),b}}function qt(e,r,a){return Je(e,r,a,!0)}function Gt(e,r,a){return Je(e,r,a,!1)}var Jt=Gt,Kt=qt;W.Fragment=l,W.jsx=Jt,W.jsxs=Kt}()),W}process.env.NODE_ENV==="production"?ae.exports=Xe():ae.exports=Qe();var n=ae.exports;const ye=["image/jpeg","image/jpg","image/png"],be=pe.createSlice({name:"file",initialState:{fileData:[],fileState:{zoom:!1,fileSrc:null,index:0,isImage:!1,fileName:null,type:null,size:0},componentState:{showFileSize:!1,showSliderCount:!0,downloadFile:!0,removeFile:!0,rounded:!0,fileHeight:"h-32",fileWidth:"w-44"}},reducers:{storeFileData(t,i){const{files:o}=i.payload;t.fileData=o},setComponentState(t,i){t.componentState=i.payload},appendFileData(t,i){t.fileData=[...t.fileData,...i.payload.files]},storeFileState(t,i){t.fileState=i.payload},removeFileData(t,i){const o=i.payload;t.fileData=t.fileData.filter(l=>l.name!==o.name)},getNextFile(t){const i=t.fileState.index+1,o=t.fileData.length-1;let l=i;i>o&&(l=0),t.fileState={zoom:!0,fileSrc:URL.createObjectURL(t.fileData[l]),index:l,isImage:ye.includes(t.fileData[l].type),fileName:t.fileData[l].name,type:t.fileData[l].type,size:t.fileData[l].size}},getPrevFile(t){const i=t.fileState.index-1,o=t.fileData.length-1;let l=i;i<0&&(l=o),t.fileState={zoom:!0,fileSrc:URL.createObjectURL(t.fileData[l]),index:l,isImage:ye.includes(t.fileData[l].type),fileName:t.fileData[l].name,type:t.fileData[l].type,size:t.fileData[l].size}}}}),{storeFileState:we,storeFileData:et,removeFileData:tt,getNextFile:rt,getPrevFile:at,appendFileData:je,setComponentState:nt}=be.actions,it=be.reducer;var Ee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Se=w.createContext&&w.createContext(Ee),M=globalThis&&globalThis.__assign||function(){return M=Object.assign||function(t){for(var i,o=1,l=arguments.length;o<l;o++){i=arguments[o];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(t[d]=i[d])}return t},M.apply(this,arguments)},lt=globalThis&&globalThis.__rest||function(t,i){var o={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&i.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,l=Object.getOwnPropertySymbols(t);d<l.length;d++)i.indexOf(l[d])<0&&Object.prototype.propertyIsEnumerable.call(t,l[d])&&(o[l[d]]=t[l[d]]);return o};function _e(t){return t&&t.map(function(i,o){return w.createElement(i.tag,M({key:o},i.attr),_e(i.child))})}function S(t){return function(i){return w.createElement(ot,M({attr:M({},t.attr)},i),_e(t.child))}}function ot(t){var i=function(o){var l=t.attr,d=t.size,m=t.title,E=lt(t,["attr","size","title"]),x=d||o.size||"1em",f;return o.className&&(f=o.className),t.className&&(f=(f?f+" ":"")+t.className),w.createElement("svg",M({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,l,E,{className:f,style:M(M({color:t.color||o.color},o.style),t.style),height:x,width:x,xmlns:"http://www.w3.org/2000/svg"}),m&&w.createElement("title",null,m),t.children)};return Se!==void 0?w.createElement(Se.Consumer,null,function(o){return i(o)}):i(Ee)}function Re(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(t)}function st(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(t)}function ct(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(t)}function ut(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}}]})(t)}function ft(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}]})(t)}const dt=({file:t,fileSrc:i})=>{const[o,l]=w.useState(null);w.useEffect(()=>{t.size<1e6?l(Math.floor(t.size/1e3)+" KB"):l(Math.floor(t.size/1e6)+" MB")},[t.size]);const d=t.name.split(".");let m=d[0];const E=d.pop();m.length>20&&(m=m.substring(0,5)+".."+m.substring(m.length-3,m.length));const x=m+"."+E,f=C.useSelector(T=>T.file.componentState);return n.jsxs("div",{className:"relative ",children:[n.jsx("h5",{className:"text-[12px] mt-1 font-normal break-words dark:text-white",children:x}),f.showFileSize&&n.jsx("span",{"data-testid":"file-size",className:"text-[10px] dark:text-white",children:o}),f.downloadFile&&i&&n.jsx("a",{className:"float-right absolute top-1 right-0 text-gray-500 dark:text-white",href:i,target:"_blank",download:!0,rel:"noreferrer",children:n.jsx(Re,{})})]})};function ht(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z"}},{tag:"path",attr:{d:"M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5z"}}]})(t)}function Ce(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.5 4.5a.5.5 0 0 0-1 0v.634l-.549-.317a.5.5 0 1 0-.5.866L7 6l-.549.317a.5.5 0 1 0 .5.866l.549-.317V7.5a.5.5 0 1 0 1 0v-.634l.549.317a.5.5 0 1 0 .5-.866L9 6l.549-.317a.5.5 0 1 0-.5-.866l-.549.317V4.5zM5.5 9a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zm0 2a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5z"}},{tag:"path",attr:{d:"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"}}]})(t)}function vt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.523 10.424c.14-.082.293-.162.459-.238a7.878 7.878 0 0 1-.45.606c-.28.337-.498.516-.635.572a.266.266 0 0 1-.035.012.282.282 0 0 1-.026-.044c-.056-.11-.054-.216.04-.36.106-.165.319-.354.647-.548zm2.455-1.647c-.119.025-.237.05-.356.078a21.035 21.035 0 0 0 .5-1.05 11.96 11.96 0 0 0 .51.858c-.217.032-.436.07-.654.114zm2.525.939a3.888 3.888 0 0 1-.435-.41c.228.005.434.022.612.054.317.057.466.147.518.209a.095.095 0 0 1 .026.064.436.436 0 0 1-.06.2.307.307 0 0 1-.094.124.107.107 0 0 1-.069.015c-.09-.003-.258-.066-.498-.256zM8.278 4.97c-.04.244-.108.524-.2.829a4.86 4.86 0 0 1-.089-.346c-.076-.353-.087-.63-.046-.822.038-.177.11-.248.196-.283a.517.517 0 0 1 .145-.04c.013.03.028.092.032.198.005.122-.007.277-.038.465z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M4 0h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm.165 11.668c.09.18.23.343.438.419.207.075.412.04.58-.03.318-.13.635-.436.926-.786.333-.401.683-.927 1.021-1.51a11.64 11.64 0 0 1 1.997-.406c.3.383.61.713.91.95.28.22.603.403.934.417a.856.856 0 0 0 .51-.138c.155-.101.27-.247.354-.416.09-.181.145-.37.138-.563a.844.844 0 0 0-.2-.518c-.226-.27-.596-.4-.96-.465a5.76 5.76 0 0 0-1.335-.05 10.954 10.954 0 0 1-.98-1.686c.25-.66.437-1.284.52-1.794.036-.218.055-.426.048-.614a1.238 1.238 0 0 0-.127-.538.7.7 0 0 0-.477-.365c-.202-.043-.41 0-.601.077-.377.15-.576.47-.651.823-.073.34-.04.736.046 1.136.088.406.238.848.43 1.295a19.707 19.707 0 0 1-1.062 2.227 7.662 7.662 0 0 0-1.482.645c-.37.22-.699.48-.897.787-.21.326-.275.714-.08 1.103z"}}]})(t)}function mt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.517 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252.19.061.411.091.665.091.338 0 .624-.053.859-.158.236-.105.416-.252.539-.44.125-.189.187-.408.187-.656 0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357 2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384.125-.101.296-.152.512-.152.143 0 .266.023.37.068a.624.624 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15-.225.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.122.524.082.149.2.27.352.367.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326.505.505 0 0 1-.085.29.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.441 1.441 0 0 0-.489-.272 1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223-.25.148-.44.359-.572.632-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976.131.271.322.48.572.626.25.145.554.217.914.217.293 0 .554-.055.785-.164.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363.7.7 0 0 1-.272.25.874.874 0 0 1-.401.087.845.845 0 0 1-.478-.132.833.833 0 0 1-.299-.392 1.699 1.699 0 0 1-.102-.627v-.495Zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879l-1.327 4Z"}}]})(t)}function pt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-7.839 9.166v.522c0 .256-.039.47-.117.641a.861.861 0 0 1-.322.387.877.877 0 0 1-.469.126.883.883 0 0 1-.471-.126.868.868 0 0 1-.32-.386 1.55 1.55 0 0 1-.117-.642v-.522c0-.257.04-.471.117-.641a.868.868 0 0 1 .32-.387.868.868 0 0 1 .471-.129c.176 0 .332.043.469.13a.861.861 0 0 1 .322.386c.078.17.117.384.117.641Zm.803.519v-.513c0-.377-.068-.7-.205-.972a1.46 1.46 0 0 0-.589-.63c-.254-.147-.56-.22-.917-.22-.355 0-.662.073-.92.22a1.441 1.441 0 0 0-.589.627c-.136.271-.205.596-.205.975v.513c0 .375.069.7.205.973.137.271.333.48.59.627.257.144.564.216.92.216.357 0 .662-.072.916-.216.256-.147.452-.356.59-.627.136-.274.204-.598.204-.973ZM0 11.926v4h1.459c.402 0 .735-.08.999-.238a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.59-.68c-.263-.156-.598-.234-1.004-.234H0Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.141 1.141 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082H.79V12.57Zm7.422.483a1.732 1.732 0 0 0-.103.633v.495c0 .246.034.455.103.627a.834.834 0 0 0 .298.393.845.845 0 0 0 .478.131.868.868 0 0 0 .401-.088.699.699 0 0 0 .273-.248.8.8 0 0 0 .117-.364h.765v.076a1.268 1.268 0 0 1-.226.674c-.137.194-.32.345-.55.454a1.81 1.81 0 0 1-.786.164c-.36 0-.664-.072-.914-.216a1.424 1.424 0 0 1-.571-.627c-.13-.272-.194-.597-.194-.976v-.498c0-.379.066-.705.197-.978.13-.274.321-.485.571-.633.252-.149.556-.223.911-.223.219 0 .421.032.607.097.187.062.35.153.489.272a1.326 1.326 0 0 1 .466.964v.073H9.78a.85.85 0 0 0-.12-.38.7.7 0 0 0-.273-.261.802.802 0 0 0-.398-.097.814.814 0 0 0-.475.138.868.868 0 0 0-.301.398Z"}}]})(t)}function gt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-6.839 9.688v-.522a1.54 1.54 0 0 0-.117-.641.861.861 0 0 0-.322-.387.862.862 0 0 0-.469-.129.868.868 0 0 0-.471.13.868.868 0 0 0-.32.386 1.54 1.54 0 0 0-.117.641v.522c0 .256.04.47.117.641a.868.868 0 0 0 .32.387.883.883 0 0 0 .471.126.877.877 0 0 0 .469-.126.861.861 0 0 0 .322-.386 1.55 1.55 0 0 0 .117-.642Zm.803-.516v.513c0 .375-.068.7-.205.973a1.47 1.47 0 0 1-.589.627c-.254.144-.56.216-.917.216a1.86 1.86 0 0 1-.92-.216 1.463 1.463 0 0 1-.589-.627 2.151 2.151 0 0 1-.205-.973v-.513c0-.379.069-.704.205-.975.137-.274.333-.483.59-.627.257-.147.564-.22.92-.22.357 0 .662.073.916.22.256.146.452.356.59.63.136.271.204.595.204.972ZM1 15.925v-3.999h1.459c.406 0 .741.078 1.005.235.264.156.46.382.589.68.13.296.196.655.196 1.074 0 .422-.065.784-.196 1.084-.131.301-.33.53-.595.689-.264.158-.597.237-.999.237H1Zm1.354-3.354H1.79v2.707h.563c.185 0 .346-.028.483-.082a.8.8 0 0 0 .334-.252c.088-.114.153-.254.196-.422a2.3 2.3 0 0 0 .068-.592c0-.3-.04-.552-.118-.753a.89.89 0 0 0-.354-.454c-.158-.102-.361-.152-.61-.152Zm6.756 1.116c0-.248.034-.46.103-.633a.868.868 0 0 1 .301-.398.814.814 0 0 1 .475-.138c.15 0 .283.032.398.097a.7.7 0 0 1 .273.26.85.85 0 0 1 .12.381h.765v-.073a1.33 1.33 0 0 0-.466-.964 1.44 1.44 0 0 0-.49-.272 1.836 1.836 0 0 0-.606-.097c-.355 0-.66.074-.911.223-.25.148-.44.359-.571.633-.131.273-.197.6-.197.978v.498c0 .379.065.704.194.976.13.271.321.48.571.627.25.144.555.216.914.216.293 0 .555-.054.785-.164.23-.11.414-.26.551-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.765a.8.8 0 0 1-.117.364.699.699 0 0 1-.273.248.874.874 0 0 1-.401.088.845.845 0 0 1-.478-.131.834.834 0 0 1-.298-.393 1.7 1.7 0 0 1-.103-.627v-.495Zm5.092-1.76h.894l-1.275 2.006 1.254 1.992h-.908l-.85-1.415h-.035l-.852 1.415h-.862l1.24-2.015-1.228-1.984h.932l.832 1.439h.035l.823-1.439Z"}}]})(t)}function xt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-4.911 9.67h-.443v-.609h.422a.688.688 0 0 0 .322-.073.558.558 0 0 0 .22-.2.505.505 0 0 0 .076-.284.49.49 0 0 0-.176-.392.652.652 0 0 0-.442-.15.74.74 0 0 0-.252.041.625.625 0 0 0-.193.112.496.496 0 0 0-.179.349H7.71c.006-.157.04-.302.102-.437.063-.135.153-.252.27-.352.117-.101.26-.18.428-.237.17-.057.364-.086.583-.088.279-.002.52.042.723.132.203.09.36.214.472.372a.91.91 0 0 1 .173.539.833.833 0 0 1-.12.478.96.96 0 0 1-.619.439v.041a1.008 1.008 0 0 1 .718.434.909.909 0 0 1 .144.521c.002.19-.037.359-.117.507a1.104 1.104 0 0 1-.329.378c-.14.101-.302.18-.486.234-.182.053-.376.08-.583.08-.3 0-.558-.051-.77-.153a1.206 1.206 0 0 1-.487-.41 1.094 1.094 0 0 1-.178-.563h.726a.457.457 0 0 0 .106.258.664.664 0 0 0 .249.179.98.98 0 0 0 .357.067.903.903 0 0 0 .384-.076.598.598 0 0 0 .252-.217.56.56 0 0 0 .088-.319.556.556 0 0 0-.334-.522.81.81 0 0 0-.372-.079ZM.706 15.925v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715v-3.999h-.8l-1.14 2.596h-.026l-1.14-2.596H0v4h.706Zm5.458-3.999h-1.6v4h.792v-1.342h.803c.287 0 .53-.058.732-.173.203-.118.357-.276.463-.475a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.475-.158-.677a1.175 1.175 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.381.574.574 0 0 1-.237.24.793.793 0 0 1-.375.082h-.66v-1.406h.66c.219 0 .39.06.513.182.123.12.184.295.184.521Z"}}]})(t)}function yt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM.706 15.849v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715V11.85h-.8l-1.14 2.596h-.026L.805 11.85H0v3.999h.706Zm5.278-3.999h-1.6v3.999h.792v-1.342h.803c.287 0 .53-.057.732-.173.203-.117.357-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.237.241.794.794 0 0 1-.375.082h-.66V12.48h.66c.219 0 .39.06.513.181.123.122.184.296.184.522Zm1.505-.032c.266-.434.53-.867.791-1.301h1.14v2.62h.49v.638h-.49v.741h-.741v-.741H7.287v-.648c.235-.44.484-.876.747-1.31Zm-.029 1.298v.02h1.219v-2.021h-.041c-.201.318-.404.646-.607.984-.2.338-.391.677-.571 1.017Z"}}]})(t)}function bt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM6.472 15.29a1.176 1.176 0 0 1-.111-.449h.765a.578.578 0 0 0 .254.384c.07.049.154.087.25.114.095.028.202.041.319.041.164 0 .302-.023.413-.07a.559.559 0 0 0 .255-.193.507.507 0 0 0 .085-.29.387.387 0 0 0-.153-.326c-.101-.08-.255-.144-.462-.193l-.619-.143a1.72 1.72 0 0 1-.539-.214 1.001 1.001 0 0 1-.351-.367 1.068 1.068 0 0 1-.123-.524c0-.244.063-.457.19-.639.127-.181.303-.322.527-.422.225-.1.484-.149.777-.149.305 0 .564.05.78.152.216.102.383.239.5.41.12.17.186.359.2.566h-.75a.56.56 0 0 0-.12-.258.625.625 0 0 0-.247-.181.923.923 0 0 0-.369-.068c-.217 0-.388.05-.513.152a.472.472 0 0 0-.184.384c0 .121.048.22.143.3a.97.97 0 0 0 .405.175l.62.143c.217.05.406.12.566.211a1 1 0 0 1 .375.358c.09.148.135.335.135.56 0 .247-.063.466-.188.656a1.216 1.216 0 0 1-.539.439c-.234.105-.52.158-.858.158-.254 0-.476-.03-.665-.09a1.404 1.404 0 0 1-.478-.252 1.13 1.13 0 0 1-.29-.375Zm-2.945-3.358h-.893L1.81 13.37h-.036l-.832-1.438h-.93l1.227 1.983L0 15.931h.861l.853-1.415h.035l.85 1.415h.908L2.253 13.94l1.274-2.007Zm2.727 3.325H4.557v-3.325h-.79v4h2.487v-.675Z"}}]})(t)}function wt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM7.86 14.841a1.13 1.13 0 0 0 .401.823c.13.108.29.192.479.252.19.061.411.091.665.091.338 0 .624-.053.858-.158.237-.105.416-.252.54-.44a1.17 1.17 0 0 0 .187-.656c0-.224-.045-.41-.135-.56a1.002 1.002 0 0 0-.375-.357 2.028 2.028 0 0 0-.565-.21l-.621-.144a.97.97 0 0 1-.405-.176.37.37 0 0 1-.143-.299c0-.156.061-.284.184-.384.125-.101.296-.152.513-.152.143 0 .266.023.37.068a.624.624 0 0 1 .245.181.56.56 0 0 1 .12.258h.75a1.093 1.093 0 0 0-.199-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.552.05-.777.15-.224.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.123.524.082.149.199.27.351.367.153.095.332.167.54.213l.618.144c.207.049.36.113.462.193a.387.387 0 0 1 .153.326.512.512 0 0 1-.085.29.558.558 0 0 1-.255.193c-.111.047-.25.07-.413.07-.117 0-.224-.013-.32-.04a.837.837 0 0 1-.249-.115.578.578 0 0 1-.255-.384h-.764Zm-3.726-2.909h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415H1.5l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Zm1.923 3.325h1.697v.674H5.266v-3.999h.791v3.325Zm7.636-3.325h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415h-.861l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Z"}}]})(t)}const Te=[{type:"application/pdf",icon:n.jsx(vt,{className:"text-white text-4xl"}),color:"bg-red-500"},{type:"text/csv",icon:n.jsx(mt,{className:"text-white text-4xl"}),color:"bg-emerald-600"},{type:"text/plain",icon:n.jsx(ht,{"data-testid":"preview-icon",className:"text-white text-4xl"}),color:"bg-slate-500"},{type:"application/msword",icon:n.jsx(pt,{className:"text-white text-4xl"}),color:"bg-sky-600"},{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",icon:n.jsx(gt,{className:"text-white text-4xl"}),color:"bg-sky-600"},{type:"audio/mpeg",icon:n.jsx(xt,{className:"text-white text-4xl"}),color:"bg-cyan-500"},{type:"video/mp4",icon:n.jsx(yt,{className:"text-white text-4xl"}),color:"bg-violet-500"},{type:"application/vnd.ms-excel",icon:n.jsx(bt,{className:"text-white text-4xl"}),color:"bg-emerald-600"},{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",icon:n.jsx(wt,{className:"text-white text-4xl"}),color:"bg-emerald-600"}],Oe=["image/jpeg","image/jpg","image/png"],jt=({file:t,index:i})=>{const[o,l]=w.useState(null);w.useEffect(()=>{const f=URL.createObjectURL(t);l(f)},[t]);const d=Te.filter(f=>f.type==t.type),m=C.useSelector(f=>f.file.componentState),E=C.useDispatch(),x=()=>{E(we({zoom:!0,fileSrc:o,index:i,isImage:Oe.includes(t.type),fileName:t.name,type:t.type,size:t.size}))};return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-testid":"file-preview",onClick:()=>x(),className:`${m.rounded&&"rounded-lg"} border-solid border-slate-200 hover:shadow-lg shadow-md hover:cursor-pointer`,children:Oe.includes(t.type)?o&&n.jsx("img",{"data-testid":"image-preview",src:o,className:`${m.fileHeight} ${m.fileWidth} object-fill scale-[0.9]`}):n.jsx("div",{"data-testid":"file-icon-preview",className:`${m.fileHeight} ${m.fileWidth} flex flex-col justify-center content-center items-center`,children:n.jsx("span",{className:`${d.length>0?d[0].color:"bg-slate-400"} | ||
rounded flex w-16 justify-center h-20 items-center`,children:d.length>0?d[0].icon:n.jsx(Ce,{className:"text-white text-4xl"})})})}),n.jsx("div",{className:"h-5 w-44",children:o&&n.jsx(dt,{file:t,fileSrc:o})})]})},Et=pe.configureStore({reducer:{file:it},middleware:t=>t({serializableCheck:!1})}),St=()=>{const t=C.useSelector(o=>o.file.fileData),i=C.useSelector(o=>o.file.fileState);return n.jsx("div",{className:"h-24 absolute bottom-5 right-0 left-0 flex items-center justify-center z-40",children:(i==null?void 0:i.index)!==null&&n.jsx("div",{className:"text-white z-40 self-end top-8 text-1xl",children:`${i.index+1} of ${t==null?void 0:t.length}`})})},_t=()=>{const t=C.useDispatch(),i=C.useSelector(x=>x.file.fileState),o=C.useSelector(x=>x.file.componentState),l=Te.filter(x=>x.type==i.type),d=()=>{t(we({zoom:!1,fileSrc:null,index:0,isImage:!1,fileName:null,type:null,size:0}))},m=()=>{t(rt())},E=()=>{t(at())};return i.zoom?n.jsxs("div",{children:[n.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-80 z-20",children:[n.jsxs("div",{className:"absolute top-0 left-0 right-0 flex justify-between items-center p-2 shadow-md shadow-gray-950 bg-black bg-opacity-80",children:[n.jsx("span",{className:"text-white flex-1 ml-14",children:i.fileName}),i.fileSrc&&n.jsxs("a",{href:i.fileSrc,target:"_blank",download:!0,className:"text-white text-sm flex items-center mr-4 hover:bg-white hover:text-black rounded-lg pl-2 pr-2 pt-1 pb-1",children:[n.jsx(Re,{className:"text-lg mt-1 font-extralight"}),"Download"]}),n.jsxs("button",{className:"text-white text-sm flex items-center mr-2 hover:bg-white hover:text-black rounded-lg pl-2 pr-2 pt-1 pb-1",onClick:d,children:[n.jsx(ct,{className:"text-lg mt-1 font-extralight"}),"Close"]})]}),n.jsx("button",{className:"absolute top-1/2 left-1 transform -translate-y-1/2 text-white rounded-full hover:bg-white hover:text-black text-5xl",onClick:E,"data-testid":"prev-file",children:n.jsx(ut,{})}),n.jsx("div",{"data-testid":"image-slider",className:`${o.rounded&&"rounded-lg"} relative w-[130vh] max-sm:w-96 max-md:w-[75vh] h-[78vh] max-sm:h-52 max-md:h-80 bg-slate-400 overflow-hidden transition-all delay-750 ease-in`,children:i.isImage?i.fileSrc&&n.jsx("img",{className:"object-fit w-full h-full ",src:i.fileSrc,alt:"Zoomed Image"}):n.jsx("span",{className:"flex w-full h-full items-center justify-center text-4xl",children:n.jsx("span",{className:`${l.length>0?l[0].color:"bg-slate-400"} rounded flex justify-center w-48 h-48 items-center`,children:l.length>0?l[0].icon:n.jsx(Ce,{"data-testid":"default-icon",className:"text-white text-4xl"})})})}),n.jsx("button",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 text-white rounded-full hover:bg-white hover:text-black text-5xl",onClick:m,"data-testid":"next-file",children:n.jsx(ft,{})})]}),o.showSliderCount?n.jsx(St,{}):n.jsx(n.Fragment,{})]}):null},Rt=({files:t,url:i,downloadFile:o,removeFile:l,showFileSize:d,showSliderCount:m,multiple:E,accept:x,maxFileSize:f,maxFiles:T,width:_,rounded:O,height:P,fileHeight:I,fileWidth:U,onChange:L,onRemove:G,onError:k,getFiles:j,onClick:J})=>{const A=C.useDispatch(),V=C.useSelector(h=>h.file.fileData),ne=C.useSelector(h=>h.file.fileState),ie=C.useSelector(h=>h.file.componentState),K=h=>{let g=!1;return T&&(V.length+h.length>T||h.length>T)&&(g=!0,k&&k(new Error(`Max ${T} files are allowed to be selected`))),f&&h.forEach(N=>{if(N.size>f){g=!0,k&&k(new Error(`File size limit exceeded: ${N.name}`));return}}),g};w.useEffect(()=>{async function h(){try{if(i){const N=await(await fetch(i)).blob(),H=new File([N],"filename",{type:N.type});A(et({files:[H]}))}}catch(g){if(g instanceof Error)throw k&&k(g),g}}h(),t.length>0&&(K(t)||A(je({files:t})))},[i,t]),w.useEffect(()=>{A(nt({downloadFile:o??!0,removeFile:l??!0,showFileSize:d??!0,showSliderCount:m??!0,rounded:O??!0,fileHeight:I??"h-32",fileWidth:U??"w-44"}))},[o,l,d,m,I,U,O]);const Y=h=>{const g=Array.from(h.target.files||[]);K(g)||A(je({files:g}))},le=h=>{A(tt(h)),G&&G(h)},oe=h=>{J&&J(h)};return j&&j(V),ne.zoom?n.jsx("div",{children:n.jsx(_t,{})}):n.jsx(C.Provider,{store:Et,children:n.jsx("div",{className:"w-full mt-3",children:n.jsx("div",{className:"flex flex-row max-h-2",children:n.jsxs("div",{className:`${_??"basis-11/12"} mx-auto`,children:[V.length>0?n.jsx("div",{children:n.jsxs("div",{className:"flex justify-between bg-gray-200 ",children:[n.jsx("div",{className:"h-10 text-sm pt-2 ml-2 font-medium",children:n.jsx("span",{className:"bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300",children:`Files: ${V.length}`})}),n.jsxs("label",{htmlFor:"fileInput",className:"cursor-pointer py-1 px-2 mt-1 mr-2 mb-1 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:["+ Add more",n.jsx("input",{id:"fileInput",type:"file",onChange:h=>{Y(h),L&&L(h)},style:{display:"none"},multiple:E,accept:x})]})]})}):n.jsx(n.Fragment,{}),n.jsx("div",{className:`${P&&`overflow-auto ${P}`} flex flex-row flex-wrap gap-4 p-6 bg-stone-100 border border-gray-100 shadow dark:bg-gray-800 `,children:V.length>0?V.map((h,g)=>n.jsxs("div",{className:"relative pb-5 group ",onClick:()=>oe(h),children:[n.jsx("div",{className:"ml-9",children:ie.removeFile?n.jsx("button",{"data-testid":"remove-file-button",onClick:()=>le(h),className:"absolute -top-1 right-0 z-10 text-black opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx(st,{})}):n.jsx(n.Fragment,{})}),n.jsx("div",{className:"clear-right",children:n.jsx(jt,{file:h,index:g})})]},g)):n.jsxs("label",{htmlFor:"fileInput",className:"mx-auto cursor-pointer hover:underline flex items-center ",children:["Browse files",n.jsx("input",{id:"fileInput",type:"file",onChange:h=>{Y(h),L&&L(h)},multiple:E??!0,accept:x??"",style:{display:"none"}})]})})]})})})})},Xt="";D.ReactFilesPreview=Rt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}); | ||
Check the top-level render call using <`+a+">.")}return r}}function Ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=$t(r);if(Ue[a])return;Ue[a]=!0;var s="";e&&e._owner&&e._owner!==he.current&&(s=" It was passed a child from "+g(e._owner.type)+"."),Z(e),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,s),Z(null)}}function qe(e,r){{if(typeof e!="object")return;if(fe(e))for(var a=0;a<e.length;a++){var s=e[a];me(s)&&Ye(s,r)}else if(me(e))e._store&&(e._store.validated=!0);else if(e){var v=G(e);if(typeof v=="function"&&v!==e.entries)for(var p=v.call(e),u;!(u=p.next()).done;)me(u.value)&&Ye(u.value,r)}}}function Bt(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===T))a=r.propTypes;else return;if(a){var s=g(r);kt(a,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ve){ve=!0;var v=g(r);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wt(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var s=r[a];if(s!=="children"&&s!=="key"){Z(e),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),Z(null);break}}e.ref!==null&&(Z(e),j("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}function Ge(e,r,a,s,v,p){{var u=le(e);if(!u){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=Zt(v);R?c+=R:c+=We();var y;e===null?y="null":fe(e)?y="array":e!==void 0&&e.$$typeof===i?(y="<"+(g(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,c)}var b=Lt(e,r,a,v,p);if(b==null)return b;if(u){var F=r.children;if(F!==void 0)if(s)if(fe(F)){for(var $=0;$<F.length;$++)qe(F[$],e);Object.freeze&&Object.freeze(F)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qe(F,e)}return e===l?Wt(b):Bt(b),b}}function Ut(e,r,a){return Ge(e,r,a,!0)}function Yt(e,r,a){return Ge(e,r,a,!1)}var qt=Yt,Gt=Ut;W.Fragment=l,W.jsx=qt,W.jsxs=Gt}()),W}process.env.NODE_ENV==="production"?ae.exports=Xe():ae.exports=Qe();var n=ae.exports;const xe=["image/jpeg","image/jpg","image/png"],ye=Ke.createSlice({name:"file",initialState:{fileData:[],fileState:{zoom:!1,fileSrc:null,index:0,isImage:!1,fileName:null,type:null,size:0},componentState:{showFileSize:!1,showSliderCount:!0,downloadFile:!0,removeFile:!0,rounded:!0,fileHeight:"h-32",fileWidth:"w-44"}},reducers:{storeFileData(t,i){const{files:o}=i.payload;t.fileData=o},setComponentState(t,i){t.componentState=i.payload},appendFileData(t,i){t.fileData=[...t.fileData,...i.payload.files]},storeFileState(t,i){t.fileState=i.payload},removeFileData(t,i){const o=i.payload;t.fileData=t.fileData.filter(l=>l.name!==o.name)},getNextFile(t){const i=t.fileState.index+1,o=t.fileData.length-1;let l=i;i>o&&(l=0),t.fileState={zoom:!0,fileSrc:URL.createObjectURL(t.fileData[l]),index:l,isImage:xe.includes(t.fileData[l].type),fileName:t.fileData[l].name,type:t.fileData[l].type,size:t.fileData[l].size}},getPrevFile(t){const i=t.fileState.index-1,o=t.fileData.length-1;let l=i;i<0&&(l=o),t.fileState={zoom:!0,fileSrc:URL.createObjectURL(t.fileData[l]),index:l,isImage:xe.includes(t.fileData[l].type),fileName:t.fileData[l].name,type:t.fileData[l].type,size:t.fileData[l].size}}}}),{storeFileState:be,storeFileData:et,removeFileData:tt,getNextFile:rt,getPrevFile:at,appendFileData:we,setComponentState:nt}=ye.actions;ye.reducer;var je={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ee=w.createContext&&w.createContext(je),M=globalThis&&globalThis.__assign||function(){return M=Object.assign||function(t){for(var i,o=1,l=arguments.length;o<l;o++){i=arguments[o];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(t[d]=i[d])}return t},M.apply(this,arguments)},it=globalThis&&globalThis.__rest||function(t,i){var o={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&i.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,l=Object.getOwnPropertySymbols(t);d<l.length;d++)i.indexOf(l[d])<0&&Object.prototype.propertyIsEnumerable.call(t,l[d])&&(o[l[d]]=t[l[d]]);return o};function Se(t){return t&&t.map(function(i,o){return w.createElement(i.tag,M({key:o},i.attr),Se(i.child))})}function S(t){return function(i){return w.createElement(lt,M({attr:M({},t.attr)},i),Se(t.child))}}function lt(t){var i=function(o){var l=t.attr,d=t.size,m=t.title,E=it(t,["attr","size","title"]),x=d||o.size||"1em",f;return o.className&&(f=o.className),t.className&&(f=(f?f+" ":"")+t.className),w.createElement("svg",M({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,l,E,{className:f,style:M(M({color:t.color||o.color},o.style),t.style),height:x,width:x,xmlns:"http://www.w3.org/2000/svg"}),m&&w.createElement("title",null,m),t.children)};return Ee!==void 0?w.createElement(Ee.Consumer,null,function(o){return i(o)}):i(je)}function _e(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(t)}function ot(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(t)}function st(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(t)}function ct(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}}]})(t)}function ut(t){return S({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}}]})(t)}const ft=({file:t,fileSrc:i})=>{const[o,l]=w.useState(null);w.useEffect(()=>{t.size<1e6?l(Math.floor(t.size/1e3)+" KB"):l(Math.floor(t.size/1e6)+" MB")},[t.size]);const d=t.name.split(".");let m=d[0];const E=d.pop();m.length>20&&(m=m.substring(0,5)+".."+m.substring(m.length-3,m.length));const x=m+"."+E,f=N.useSelector(C=>C.file.componentState);return n.jsxs("div",{className:"relative ",children:[n.jsx("h5",{className:"text-[12px] mt-1 font-normal break-words dark:text-white",children:x}),f.showFileSize&&n.jsx("span",{"data-testid":"file-size",className:"text-[10px] dark:text-white",children:o}),f.downloadFile&&i&&n.jsx("a",{className:"float-right absolute top-1 right-0 text-gray-500 dark:text-white",href:i,target:"_blank",download:!0,rel:"noreferrer",children:n.jsx(_e,{})})]})};function dt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z"}},{tag:"path",attr:{d:"M9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0zm0 1v2A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5z"}}]})(t)}function Re(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.5 4.5a.5.5 0 0 0-1 0v.634l-.549-.317a.5.5 0 1 0-.5.866L7 6l-.549.317a.5.5 0 1 0 .5.866l.549-.317V7.5a.5.5 0 1 0 1 0v-.634l.549.317a.5.5 0 1 0 .5-.866L9 6l.549-.317a.5.5 0 1 0-.5-.866l-.549.317V4.5zM5.5 9a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zm0 2a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5z"}},{tag:"path",attr:{d:"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"}}]})(t)}function ht(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.523 10.424c.14-.082.293-.162.459-.238a7.878 7.878 0 0 1-.45.606c-.28.337-.498.516-.635.572a.266.266 0 0 1-.035.012.282.282 0 0 1-.026-.044c-.056-.11-.054-.216.04-.36.106-.165.319-.354.647-.548zm2.455-1.647c-.119.025-.237.05-.356.078a21.035 21.035 0 0 0 .5-1.05 11.96 11.96 0 0 0 .51.858c-.217.032-.436.07-.654.114zm2.525.939a3.888 3.888 0 0 1-.435-.41c.228.005.434.022.612.054.317.057.466.147.518.209a.095.095 0 0 1 .026.064.436.436 0 0 1-.06.2.307.307 0 0 1-.094.124.107.107 0 0 1-.069.015c-.09-.003-.258-.066-.498-.256zM8.278 4.97c-.04.244-.108.524-.2.829a4.86 4.86 0 0 1-.089-.346c-.076-.353-.087-.63-.046-.822.038-.177.11-.248.196-.283a.517.517 0 0 1 .145-.04c.013.03.028.092.032.198.005.122-.007.277-.038.465z"}},{tag:"path",attr:{fillRule:"evenodd",d:"M4 0h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm.165 11.668c.09.18.23.343.438.419.207.075.412.04.58-.03.318-.13.635-.436.926-.786.333-.401.683-.927 1.021-1.51a11.64 11.64 0 0 1 1.997-.406c.3.383.61.713.91.95.28.22.603.403.934.417a.856.856 0 0 0 .51-.138c.155-.101.27-.247.354-.416.09-.181.145-.37.138-.563a.844.844 0 0 0-.2-.518c-.226-.27-.596-.4-.96-.465a5.76 5.76 0 0 0-1.335-.05 10.954 10.954 0 0 1-.98-1.686c.25-.66.437-1.284.52-1.794.036-.218.055-.426.048-.614a1.238 1.238 0 0 0-.127-.538.7.7 0 0 0-.477-.365c-.202-.043-.41 0-.601.077-.377.15-.576.47-.651.823-.073.34-.04.736.046 1.136.088.406.238.848.43 1.295a19.707 19.707 0 0 1-1.062 2.227 7.662 7.662 0 0 0-1.482.645c-.37.22-.699.48-.897.787-.21.326-.275.714-.08 1.103z"}}]})(t)}function vt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.517 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252.19.061.411.091.665.091.338 0 .624-.053.859-.158.236-.105.416-.252.539-.44.125-.189.187-.408.187-.656 0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357 2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384.125-.101.296-.152.512-.152.143 0 .266.023.37.068a.624.624 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15-.225.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.122.524.082.149.2.27.352.367.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326.505.505 0 0 1-.085.29.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.441 1.441 0 0 0-.489-.272 1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223-.25.148-.44.359-.572.632-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976.131.271.322.48.572.626.25.145.554.217.914.217.293 0 .554-.055.785-.164.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363.7.7 0 0 1-.272.25.874.874 0 0 1-.401.087.845.845 0 0 1-.478-.132.833.833 0 0 1-.299-.392 1.699 1.699 0 0 1-.102-.627v-.495Zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879l-1.327 4Z"}}]})(t)}function mt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-7.839 9.166v.522c0 .256-.039.47-.117.641a.861.861 0 0 1-.322.387.877.877 0 0 1-.469.126.883.883 0 0 1-.471-.126.868.868 0 0 1-.32-.386 1.55 1.55 0 0 1-.117-.642v-.522c0-.257.04-.471.117-.641a.868.868 0 0 1 .32-.387.868.868 0 0 1 .471-.129c.176 0 .332.043.469.13a.861.861 0 0 1 .322.386c.078.17.117.384.117.641Zm.803.519v-.513c0-.377-.068-.7-.205-.972a1.46 1.46 0 0 0-.589-.63c-.254-.147-.56-.22-.917-.22-.355 0-.662.073-.92.22a1.441 1.441 0 0 0-.589.627c-.136.271-.205.596-.205.975v.513c0 .375.069.7.205.973.137.271.333.48.59.627.257.144.564.216.92.216.357 0 .662-.072.916-.216.256-.147.452-.356.59-.627.136-.274.204-.598.204-.973ZM0 11.926v4h1.459c.402 0 .735-.08.999-.238a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.59-.68c-.263-.156-.598-.234-1.004-.234H0Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.141 1.141 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082H.79V12.57Zm7.422.483a1.732 1.732 0 0 0-.103.633v.495c0 .246.034.455.103.627a.834.834 0 0 0 .298.393.845.845 0 0 0 .478.131.868.868 0 0 0 .401-.088.699.699 0 0 0 .273-.248.8.8 0 0 0 .117-.364h.765v.076a1.268 1.268 0 0 1-.226.674c-.137.194-.32.345-.55.454a1.81 1.81 0 0 1-.786.164c-.36 0-.664-.072-.914-.216a1.424 1.424 0 0 1-.571-.627c-.13-.272-.194-.597-.194-.976v-.498c0-.379.066-.705.197-.978.13-.274.321-.485.571-.633.252-.149.556-.223.911-.223.219 0 .421.032.607.097.187.062.35.153.489.272a1.326 1.326 0 0 1 .466.964v.073H9.78a.85.85 0 0 0-.12-.38.7.7 0 0 0-.273-.261.802.802 0 0 0-.398-.097.814.814 0 0 0-.475.138.868.868 0 0 0-.301.398Z"}}]})(t)}function pt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-6.839 9.688v-.522a1.54 1.54 0 0 0-.117-.641.861.861 0 0 0-.322-.387.862.862 0 0 0-.469-.129.868.868 0 0 0-.471.13.868.868 0 0 0-.32.386 1.54 1.54 0 0 0-.117.641v.522c0 .256.04.47.117.641a.868.868 0 0 0 .32.387.883.883 0 0 0 .471.126.877.877 0 0 0 .469-.126.861.861 0 0 0 .322-.386 1.55 1.55 0 0 0 .117-.642Zm.803-.516v.513c0 .375-.068.7-.205.973a1.47 1.47 0 0 1-.589.627c-.254.144-.56.216-.917.216a1.86 1.86 0 0 1-.92-.216 1.463 1.463 0 0 1-.589-.627 2.151 2.151 0 0 1-.205-.973v-.513c0-.379.069-.704.205-.975.137-.274.333-.483.59-.627.257-.147.564-.22.92-.22.357 0 .662.073.916.22.256.146.452.356.59.63.136.271.204.595.204.972ZM1 15.925v-3.999h1.459c.406 0 .741.078 1.005.235.264.156.46.382.589.68.13.296.196.655.196 1.074 0 .422-.065.784-.196 1.084-.131.301-.33.53-.595.689-.264.158-.597.237-.999.237H1Zm1.354-3.354H1.79v2.707h.563c.185 0 .346-.028.483-.082a.8.8 0 0 0 .334-.252c.088-.114.153-.254.196-.422a2.3 2.3 0 0 0 .068-.592c0-.3-.04-.552-.118-.753a.89.89 0 0 0-.354-.454c-.158-.102-.361-.152-.61-.152Zm6.756 1.116c0-.248.034-.46.103-.633a.868.868 0 0 1 .301-.398.814.814 0 0 1 .475-.138c.15 0 .283.032.398.097a.7.7 0 0 1 .273.26.85.85 0 0 1 .12.381h.765v-.073a1.33 1.33 0 0 0-.466-.964 1.44 1.44 0 0 0-.49-.272 1.836 1.836 0 0 0-.606-.097c-.355 0-.66.074-.911.223-.25.148-.44.359-.571.633-.131.273-.197.6-.197.978v.498c0 .379.065.704.194.976.13.271.321.48.571.627.25.144.555.216.914.216.293 0 .555-.054.785-.164.23-.11.414-.26.551-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.765a.8.8 0 0 1-.117.364.699.699 0 0 1-.273.248.874.874 0 0 1-.401.088.845.845 0 0 1-.478-.131.834.834 0 0 1-.298-.393 1.7 1.7 0 0 1-.103-.627v-.495Zm5.092-1.76h.894l-1.275 2.006 1.254 1.992h-.908l-.85-1.415h-.035l-.852 1.415h-.862l1.24-2.015-1.228-1.984h.932l.832 1.439h.035l.823-1.439Z"}}]})(t)}function gt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-4.911 9.67h-.443v-.609h.422a.688.688 0 0 0 .322-.073.558.558 0 0 0 .22-.2.505.505 0 0 0 .076-.284.49.49 0 0 0-.176-.392.652.652 0 0 0-.442-.15.74.74 0 0 0-.252.041.625.625 0 0 0-.193.112.496.496 0 0 0-.179.349H7.71c.006-.157.04-.302.102-.437.063-.135.153-.252.27-.352.117-.101.26-.18.428-.237.17-.057.364-.086.583-.088.279-.002.52.042.723.132.203.09.36.214.472.372a.91.91 0 0 1 .173.539.833.833 0 0 1-.12.478.96.96 0 0 1-.619.439v.041a1.008 1.008 0 0 1 .718.434.909.909 0 0 1 .144.521c.002.19-.037.359-.117.507a1.104 1.104 0 0 1-.329.378c-.14.101-.302.18-.486.234-.182.053-.376.08-.583.08-.3 0-.558-.051-.77-.153a1.206 1.206 0 0 1-.487-.41 1.094 1.094 0 0 1-.178-.563h.726a.457.457 0 0 0 .106.258.664.664 0 0 0 .249.179.98.98 0 0 0 .357.067.903.903 0 0 0 .384-.076.598.598 0 0 0 .252-.217.56.56 0 0 0 .088-.319.556.556 0 0 0-.334-.522.81.81 0 0 0-.372-.079ZM.706 15.925v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715v-3.999h-.8l-1.14 2.596h-.026l-1.14-2.596H0v4h.706Zm5.458-3.999h-1.6v4h.792v-1.342h.803c.287 0 .53-.058.732-.173.203-.118.357-.276.463-.475a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.475-.158-.677a1.175 1.175 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.381.574.574 0 0 1-.237.24.793.793 0 0 1-.375.082h-.66v-1.406h.66c.219 0 .39.06.513.182.123.12.184.295.184.521Z"}}]})(t)}function xt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM.706 15.849v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715V11.85h-.8l-1.14 2.596h-.026L.805 11.85H0v3.999h.706Zm5.278-3.999h-1.6v3.999h.792v-1.342h.803c.287 0 .53-.057.732-.173.203-.117.357-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.237.241.794.794 0 0 1-.375.082h-.66V12.48h.66c.219 0 .39.06.513.181.123.122.184.296.184.522Zm1.505-.032c.266-.434.53-.867.791-1.301h1.14v2.62h.49v.638h-.49v.741h-.741v-.741H7.287v-.648c.235-.44.484-.876.747-1.31Zm-.029 1.298v.02h1.219v-2.021h-.041c-.201.318-.404.646-.607.984-.2.338-.391.677-.571 1.017Z"}}]})(t)}function yt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM6.472 15.29a1.176 1.176 0 0 1-.111-.449h.765a.578.578 0 0 0 .254.384c.07.049.154.087.25.114.095.028.202.041.319.041.164 0 .302-.023.413-.07a.559.559 0 0 0 .255-.193.507.507 0 0 0 .085-.29.387.387 0 0 0-.153-.326c-.101-.08-.255-.144-.462-.193l-.619-.143a1.72 1.72 0 0 1-.539-.214 1.001 1.001 0 0 1-.351-.367 1.068 1.068 0 0 1-.123-.524c0-.244.063-.457.19-.639.127-.181.303-.322.527-.422.225-.1.484-.149.777-.149.305 0 .564.05.78.152.216.102.383.239.5.41.12.17.186.359.2.566h-.75a.56.56 0 0 0-.12-.258.625.625 0 0 0-.247-.181.923.923 0 0 0-.369-.068c-.217 0-.388.05-.513.152a.472.472 0 0 0-.184.384c0 .121.048.22.143.3a.97.97 0 0 0 .405.175l.62.143c.217.05.406.12.566.211a1 1 0 0 1 .375.358c.09.148.135.335.135.56 0 .247-.063.466-.188.656a1.216 1.216 0 0 1-.539.439c-.234.105-.52.158-.858.158-.254 0-.476-.03-.665-.09a1.404 1.404 0 0 1-.478-.252 1.13 1.13 0 0 1-.29-.375Zm-2.945-3.358h-.893L1.81 13.37h-.036l-.832-1.438h-.93l1.227 1.983L0 15.931h.861l.853-1.415h.035l.85 1.415h.908L2.253 13.94l1.274-2.007Zm2.727 3.325H4.557v-3.325h-.79v4h2.487v-.675Z"}}]})(t)}function bt(t){return S({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM7.86 14.841a1.13 1.13 0 0 0 .401.823c.13.108.29.192.479.252.19.061.411.091.665.091.338 0 .624-.053.858-.158.237-.105.416-.252.54-.44a1.17 1.17 0 0 0 .187-.656c0-.224-.045-.41-.135-.56a1.002 1.002 0 0 0-.375-.357 2.028 2.028 0 0 0-.565-.21l-.621-.144a.97.97 0 0 1-.405-.176.37.37 0 0 1-.143-.299c0-.156.061-.284.184-.384.125-.101.296-.152.513-.152.143 0 .266.023.37.068a.624.624 0 0 1 .245.181.56.56 0 0 1 .12.258h.75a1.093 1.093 0 0 0-.199-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.552.05-.777.15-.224.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.123.524.082.149.199.27.351.367.153.095.332.167.54.213l.618.144c.207.049.36.113.462.193a.387.387 0 0 1 .153.326.512.512 0 0 1-.085.29.558.558 0 0 1-.255.193c-.111.047-.25.07-.413.07-.117 0-.224-.013-.32-.04a.837.837 0 0 1-.249-.115.578.578 0 0 1-.255-.384h-.764Zm-3.726-2.909h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415H1.5l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Zm1.923 3.325h1.697v.674H5.266v-3.999h.791v3.325Zm7.636-3.325h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415h-.861l1.24-2.016-1.228-1.983h.931l.832 1.438h.036l.823-1.438Z"}}]})(t)}const Ce=[{type:"application/pdf",icon:n.jsx(ht,{className:"text-white text-4xl"}),color:"bg-red-500"},{type:"text/csv",icon:n.jsx(vt,{className:"text-white text-4xl"}),color:"bg-emerald-600"},{type:"text/plain",icon:n.jsx(dt,{"data-testid":"preview-icon",className:"text-white text-4xl"}),color:"bg-slate-500"},{type:"application/msword",icon:n.jsx(mt,{className:"text-white text-4xl"}),color:"bg-sky-600"},{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",icon:n.jsx(pt,{className:"text-white text-4xl"}),color:"bg-sky-600"},{type:"audio/mpeg",icon:n.jsx(gt,{className:"text-white text-4xl"}),color:"bg-cyan-500"},{type:"video/mp4",icon:n.jsx(xt,{className:"text-white text-4xl"}),color:"bg-violet-500"},{type:"application/vnd.ms-excel",icon:n.jsx(yt,{className:"text-white text-4xl"}),color:"bg-emerald-600"},{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",icon:n.jsx(bt,{className:"text-white text-4xl"}),color:"bg-emerald-600"}],Te=["image/jpeg","image/jpg","image/png"],wt=({file:t,index:i})=>{const[o,l]=w.useState(null);w.useEffect(()=>{const f=URL.createObjectURL(t);l(f)},[t]);const d=Ce.filter(f=>f.type==t.type),m=N.useSelector(f=>f.file.componentState),E=N.useDispatch(),x=()=>{E(be({zoom:!0,fileSrc:o,index:i,isImage:Te.includes(t.type),fileName:t.name,type:t.type,size:t.size}))};return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-testid":"file-preview",onClick:()=>x(),className:`${m.rounded&&"rounded-lg"} border-solid border-slate-200 hover:shadow-lg shadow-md hover:cursor-pointer`,children:Te.includes(t.type)?o&&n.jsx("img",{"data-testid":"image-preview",src:o,className:`${m.fileHeight} ${m.fileWidth} object-fill scale-[0.9]`}):n.jsx("div",{"data-testid":"file-icon-preview",className:`${m.fileHeight} ${m.fileWidth} flex flex-col justify-center content-center items-center`,children:n.jsx("span",{className:`${d.length>0?d[0].color:"bg-slate-400"} | ||
rounded flex w-16 justify-center h-20 items-center`,children:d.length>0?d[0].icon:n.jsx(Re,{className:"text-white text-4xl"})})})}),n.jsx("div",{className:"h-5 w-44",children:o&&n.jsx(ft,{file:t,fileSrc:o})})]})},jt=()=>{const t=N.useSelector(o=>o.file.fileData),i=N.useSelector(o=>o.file.fileState);return n.jsx("div",{className:"h-24 absolute bottom-5 right-0 left-0 flex items-center justify-center z-40",children:(i==null?void 0:i.index)!==null&&n.jsx("div",{className:"text-white z-40 self-end top-8 text-1xl",children:`${i.index+1} of ${t==null?void 0:t.length}`})})},Et=()=>{const t=N.useDispatch(),i=N.useSelector(x=>x.file.fileState),o=N.useSelector(x=>x.file.componentState),l=Ce.filter(x=>x.type==i.type),d=()=>{t(be({zoom:!1,fileSrc:null,index:0,isImage:!1,fileName:null,type:null,size:0}))},m=()=>{t(rt())},E=()=>{t(at())};return i.zoom?n.jsxs("div",{children:[n.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-80 z-20",children:[n.jsxs("div",{className:"absolute top-0 left-0 right-0 flex justify-between items-center p-2 shadow-md shadow-gray-950 bg-black bg-opacity-80",children:[n.jsx("span",{className:"text-white flex-1 ml-14",children:i.fileName}),i.fileSrc&&n.jsxs("a",{href:i.fileSrc,target:"_blank",download:!0,className:"text-white text-sm flex items-center mr-4 hover:bg-white hover:text-black rounded-lg pl-2 pr-2 pt-1 pb-1",children:[n.jsx(_e,{className:"text-lg mt-1 font-extralight"}),"Download"]}),n.jsxs("button",{className:"text-white text-sm flex items-center mr-2 hover:bg-white hover:text-black rounded-lg pl-2 pr-2 pt-1 pb-1",onClick:d,children:[n.jsx(st,{className:"text-lg mt-1 font-extralight"}),"Close"]})]}),n.jsx("button",{className:"absolute top-1/2 left-1 transform -translate-y-1/2 text-white rounded-full hover:bg-white hover:text-black text-5xl",onClick:E,"data-testid":"prev-file",children:n.jsx(ct,{})}),n.jsx("div",{"data-testid":"image-slider",className:`${o.rounded&&"rounded-lg"} relative w-[130vh] max-sm:w-96 max-md:w-[75vh] h-[78vh] max-sm:h-52 max-md:h-80 bg-slate-400 overflow-hidden transition-all delay-750 ease-in`,children:i.isImage?i.fileSrc&&n.jsx("img",{className:"object-fit w-full h-full ",src:i.fileSrc,alt:"Zoomed Image"}):n.jsx("span",{className:"flex w-full h-full items-center justify-center text-4xl",children:n.jsx("span",{className:`${l.length>0?l[0].color:"bg-slate-400"} rounded flex justify-center w-48 h-48 items-center`,children:l.length>0?l[0].icon:n.jsx(Re,{"data-testid":"default-icon",className:"text-white text-4xl"})})})}),n.jsx("button",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 text-white rounded-full hover:bg-white hover:text-black text-5xl",onClick:m,"data-testid":"next-file",children:n.jsx(ut,{})})]}),o.showSliderCount?n.jsx(jt,{}):n.jsx(n.Fragment,{})]}):null},St=({files:t,url:i,downloadFile:o,removeFile:l,showFileSize:d,showSliderCount:m,multiple:E,accept:x,maxFileSize:f,maxFiles:C,width:_,rounded:T,height:P,fileHeight:I,fileWidth:U,onChange:L,onRemove:G,onError:O,getFiles:j,onClick:J})=>{const A=N.useDispatch(),V=N.useSelector(h=>h.file.fileData),ne=N.useSelector(h=>h.file.fileState),ie=N.useSelector(h=>h.file.componentState),K=h=>{let g=!1;return C&&(V.length+h.length>C||h.length>C)&&(g=!0,O&&O(new Error(`Max ${C} files are allowed to be selected`))),f&&h.forEach(k=>{if(k.size>f){g=!0,O&&O(new Error(`File size limit exceeded: ${k.name}`));return}}),g};w.useEffect(()=>{async function h(){try{if(i){const k=await(await fetch(i)).blob(),H=new File([k],"filename",{type:k.type});A(et({files:[H]}))}}catch(g){if(g instanceof Error)throw O&&O(g),g}}h(),t.length>0&&(K(t)||A(we({files:t})))},[i,t]),w.useEffect(()=>{A(nt({downloadFile:o??!0,removeFile:l??!0,showFileSize:d??!0,showSliderCount:m??!0,rounded:T??!0,fileHeight:I??"h-32",fileWidth:U??"w-44"}))},[o,l,d,m,I,U,T]);const Y=h=>{const g=Array.from(h.target.files||[]);K(g)||A(we({files:g}))},le=h=>{A(tt(h)),G&&G(h)},oe=h=>{J&&J(h)};return j&&j(V),ne.zoom?n.jsx("div",{children:n.jsx(Et,{})}):n.jsx("div",{className:"w-full mt-3",children:n.jsx("div",{className:"flex flex-row max-h-2",children:n.jsxs("div",{className:`${_??"basis-11/12"} mx-auto`,children:[V.length>0?n.jsx("div",{children:n.jsxs("div",{className:"flex justify-between bg-gray-200 ",children:[n.jsx("div",{className:"h-10 text-sm pt-2 ml-2 font-medium",children:n.jsx("span",{className:"bg-gray-100 text-gray-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300",children:`Files: ${V.length}`})}),n.jsxs("label",{htmlFor:"fileInput",className:"cursor-pointer py-1 px-2 mt-1 mr-2 mb-1 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-full border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:["+ Add more",n.jsx("input",{id:"fileInput",type:"file",onChange:h=>{Y(h),L&&L(h)},style:{display:"none"},multiple:E,accept:x})]})]})}):n.jsx(n.Fragment,{}),n.jsx("div",{className:`${P&&`overflow-auto ${P}`} flex flex-row flex-wrap gap-4 p-6 bg-stone-100 border border-gray-100 shadow dark:bg-gray-800 `,children:V.length>0?V.map((h,g)=>n.jsxs("div",{className:"relative pb-5 group ",onClick:()=>oe(h),children:[n.jsx("div",{className:"ml-9",children:ie.removeFile?n.jsx("button",{"data-testid":"remove-file-button",onClick:()=>le(h),className:"absolute -top-1 right-0 z-10 text-black opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx(ot,{})}):n.jsx(n.Fragment,{})}),n.jsx("div",{className:"clear-right",children:n.jsx(wt,{file:h,index:g})})]},g)):n.jsxs("label",{htmlFor:"fileInput",className:"mx-auto cursor-pointer hover:underline flex items-center ",children:["Browse files",n.jsx("input",{id:"fileInput",type:"file",onChange:h=>{Y(h),L&&L(h)},multiple:E??!0,accept:x??"",style:{display:"none"}})]})})]})})})},Jt="";D.ReactFilesPreview=St,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "react-files-preview", | ||
"private": false, | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"author": "Usama Chouhan (musama619)", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114659
1498