UNPKG

scriptguard-library

Version:

A secure and customizable text input field library for React.

173 lines (160 loc) 107 kB
import*as e from"react/jsx-runtime";import*as t from"react";import{forwardRef as r,useContext as n,useState as o,useRef as i,useEffect as a}from"react";var s=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),c="-ms-",l="-moz-",u="-webkit-",f="comm",d="rule",h="decl",p="@keyframes",v=Math.abs,y=String.fromCharCode,g=Object.assign;function m(e){return e.trim()}function _(e,t,r){return e.replace(t,r)}function b(e,t){return e.indexOf(t)}function x(e,t){return 0|e.charCodeAt(t)}function w(e,t,r){return e.slice(t,r)}function k(e){return e.length}function S(e){return e.length}function B(e,t){return t.push(e),e}var C=1,A=1,z=0,E=0,M=0,P="";function H(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:C,column:A,length:a,return:""}}function $(e,t){return g(H("",null,null,"",null,null,0),e,{length:-e.length},t)}function R(){return M=E>0?x(P,--E):0,A--,10===M&&(A=1,C--),M}function O(){return M=E<z?x(P,E++):0,A++,10===M&&(A=1,C++),M}function D(){return x(P,E)}function F(){return E}function T(e,t){return w(P,e,t)}function j(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function L(e){return C=A=1,z=k(P=e),E=0,[]}function I(e){return P="",e}function N(e){return m(T(E-1,X(91===e?e+2:40===e?e+1:e)))}function W(e){for(;(M=D())&&M<33;)O();return j(e)>2||j(M)>3?"":" "}function U(e,t){for(;--t&&O()&&!(M<48||M>102||M>57&&M<65||M>70&&M<97););return T(e,F()+(t<6&&32==D()&&32==O()))}function X(e){for(;O();)switch(M){case e:return E;case 34:case 39:34!==e&&39!==e&&X(M);break;case 40:41===e&&X(e);break;case 92:O()}return E}function K(e,t){for(;O()&&e+M!==57&&(e+M!==84||47!==D()););return"/*"+T(t,E-1)+"*"+y(47===e?e:O())}function q(e){for(;!j(D());)O();return T(e,E)}function G(e){return I(V("",null,null,null,[""],e=L(e),0,[0],e))}function V(e,t,r,n,o,i,a,s,c){for(var l=0,u=0,f=a,d=0,h=0,p=0,v=1,g=1,m=1,w=0,S="",C=o,A=i,z=n,E=S;g;)switch(p=w,w=O()){case 40:if(108!=p&&58==x(E,f-1)){-1!=b(E+=_(N(w),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:E+=N(w);break;case 9:case 10:case 13:case 32:E+=W(p);break;case 92:E+=U(F()-1,7);continue;case 47:switch(D()){case 42:case 47:B(Y(K(O(),F()),t,r),c);break;default:E+="/"}break;case 123*v:s[l++]=k(E)*m;case 125*v:case 59:case 0:switch(w){case 0:case 125:g=0;case 59+u:-1==m&&(E=_(E,/\f/g,"")),h>0&&k(E)-f&&B(h>32?J(E+";",n,r,f-1):J(_(E," ","")+";",n,r,f-2),c);break;case 59:E+=";";default:if(B(z=Z(E,t,r,l,u,o,s,S,C=[],A=[],f),i),123===w)if(0===u)V(E,t,z,z,C,i,f,s,A);else switch(99===d&&110===x(E,3)?100:d){case 100:case 108:case 109:case 115:V(e,z,z,n&&B(Z(e,z,z,0,0,o,s,S,o,C=[],f),A),o,A,f,s,n?C:A);break;default:V(E,z,z,z,[""],A,0,s,A)}}l=u=h=0,v=m=1,S=E="",f=a;break;case 58:f=1+k(E),h=p;default:if(v<1)if(123==w)--v;else if(125==w&&0==v++&&125==R())continue;switch(E+=y(w),w*v){case 38:m=u>0?1:(E+="\f",-1);break;case 44:s[l++]=(k(E)-1)*m,m=1;break;case 64:45===D()&&(E+=N(O())),d=D(),u=f=k(S=E+=q(F())),w++;break;case 45:45===p&&2==k(E)&&(v=0)}}return i}function Z(e,t,r,n,o,i,a,s,c,l,u){for(var f=o-1,h=0===o?i:[""],p=S(h),y=0,g=0,b=0;y<n;++y)for(var x=0,k=w(e,f+1,f=v(g=a[y])),B=e;x<p;++x)(B=m(g>0?h[x]+" "+k:_(k,/&\f/g,h[x])))&&(c[b++]=B);return H(e,t,r,0===o?d:s,c,l,u)}function Y(e,t,r){return H(e,t,r,f,y(M),w(e,2,-2),0)}function J(e,t,r,n){return H(e,t,r,h,w(e,0,n),w(e,n+1,-1),n)}function Q(e,t){for(var r="",n=S(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function ee(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case h:return e.return=e.return||e.value;case f:return"";case p:return e.return=e.value+"{"+Q(e.children,n)+"}";case d:e.value=e.props.join(",")}return k(r=Q(e.children,n))?e.return=e.value+"{"+r+"}":""}function te(e){var t=S(e);return function(r,n,o,i){for(var a="",s=0;s<t;s++)a+=e[s](r,n,o,i)||"";return a}}function re(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var ne="undefined"!=typeof document,oe=function(e,t,r){for(var n=0,o=0;n=o,o=D(),38===n&&12===o&&(t[r]=1),!j(o);)O();return T(e,E)},ie=function(e,t){return I(function(e,t){var r=-1,n=44;do{switch(j(n)){case 0:38===n&&12===D()&&(t[r]=1),e[r]+=oe(E-1,t,r);break;case 2:e[r]+=N(n);break;case 4:if(44===n){e[++r]=58===D()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=y(n)}}while(n=O());return e}(L(e),t))},ae=new WeakMap,se=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ae.get(r))&&!n){ae.set(e,!0);for(var o=[],i=ie(t,o),a=r.props,s=0,c=0;s<i.length;s++)for(var l=0;l<a.length;l++,c++)e.props[c]=o[s]?i[s].replace(/&\f/g,a[l]):a[l]+" "+i[s]}}},ce=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function le(e,t){switch(function(e,t){return 45^x(e,0)?(((t<<2^x(e,0))<<2^x(e,1))<<2^x(e,2))<<2^x(e,3):0}(e,t)){case 5103:return u+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return u+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return u+e+l+e+c+e+e;case 6828:case 4268:return u+e+c+e+e;case 6165:return u+e+c+"flex-"+e+e;case 5187:return u+e+_(e,/(\w+).+(:[^]+)/,u+"box-$1$2"+c+"flex-$1$2")+e;case 5443:return u+e+c+"flex-item-"+_(e,/flex-|-self/,"")+e;case 4675:return u+e+c+"flex-line-pack"+_(e,/align-content|flex-|-self/,"")+e;case 5548:return u+e+c+_(e,"shrink","negative")+e;case 5292:return u+e+c+_(e,"basis","preferred-size")+e;case 6060:return u+"box-"+_(e,"-grow","")+u+e+c+_(e,"grow","positive")+e;case 4554:return u+_(e,/([^-])(transform)/g,"$1"+u+"$2")+e;case 6187:return _(_(_(e,/(zoom-|grab)/,u+"$1"),/(image-set)/,u+"$1"),e,"")+e;case 5495:case 3959:return _(e,/(image-set\([^]*)/,u+"$1$`$1");case 4968:return _(_(e,/(.+:)(flex-)?(.*)/,u+"box-pack:$3"+c+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+u+e+e;case 4095:case 3583:case 4068:case 2532:return _(e,/(.+)-inline(.+)/,u+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(k(e)-1-t>6)switch(x(e,t+1)){case 109:if(45!==x(e,t+4))break;case 102:return _(e,/(.+:)(.+)-([^]+)/,"$1"+u+"$2-$3$1"+l+(108==x(e,t+3)?"$3":"$2-$3"))+e;case 115:return~b(e,"stretch")?le(_(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==x(e,t+1))break;case 6444:switch(x(e,k(e)-3-(~b(e,"!important")&&10))){case 107:return _(e,":",":"+u)+e;case 101:return _(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+u+(45===x(e,14)?"inline-":"")+"box$3$1"+u+"$2$3$1"+c+"$2box$3")+e}break;case 5936:switch(x(e,t+11)){case 114:return u+e+c+_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return u+e+c+_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return u+e+c+_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return u+e+c+e+e}return e}var ue,fe,de=ne?void 0:(ue=function(){return re((function(){return{}}))},fe=new WeakMap,function(e){if(fe.has(e))return fe.get(e);var t=ue(e);return fe.set(e,t),t}),he=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case h:e.return=le(e.value,e.length);break;case p:return Q([$(e,{value:_(e.value,"@","@"+u)})],n);case d:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Q([$(e,{props:[_(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Q([$(e,{props:[_(t,/:(plac\w+)/,":"+u+"input-$1")]}),$(e,{props:[_(t,/:(plac\w+)/,":-moz-$1")]}),$(e,{props:[_(t,/:(plac\w+)/,c+"input-$1")]})],n)}return""}))}}],pe=function(e){var t=e.key;if(ne&&"css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,o,i=e.stylisPlugins||he,a={},c=[];ne&&(n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)a[t[r]]=!0;c.push(e)})));var l,u=[se,ce];if(de){var f=[ee],d=te(u.concat(i,f)),h=de(i)(t),p=function(e,t){var r=t.name;return void 0===h[r]&&(h[r]=Q(G(e?e+"{"+t.styles+"}":t.styles),d)),h[r]};o=function(e,t,r,n){var o=t.name,i=p(e,t);return void 0===m.compat?(n&&(m.inserted[o]=!0),i):n?void(m.inserted[o]=i):i}}else{var v,y=[ee,(l=function(e){v.insert(e)},function(e){e.root||(e=e.return)&&l(e)})],g=te(u.concat(i,y));o=function(e,t,r,n){v=r,Q(G(e?e+"{"+t.styles+"}":t.styles),g),n&&(m.inserted[t.name]=!0)}}var m={key:t,sheet:new s({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return m.sheet.hydrate(c),m};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ve.apply(null,arguments)}var ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var me,_e={exports:{}},be={};var xe,we,ke,Se,Be={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function Ce(){return we||(we=1,"production"===process.env.NODE_ENV?_e.exports=function(){if(me)return be;me=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case c:case l:case n:case i:case o:case f:return e;default:switch(e=e&&e.$$typeof){case s:case u:case p:case h:case a:return e;default:return d}}case r:return d}}}function b(e){return _(e)===l}return be.AsyncMode=c,be.ConcurrentMode=l,be.ContextConsumer=s,be.ContextProvider=a,be.Element=t,be.ForwardRef=u,be.Fragment=n,be.Lazy=p,be.Memo=h,be.Portal=r,be.Profiler=i,be.StrictMode=o,be.Suspense=f,be.isAsyncMode=function(e){return b(e)||_(e)===c},be.isConcurrentMode=b,be.isContextConsumer=function(e){return _(e)===s},be.isContextProvider=function(e){return _(e)===a},be.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},be.isForwardRef=function(e){return _(e)===u},be.isFragment=function(e){return _(e)===n},be.isLazy=function(e){return _(e)===p},be.isMemo=function(e){return _(e)===h},be.isPortal=function(e){return _(e)===r},be.isProfiler=function(e){return _(e)===i},be.isStrictMode=function(e){return _(e)===o},be.isSuspense=function(e){return _(e)===f},be.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===g||e.$$typeof===m||e.$$typeof===v)},be.typeOf=_,be}():_e.exports=(xe||(xe=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var v=e.type;switch(v){case c:case l:case n:case i:case o:case f:return v;default:var y=v&&v.$$typeof;switch(y){case s:case u:case p:case h:case a:return y;default:return d}}case r:return d}}}var b=c,x=l,w=s,k=a,S=t,B=u,C=n,A=p,z=h,E=r,M=i,P=o,H=f,$=!1;function R(e){return _(e)===l}Be.AsyncMode=b,Be.ConcurrentMode=x,Be.ContextConsumer=w,Be.ContextProvider=k,Be.Element=S,Be.ForwardRef=B,Be.Fragment=C,Be.Lazy=A,Be.Memo=z,Be.Portal=E,Be.Profiler=M,Be.StrictMode=P,Be.Suspense=H,Be.isAsyncMode=function(e){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||_(e)===c},Be.isConcurrentMode=R,Be.isContextConsumer=function(e){return _(e)===s},Be.isContextProvider=function(e){return _(e)===a},Be.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Be.isForwardRef=function(e){return _(e)===u},Be.isFragment=function(e){return _(e)===n},Be.isLazy=function(e){return _(e)===p},Be.isMemo=function(e){return _(e)===h},Be.isPortal=function(e){return _(e)===r},Be.isProfiler=function(e){return _(e)===i},Be.isStrictMode=function(e){return _(e)===o},Be.isSuspense=function(e){return _(e)===f},Be.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===g||e.$$typeof===m||e.$$typeof===v)},Be.typeOf=_}()),Be)),_e.exports}!function(){if(Se)return ke;Se=1;var e=Ce(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function i(r){return e.isMemo(r)?n:o[r.$$typeof]||t}o[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[e.Memo]=n;var a=Object.defineProperty,s=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;ke=function e(t,n,o){if("string"!=typeof n){if(f){var d=u(n);d&&d!==f&&e(t,d,o)}var h=s(n);c&&(h=h.concat(c(n)));for(var p=i(t),v=i(n),y=0;y<h.length;++y){var g=h[y];if(!(r[g]||o&&o[g]||v&&v[g]||p&&p[g])){var m=l(n,g);try{a(t,g,m)}catch(e){}}}}return t}}();var Ae="undefined"!=typeof document;function ze(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")})),n}var Ee=function(e,t,r){var n=e.key+"-"+t.name;(!1===r||!1===Ae&&void 0!==e.compat)&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},Me=function(e,t,r){Ee(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o="",i=t;do{var a=e.insert(t===i?"."+n:"",i,e.sheet,!0);Ae||void 0===a||(o+=a),i=i.next}while(void 0!==i);if(!Ae&&0!==o.length)return o}};var Pe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},He=/[A-Z]|^ms/g,$e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Re=function(e){return 45===e.charCodeAt(1)},Oe=function(e){return null!=e&&"boolean"!=typeof e},De=re((function(e){return Re(e)?e:e.replace(He,"-$&").toLowerCase()})),Fe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace($e,(function(e,t,r){return je={name:t,styles:r,next:je},t}))}return 1===Pe[e]||Re(e)||"number"!=typeof t||0===t?t:t+"px"};function Te(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var o=r;if(1===o.anim)return je={name:o.name,styles:o.styles,next:je},o.name;var i=r;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)je={name:a.name,styles:a.styles,next:je},a=a.next;return i.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Te(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":Oe(s)&&(n+=De(i)+":"+Fe(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var c=Te(e,t,a);switch(i){case"animation":case"animationName":n+=De(i)+":"+c+";";break;default:n+=i+"{"+c+"}"}}else for(var l=0;l<a.length;l++)Oe(a[l])&&(n+=De(i)+":"+Fe(i,a[l])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=je,c=r(e);return je=s,Te(e,t,c)}}var l=r;if(null==t)return l;var u=t[l];return void 0!==u?u:l}var je,Le=/label:\s*([^\s;{]+)\s*(;|$)/g;function Ie(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";je=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=Te(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++){if(o+=Te(r,t,e[a]),n)o+=i[a]}Le.lastIndex=0;for(var s,c="";null!==(s=Le.exec(o));)c+="-"+s[1];var l=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+c;return{name:l,styles:o,next:je}}var Ne="undefined"!=typeof document,We=function(e){return e()},Ue=!!t.useInsertionEffect&&t.useInsertionEffect,Xe=Ne&&Ue||We,Ke="undefined"!=typeof document,qe=t.createContext("undefined"!=typeof HTMLElement?pe({key:"css"}):null);qe.Provider;var Ge=function(e){return r((function(t,r){var o=n(qe);return e(t,o,r)}))};Ke||(Ge=function(e){return function(r){var o=n(qe);return null===o?(o=pe({key:"css"}),t.createElement(qe.Provider,{value:o},e(r,o))):e(r,o)}});var Ve,Ze,Ye=t.createContext({}),Je={}.hasOwnProperty,Qe="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",et=function(e,t){var r={};for(var n in t)Je.call(t,n)&&(r[n]=t[n]);return r[Qe]=e,r},tt=function(e){var r=e.cache,n=e.serialized,o=e.isStringTag;Ee(r,n,o);var i=Xe((function(){return Me(r,n,o)}));if(!Ke&&void 0!==i){for(var a,s=n.name,c=n.next;void 0!==c;)s+=" "+c.name,c=c.next;return t.createElement("style",((a={})["data-emotion"]=r.key+" "+s,a.dangerouslySetInnerHTML={__html:i},a.nonce=r.sheet.nonce,a))}return null},rt=Ge((function(e,r,n){var o=e.css;"string"==typeof o&&void 0!==r.registered[o]&&(o=r.registered[o]);var i=e[Qe],a=[o],s="";"string"==typeof e.className?s=ze(r.registered,a,e.className):null!=e.className&&(s=e.className+" ");var c=Ie(a,void 0,t.useContext(Ye));s+=r.key+"-"+c.name;var l={};for(var u in e)Je.call(e,u)&&"css"!==u&&u!==Qe&&(l[u]=e[u]);return l.className=s,n&&(l.ref=n),t.createElement(t.Fragment,null,t.createElement(tt,{cache:r,serialized:c,isStringTag:"string"==typeof i}),t.createElement(i,l))})),nt=rt,ot=function(t,r,n){return Je.call(r,"css")?e.jsx(nt,et(t,r),n):e.jsx(t,r,n)},it=function(t,r,n){return Je.call(r,"css")?e.jsxs(nt,et(t,r),n):e.jsxs(t,r,n)},at=function(e,r){var n=arguments;if(null==r||!Je.call(r,"css"))return t.createElement.apply(void 0,n);var o=n.length,i=new Array(o);i[0]=nt,i[1]=et(e,r);for(var a=2;a<o;a++)i[a]=n[a];return t.createElement.apply(null,i)};function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ie(t)}Ve=at||(at={}),Ze||(Ze=Ve.JSX||(Ve.JSX={}));const ct=e=>e.replace(/[<>/'"\\]/g,""),lt=st` padding: 0.5rem 0.75rem; border: 1px solid #ccc; border-radius: 0.375rem; font-size: 1rem; width: 100%; transition: border-color 0.2s ease-in-out; &:focus { outline: none; border-color: #3182ce; box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.4); } &::placeholder { color: #a0aec0; } `,ut=({value:e="",onChange:t,allowedChars:r=/^[a-zA-Z0-9\s]*$/,maxLength:n=255,sanitize:s=ct,placeholder:c="Enter text...",className:l="",id:u,css:f})=>{const[d,h]=o(e),p=i(null);a((()=>{h(e)}),[e]);return ot("input",{ref:p,type:"text",value:d,onChange:e=>{let o=e.target.value;o=o.split("").filter((e=>r.test(e))).join(""),o=s(o).slice(0,n),o!==d&&(h(o),t?.(o))},placeholder:c,className:l,id:u,"aria-label":c,css:[lt,f]})},ft=e=>e.replace(/[^a-zA-Z0-9@._-]/g,""),dt=(e,t)=>{if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e))return"Invalid email format";if(t&&t.length>0){const r=e.split("@")[1];if(!t.includes(r))return`Allowed domains: ${t.join(", ")}`}return""},ht=st` width: 100%; position: relative; `,pt=st` padding: 0.5rem 0.75rem; border: 1px solid #ccc; border-radius: 0.375rem; font-size: 1rem; width: 100%; transition: border-color 0.2s ease-in-out; &:focus { outline: none; border-color: #3182ce; box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.4); } &::placeholder { color: #a0aec0; } `,vt=st` color: #f56565; font-size: 0.875rem; margin-top: 0.25rem; `,yt=({value:e="",onChange:t,sanitize:r=ft,validateEmail:n=dt,placeholder:i="Enter email...",className:a="",allowedDomains:s=[],css:c,errorCss:l})=>{const[u,f]=o(e),[d,h]=o("");return it("div",{className:a,css:[ht],children:[ot("input",{type:"email",value:u,onChange:e=>{let o=r(e.target.value.trim().toLowerCase());f(o);const i=n(o,s);h(i),i||t?.(o)},placeholder:i,css:[pt,c],"aria-label":i}),d&&ot("p",{css:[vt,l],children:d})]})},gt=e=>e.replace(/\s/g,""),mt=st` position: relative; width: 100%; `,_t=st` width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #ccc; border-radius: 0.375rem; font-size: 1rem; transition: border-color 0.2s ease-in-out; &:focus { outline: none; border-color: #3182ce; box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.4); } &::placeholder { color: #a0aec0; } `,bt=st` position: absolute; top: 0.5rem; right: 0.75rem; background: transparent; border: none; font-size: 1rem; cursor: pointer; color: #718096; &:hover { color: #4a5568; } `,xt=st` margin-top: 0.5rem; width: 100%; height: 0.5rem; background-color: #e2e8f0; border-radius: 0.375rem; overflow: hidden; `,wt=e=>5===e?"#48bb78":e>=3?"#ecc94b":"#f56565",kt=({value:e="",onChange:t,minLength:r=8,maxLength:n=64,sanitize:i=gt,placeholder:s="Enter password...",className:c="",showStrengthMeter:l=!0,preventPaste:u=!1,css:f,toggleCss:d})=>{const[h,p]=o(e),[v,y]=o(!1);a((()=>{p(e)}),[e]);const g=(e=>{let t=0;return e.length>=8&&t++,/[A-Z]/.test(e)&&t++,/[a-z]/.test(e)&&t++,/[0-9]/.test(e)&&t++,/[@$!%*?&#]/.test(e)&&t++,t})(h);return it("div",{css:mt,className:c,children:[ot("input",{type:v?"text":"password",value:h,onChange:e=>{let r=i(e.target.value).slice(0,n);p(r),t?.(r)},placeholder:s,minLength:r,maxLength:n,onPaste:u?e=>e.preventDefault():void 0,css:[_t,f],"aria-label":s}),ot("button",{type:"button",onClick:()=>y((e=>!e)),css:[bt,d],"aria-label":"Toggle password visibility",children:v?"🙈":"👁️"}),l&&ot("div",{css:xt,children:ot("div",{style:{width:g/5*100+"%",height:"100%",backgroundColor:wt(g)}})})]})},St=st` margin-right: 0.5rem; font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `,Bt=st` padding: 0.4rem 0.75rem; background-color: #4299e1; color: white; border: none; border-radius: 0.375rem; cursor: pointer; font-weight: 500; transition: background-color 0.2s ease-in-out; &:hover { background-color: #3182ce; } &:focus { outline: none; box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5); } `,Ct=({text:e,className:t="",buttonText:r="Copy",copiedText:n="Copied!",maskText:i=!1,autoClearClipboard:a=!1,clearTimeoutMs:s=3e3,textCss:c,buttonCss:l})=>{const[u,f]=o(!1);return it("div",{className:`flex items-center ${t}`,children:[ot("span",{css:[St,c],children:i?"••••••••••":e}),ot("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(e),f(!0),a?setTimeout((async()=>{await navigator.clipboard.writeText(""),f(!1)}),s):setTimeout((()=>f(!1)),1500)}catch(e){console.error("Failed to copy text:",e)}},css:[Bt,l],children:u?n:r})]})},At=st` display: flex; flex-direction: column; gap: 0.75rem; width: 100%; `,zt=st` align-self: flex-start; padding: 0.5rem 1rem; background-color: #4a5568; color: white; border: none; border-radius: 0.375rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease-in-out; &:hover { background-color: #2d3748; } &:focus { outline: none; box-shadow: 0 0 0 2px rgba(74, 85, 104, 0.4); } `,Et=({minLength:e=12,maxLength:t=20,onGenerate:r,showStrengthMeter:n=!0})=>{const[i,a]=o("");return it("div",{css:At,children:[ot(kt,{value:i,onChange:a,minLength:e,maxLength:t,showStrengthMeter:n}),ot("button",{type:"button",onClick:()=>{const t=((e,t={upper:!0,lower:!0,numbers:!0,symbols:!0})=>{const r="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n="abcdefghijklmnopqrstuvwxyz",o="0123456789",i="!@#$%^&*()_+-=[]{}|;:,.<>?",a=[],s=[];t.upper&&(a.push(r),s.push(r[Math.floor(26*Math.random())])),t.lower&&(a.push(n),s.push(n[Math.floor(26*Math.random())])),t.numbers&&(a.push(o),s.push(o[Math.floor(10*Math.random())])),t.symbols&&(a.push(i),s.push(i[Math.floor(26*Math.random())]));const c=a.join("");if(!c)return"";const l=Math.max(e-s.length,0),u=[];for(let e=0;e<l;e++)u.push(c[Math.floor(Math.random()*c.length)]);const f=[...s,...u];for(let e=f.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[f[e],f[t]]=[f[t],f[e]]}return f.join("")})(e);a(t),r?.(t)},css:zt,children:"Generate Password"})]})};var Mt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Pt="undefined"!=typeof document,Ht=re((function(e){return Mt.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),$t=function(e){return"theme"!==e},Rt=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Ht:$t},Ot=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},Dt=function(e){var r=e.cache,n=e.serialized,o=e.isStringTag;Ee(r,n,o);var i=Xe((function(){return Me(r,n,o)}));if(!Pt&&void 0!==i){for(var a,s=n.name,c=n.next;void 0!==c;)s+=" "+c.name,c=c.next;return t.createElement("style",((a={})["data-emotion"]=r.key+" "+s,a.dangerouslySetInnerHTML={__html:i},a.nonce=r.sheet.nonce,a))}return null},Ft=function e(r,n){var o,i,a=r.__emotion_real===r,s=a&&r.__emotion_base||r;void 0!==n&&(o=n.label,i=n.target);var c=Ot(r,n,a),l=c||Rt(s),u=!l("as");return function(){var f=arguments,d=a&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)d.push.apply(d,f);else{var h=f[0];d.push(h[0]);for(var p=f.length,v=1;v<p;v++)d.push(f[v],h[v])}var y=Ge((function(e,r,n){var o=u&&e.as||s,a="",f=[],h=e;if(null==e.theme){for(var p in h={},e)h[p]=e[p];h.theme=t.useContext(Ye)}"string"==typeof e.className?a=ze(r.registered,f,e.className):null!=e.className&&(a=e.className+" ");var v=Ie(d.concat(f),r.registered,h);a+=r.key+"-"+v.name,void 0!==i&&(a+=" "+i);var y=u&&void 0===c?Rt(o):l,g={};for(var m in e)u&&"as"===m||y(m)&&(g[m]=e[m]);return g.className=a,n&&(g.ref=n),t.createElement(t.Fragment,null,t.createElement(Dt,{cache:r,serialized:v,isStringTag:"string"==typeof o}),t.createElement(o,g))}));return y.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",y.defaultProps=r.defaultProps,y.__emotion_real=y,y.__emotion_base=s,y.__emotion_styles=d,y.__emotion_forwardProp=c,Object.defineProperty(y,"toString",{value:function(){return"."+i}}),y.withComponent=function(t,r){return e(t,ve({},n,r,{shouldForwardProp:Ot(y,r,!0)})).apply(void 0,d)},y}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ft[e]=Ft(e)}));const Tt={"image/png":"89504E47","image/jpeg":"FFD8FF","application/pdf":"25504446","image/gif":"47494638","application/zip":"504B0304","application/msword":"D0CF11E0","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"504B0304","application/vnd.ms-excel":"D0CF11E0","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"504B0304","video/mp4":"00000018","audio/mpeg":"494433","image/svg+xml":"3C3F786D6C"};async function jt(e,t,r){const n=e.name.replace(/[\\/:*?"<>|]+/g,"").replace(/\s+/g,"-").toLowerCase();const o=e.type,i=e.size/1048576,a=n.split("."),s=a.pop()?.toLowerCase();if(a.length>1)return"Suspicious file name detected (multiple extensions).";if(/[\\/:*?"<>|]/.test(n))return"Filename contains forbidden characters.";if(r&&i>r)return`File size exceeds limit (${r}MB).`;if(s&&["php","exe","js","sh","bat","cmd"].includes(s))return`Dangerous file extension detected (.${s}).`;if(t&&!t.includes(o))return`File type not allowed. Allowed types: ${t.join(", ")}`;const c=Tt[o];if(c){const t=await async function(e,t){return new Promise(((r,n)=>{const o=new FileReader;o.onloadend=()=>{const e=o.result,t=new Uint8Array(e),n=Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("").toUpperCase();r(n)},o.onerror=n;const i=e.slice(0,t);o.readAsArrayBuffer(i)}))}(e,c.length/2);if(!t.startsWith(c))return`File content does not match expected type (${o}).`}return null}const Lt=Ft.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #ccc; padding: 24px; border-radius: 12px; cursor: pointer; background-color: #fafafa; transition: background-color 0.3s ease; &:hover { background-color: #f0f0f0; } `,It=Ft.input` display: none; `,Nt=Ft.button` padding: 10px 20px; background-color: #4f46e5; color: white; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.3s ease; &:hover { background-color: #4338ca; } `,Wt=Ft.div` color: red; font-size: 0.9rem; margin-top: 8px; `,Ut=({onSafeFileSelect:e,allowedTypes:t,maxFileSizeMB:r})=>{const n=i(null),[a,s]=o(null);return it(Lt,{onClick:()=>{n.current?.click()},children:[ot(It,{ref:n,type:"file",onChange:async o=>{const i=o.target.files?.[0];if(!i)return;const a=await jt(i,t,r);if(a)return s(a),void(n.current&&(n.current.value=""));s(null),e(i)},accept:t?.join(",")}),ot(Nt,{children:"Select File"}),a&&ot(Wt,{children:a})]})},Xt=e=>{const t=document.createElement("div");return t.textContent=e.trim(),t.innerHTML};function Kt(e){const[t,r]=o(e),n=(e,t)=>{r((r=>({...r,[e]:Xt(t)})))};return{values:t,setSanitizedValue:n,sanitizeAll:()=>Object.keys(t).reduce(((e,r)=>(e[r]=Xt(t[r]),e)),{}),handleChange:e=>t=>{n(e,t.target.value)}}}var qt={exports:{}};var Gt,Vt={exports:{}};function Zt(){return Gt||(Gt=1,Vt.exports=function(){var e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==ye&&ye.crypto&&(r=ye.crypto),!r)try{r=require("crypto")}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),l=i.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},f=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*l,i);if(l){for(var f=0;f<l;f+=a)this._doProcessBlock(o,f);r=o.splice(0,l),n.sigBytes-=u}return new c.init(r,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}});var p=i.algo={};return i}(Math);return e}()),Vt.exports}var Yt,Jt={exports:{}};function Qt(){return Yt||(Yt=1,Jt.exports=function(e){return n=(r=e).lib,o=n.Base,i=n.WordArray,(a=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=o.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=o.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),e;var t,r,n,o,i,a}(Zt())),Jt.exports}var er,tr={exports:{}};function rr(){return er||(er=1,tr.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,r=t.init,n=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,n=[],o=0;o<t;o++)n[o>>>2]|=e[o]<<24-o%4*8;r.call(this,n,t)}else r.apply(this,arguments)};n.prototype=t}}(),e.lib.WordArray}(Zt())),tr.exports}var nr,or={exports:{}};function ir(){return nr||(nr=1,or.exports=function(e){return function(){var t=e,r=t.lib.WordArray,n=t.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=o(t[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return r.create(n,2*t)}}}(),e.enc.Utf16}(Zt())),or.exports}var ar,sr={exports:{}};function cr(){return ar||(ar=1,sr.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var o=[],i=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return r.create(o,i)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(Zt())),sr.exports}var lr,ur={exports:{}};function fr(){return lr||(lr=1,ur.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var o=[],i=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return r.create(o,i)}t.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,o=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<n;c++)i.push(o.charAt(s>>>6*(3-c)&63));var l=o.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,o=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),e.enc.Base64url}(Zt())),ur.exports}var dr,hr={exports:{}};function pr(){return dr||(dr=1,hr.exports=function(e){return function(t){var r=e,n=r.lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],h=e[t+2],p=e[t+3],v=e[t+4],y=e[t+5],g=e[t+6],m=e[t+7],_=e[t+8],b=e[t+9],x=e[t+10],w=e[t+11],k=e[t+12],S=e[t+13],B=e[t+14],C=e[t+15],A=i[0],z=i[1],E=i[2],M=i[3];A=l(A,z,E,M,a,7,s[0]),M=l(M,A,z,E,c,12,s[1]),E=l(E,M,A,z,h,17,s[2]),z=l(z,E,M,A,p,22,s[3]),A=l(A,z,E,M,v,7,s[4]),M=l(M,A,z,E,y,12,s[5]),E=l(E,M,A,z,g,17,s[6]),z=l(z,E,M,A,m,22,s[7]),A=l(A,z,E,M,_,7,s[8]),M=l(M,A,z,E,b,12,s[9]),E=l(E,M,A,z,x,17,s[10]),z=l(z,E,M,A,w,22,s[11]),A=l(A,z,E,M,k,7,s[12]),M=l(M,A,z,E,S,12,s[13]),E=l(E,M,A,z,B,17,s[14]),A=u(A,z=l(z,E,M,A,C,22,s[15]),E,M,c,5,s[16]),M=u(M,A,z,E,g,9,s[17]),E=u(E,M,A,z,w,14,s[18]),z=u(z,E,M,A,a,20,s[19]),A=u(A,z,E,M,y,5,s[20]),M=u(M,A,z,E,x,9,s[21]),E=u(E,M,A,z,C,14,s[22]),z=u(z,E,M,A,v,20,s[23]),A=u(A,z,E,M,b,5,s[24]),M=u(M,A,z,E,B,9,s[25]),E=u(E,M,A,z,p,14,s[26]),z=u(z,E,M,A,_,20,s[27]),A=u(A,z,E,M,S,5,s[28]),M=u(M,A,z,E,h,9,s[29]),E=u(E,M,A,z,m,14,s[30]),A=f(A,z=u(z,E,M,A,k,20,s[31]),E,M,y,4,s[32]),M=f(M,A,z,E,_,11,s[33]),E=f(E,M,A,z,w,16,s[34]),z=f(z,E,M,A,B,23,s[35]),A=f(A,z,E,M,c,4,s[36]),M=f(M,A,z,E,v,11,s[37]),E=f(E,M,A,z,m,16,s[38]),z=f(z,E,M,A,x,23,s[39]),A=f(A,z,E,M,S,4,s[40]),M=f(M,A,z,E,a,11,s[41]),E=f(E,M,A,z,p,16,s[42]),z=f(z,E,M,A,g,23,s[43]),A=f(A,z,E,M,b,4,s[44]),M=f(M,A,z,E,k,11,s[45]),E=f(E,M,A,z,C,16,s[46]),A=d(A,z=f(z,E,M,A,h,23,s[47]),E,M,a,6,s[48]),M=d(M,A,z,E,m,10,s[49]),E=d(E,M,A,z,B,15,s[50]),z=d(z,E,M,A,y,21,s[51]),A=d(A,z,E,M,k,6,s[52]),M=d(M,A,z,E,p,10,s[53]),E=d(E,M,A,z,x,15,s[54]),z=d(z,E,M,A,c,21,s[55]),A=d(A,z,E,M,_,6,s[56]),M=d(M,A,z,E,C,10,s[57]),E=d(E,M,A,z,g,15,s[58]),z=d(z,E,M,A,S,21,s[59]),A=d(A,z,E,M,v,6,s[60]),M=d(M,A,z,E,w,10,s[61]),E=d(E,M,A,z,h,15,s[62]),z=d(z,E,M,A,b,21,s[63]),i[0]=i[0]+A|0,i[1]=i[1]+z|0,i[2]=i[2]+E|0,i[3]=i[3]+M|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;r[o>>>5]|=128<<24-o%32;var i=t.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+o+a;return(s<<i|s>>>32-i)+t}function u(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+o+a;return(s<<i|s>>>32-i)+t}function f(e,t,r,n,o,i,a){var s=e+(t^r^n)+o+a;return(s<<i|s>>>32-i)+t}function d(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+o+a;return(s<<i|s>>>32-i)+t}r.MD5=i._createHelper(c),r.HmacMD5=i._createHmacHelper(c)}(Math),e.MD5}(Zt())),hr.exports}var vr,yr={exports:{}};function gr(){return vr||(vr=1,yr.exports=function(e){return r=(t=e).lib,n=r.W