reactjs-weekdays-picker
Version:
reactjs-weekdays-picker is a highly customizable React library that provides four versatile components for selecting days of the week. Whether you need a simple dropdown, a circular day picker, or a custom menu selector, this package offers flexible and e
32 lines (29 loc) • 26.1 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".dropdown-wrapper{position:relative;display:inline-block;box-sizing:border-box}.dropdown-input{padding:8px;border:0px solid transparent;outline:0;border-radius:4px;cursor:pointer;width:100%;box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.dropdown-popup{position:absolute;top:100%;left:0;background:#fff;border-radius:4px;margin-top:4px;box-sizing:border-box;z-index:1000}.dropdown-item{padding:8px 12px;cursor:pointer;transition:background-color .3s,color .3s}.cms-wrapper{position:relative;display:inline-block}.cms-input{padding:10px;font-size:var(--font-size);color:var(--input-text-color);cursor:pointer;border:0px solid transparent;outline:0px;border-radius:4px}.cms-input:focus{outline:none;border-color:var(--selected-color)}.cms-menu{position:absolute;margin-top:4px;display:none;background-color:#fff;border-radius:4px;overflow:hidden;z-index:1000;animation:fadeIn .3s ease}.cms-menu.show{display:flex}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.cms-day-button{flex:1;padding:10px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;transition:background-color .3s,color .3s;border-radius:0}.cms-day-button:focus{outline:none}.cms-icon,.cms-day-text,.cms-tick{display:flex;align-items:center;justify-content:center}.cms-align-top{flex-direction:column-reverse}.cms-align-bottom{flex-direction:column}.cms-align-left{flex-direction:row-reverse}.cms-align-right{flex-direction:row}.circular-wrapper .plotly .hoverlayer,.circular-wrapper .plotly .pie,.circular-wrapper .plotly .slice{cursor:pointer}.ds-circle-wrapper{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;padding:10px;box-sizing:border-box}.ds-circle{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .3s,color .3s;-webkit-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),gr=require("react-plotly.js");var Oe={exports:{}},le={};/**
* @license React
* react-jsx-runtime.production.min.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.
*/var Ye;function br(){if(Ye)return le;Ye=1;var n=f,a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,p=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,E={key:!0,ref:!0,__self:!0,__source:!0};function P(O,c,w){var y,T={},k=null,F=null;w!==void 0&&(k=""+w),c.key!==void 0&&(k=""+c.key),c.ref!==void 0&&(F=c.ref);for(y in c)i.call(c,y)&&!E.hasOwnProperty(y)&&(T[y]=c[y]);if(O&&O.defaultProps)for(y in c=O.defaultProps,c)T[y]===void 0&&(T[y]=c[y]);return{$$typeof:a,type:O,key:k,ref:F,props:T,_owner:p.current}}return le.Fragment=o,le.jsx=P,le.jsxs=P,le}var ce={};/**
* @license React
* react-jsx-runtime.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.
*/var Le;function hr(){return Le||(Le=1,process.env.NODE_ENV!=="production"&&function(){var n=f,a=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),O=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),G=Symbol.iterator,U="@@iterator";function X(e){if(e===null||typeof e!="object")return null;var r=G&&e[G]||e[U];return typeof r=="function"?r:null}var M=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];H("error",e,t)}}function H(e,r,t){{var u=M.ReactDebugCurrentFrame,v=u.getStackAddendum();v!==""&&(r+="%s",t=t.concat([v]));var b=t.map(function(l){return String(l)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var Z=!1,V=!1,S=!1,D=!1,A=!1,Y;Y=Symbol.for("react.module.reference");function g(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===E||A||e===p||e===w||e===y||D||e===F||Z||V||S||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===T||e.$$typeof===P||e.$$typeof===O||e.$$typeof===c||e.$$typeof===Y||e.getModuleId!==void 0))}function L(e,r,t){var u=e.displayName;if(u)return u;var v=r.displayName||r.name||"";return v!==""?t+"("+v+")":t}function N(e){return e.displayName||"Context"}function d(e){if(e==null)return null;if(typeof e.tag=="number"&&m("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 i:return"Fragment";case o:return"Portal";case E:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return N(r)+".Consumer";case P:var t=e;return N(t._context)+".Provider";case c:return L(e,e.render,"ForwardRef");case T:var u=e.displayName||null;return u!==null?u:d(e.type)||"Memo";case k:{var v=e,b=v._payload,l=v._init;try{return d(l(b))}catch{return null}}}return null}var j=Object.assign,C=0,Q,z,ee,K,re,fe,te;function de(){}de.__reactDisabledLog=!0;function he(){{if(C===0){Q=console.log,z=console.info,ee=console.warn,K=console.error,re=console.group,fe=console.groupCollapsed,te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}C++}}function ve(){{if(C--,C===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:Q}),info:j({},e,{value:z}),warn:j({},e,{value:ee}),error:j({},e,{value:K}),group:j({},e,{value:re}),groupCollapsed:j({},e,{value:fe}),groupEnd:j({},e,{value:te})})}C<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=M.ReactCurrentDispatcher,ue;function h(e,r,t){{if(ue===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);ue=u&&u[1]||""}return`
`+ue+e}}var R=!1,I;{var q=typeof WeakMap=="function"?WeakMap:Map;I=new q}function je(e,r){if(!e||R)return"";{var t=I.get(e);if(t!==void 0)return t}var u;R=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=ae.current,ae.current=null,he();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(B){u=B}Reflect.construct(e,[],l)}else{try{l.call()}catch(B){u=B}e.call(l.prototype)}}else{try{throw Error()}catch(B){u=B}e()}}catch(B){if(B&&u&&typeof B.stack=="string"){for(var s=B.stack.split(`
`),W=u.stack.split(`
`),_=s.length-1,x=W.length-1;_>=1&&x>=0&&s[_]!==W[x];)x--;for(;_>=1&&x>=0;_--,x--)if(s[_]!==W[x]){if(_!==1||x!==1)do if(_--,x--,x<0||s[_]!==W[x]){var J=`
`+s[_].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),typeof e=="function"&&I.set(e,J),J}while(_>=1&&x>=0);break}}}finally{R=!1,ae.current=b,ve(),Error.prepareStackTrace=v}var ie=e?e.displayName||e.name:"",ne=ie?h(ie):"";return typeof e=="function"&&I.set(e,ne),ne}function qe(e,r,t){return je(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function pe(e,r,t){if(e==null)return"";if(typeof e=="function")return je(e,Je(e));if(typeof e=="string")return h(e);switch(e){case w:return h("Suspense");case y:return h("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return qe(e.render);case T:return pe(e.type,r,t);case k:{var u=e,v=u._payload,b=u._init;try{return pe(b(v),r,t)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,xe={},Se=M.ReactDebugCurrentFrame;function me(e){if(e){var r=e._owner,t=pe(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(t)}else Se.setExtraStackFrame(null)}function Ge(e,r,t,u,v){{var b=Function.call.bind(se);for(var l in e)if(b(e,l)){var s=void 0;try{if(typeof e[l]!="function"){var W=Error((u||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw W.name="Invariant Violation",W}s=e[l](r,l,u,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){s=_}s&&!(s instanceof Error)&&(me(v),m("%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).",u||"React class",t,l,typeof s),me(null)),s instanceof Error&&!(s.message in xe)&&(xe[s.message]=!0,me(v),m("Failed %s type: %s",t,s.message),me(null))}}}var Xe=Array.isArray;function ye(e){return Xe(e)}function ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return Pe(e),!1}catch{return!0}}function Pe(e){return""+e}function Te(e){if(He(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ze(e)),Pe(e)}var ke=M.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},Ce,De;function Qe(e){if(se.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(se.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){typeof e.ref=="string"&&ke.current}function tr(e,r){{var t=function(){Ce||(Ce=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function nr(e,r){{var t=function(){De||(De=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ar=function(e,r,t,u,v,b,l){var s={$$typeof:a,type:e,key:r,ref:t,props:l,_owner:b};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function or(e,r,t,u,v){{var b,l={},s=null,W=null;t!==void 0&&(Te(t),s=""+t),er(r)&&(Te(r.key),s=""+r.key),Qe(r)&&(W=r.ref,rr(r,v));for(b in r)se.call(r,b)&&!Ze.hasOwnProperty(b)&&(l[b]=r[b]);if(e&&e.defaultProps){var _=e.defaultProps;for(b in _)l[b]===void 0&&(l[b]=_[b])}if(s||W){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&tr(l,x),W&&nr(l,x)}return ar(e,s,W,v,u,ke.current,l)}}var Ee=M.ReactCurrentOwner,Fe=M.ReactDebugCurrentFrame;function oe(e){if(e){var r=e._owner,t=pe(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(t)}else Fe.setExtraStackFrame(null)}var we;we=!1;function Re(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Me(){{if(Ee.current){var e=d(Ee.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function ir(e){return""}var Ae={};function ur(e){{var r=Me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
Check the top-level render call using <`+t+">.")}return r}}function Ne(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Ae[t])return;Ae[t]=!0;var u="";e&&e._owner&&e._owner!==Ee.current&&(u=" It was passed a child from "+d(e._owner.type)+"."),oe(e),m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,u),oe(null)}}function Ie(e,r){{if(typeof e!="object")return;if(ye(e))for(var t=0;t<e.length;t++){var u=e[t];Re(u)&&Ne(u,r)}else if(Re(e))e._store&&(e._store.validated=!0);else if(e){var v=X(e);if(typeof v=="function"&&v!==e.entries)for(var b=v.call(e),l;!(l=b.next()).done;)Re(l.value)&&Ne(l.value,r)}}}function sr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===T))t=r.propTypes;else return;if(t){var u=d(r);Ge(t,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!we){we=!0;var v=d(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var u=r[t];if(u!=="children"&&u!=="key"){oe(e),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),oe(null);break}}e.ref!==null&&(oe(e),m("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}}var We={};function $e(e,r,t,u,v,b){{var l=g(e);if(!l){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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 W=ir();W?s+=W:s+=Me();var _;e===null?_="null":ye(e)?_="array":e!==void 0&&e.$$typeof===a?(_="<"+(d(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,s)}var x=or(e,r,t,v,b);if(x==null)return x;if(l){var J=r.children;if(J!==void 0)if(u)if(ye(J)){for(var ie=0;ie<J.length;ie++)Ie(J[ie],e);Object.freeze&&Object.freeze(J)}else m("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 Ie(J,e)}if(se.call(r,"key")){var ne=d(e),B=Object.keys(r).filter(function(mr){return mr!=="key"}),_e=B.length>0?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}";if(!We[ne+_e]){var pr=B.length>0?"{"+B.join(": ..., ")+": ...}":"{}";m(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,_e,ne,pr,ne),We[ne+_e]=!0}}return e===i?lr(x):sr(x),x}}function cr(e,r,t){return $e(e,r,t,!0)}function fr(e,r,t){return $e(e,r,t,!1)}var dr=fr,vr=cr;ce.Fragment=i,ce.jsx=dr,ce.jsxs=vr}()),ce}process.env.NODE_ENV==="production"?Oe.exports=br():Oe.exports=hr();var $=Oe.exports;const yr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Er=({multiple:n=!1,dayList:a=yr,state:o,setState:i,onDayChange:p,selectedColor:E="#007bff",unselectedColor:P="#d3d3d3",selectedHoverColor:O="#0056b3",unselectedHoverColor:c="#f0f0f0",width:w="150px",fontSize:y="16px",fontWeight:T="400",fontStyle:k="normal",selectedTextColor:F="#fff",unselectedTextColor:G="#000",inputTextColor:U="#000",placeholder:X="Select days",inputBgColor:M="#fff",inputBoxStyle:m={},dropdownContainerStyle:H={},dropdownItemStyle:Z={}})=>{const[V,S]=f.useState(o||[]),[D,A]=f.useState(!1),Y=f.useRef(null),g=d=>{let j;n?j=V.includes(d)?V.filter(C=>C!==d):[...V,d]:j=[d],S(j),i==null||i(j),p==null||p(j)},L=()=>A(!D),N=d=>{Y.current&&!Y.current.contains(d.target)&&A(!1)};return f.useEffect(()=>(document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)),[]),$.jsxs("div",{ref:Y,className:"dropdown-wrapper",style:{width:`max(${w}, 150px)`},children:[$.jsx("input",{type:"text",readOnly:!0,value:V.join(", "),onClick:L,placeholder:X,className:"dropdown-input",style:{fontSize:y,fontWeight:T,fontStyle:k,color:U,backgroundColor:M,...m}}),D&&$.jsx("div",{className:"dropdown-popup",style:{width:"100%",...H},children:a.map((d,j)=>{const C=V.includes(d);return $.jsx("div",{className:"dropdown-item",onClick:()=>g(d),style:{backgroundColor:C?E:P,color:C?F:G,...Z},onMouseEnter:Q=>Q.currentTarget.style.backgroundColor=C?O:c,onMouseLeave:Q=>Q.currentTarget.style.backgroundColor=C?E:P,children:d},j)})})]})};var Ve={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Be=f.createContext&&f.createContext(Ve),wr=["attr","size","title"];function Rr(n,a){if(n==null)return{};var o=_r(n,a),i,p;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(n);for(p=0;p<E.length;p++)i=E[p],!(a.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(o[i]=n[i])}return o}function _r(n,a){if(n==null)return{};var o={};for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){if(a.indexOf(i)>=0)continue;o[i]=n[i]}return o}function ge(){return ge=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])}return n},ge.apply(this,arguments)}function Ue(n,a){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);a&&(i=i.filter(function(p){return Object.getOwnPropertyDescriptor(n,p).enumerable})),o.push.apply(o,i)}return o}function be(n){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Ue(Object(o),!0).forEach(function(i){Or(n,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Ue(Object(o)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(o,i))})}return n}function Or(n,a,o){return a=jr(a),a in n?Object.defineProperty(n,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[a]=o,n}function jr(n){var a=xr(n,"string");return typeof a=="symbol"?a:a+""}function xr(n,a){if(typeof n!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var i=o.call(n,a);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}function Ke(n){return n&&n.map((a,o)=>f.createElement(a.tag,be({key:o},a.attr),Ke(a.child)))}function Sr(n){return a=>f.createElement(Pr,ge({attr:be({},n.attr)},a),Ke(n.child))}function Pr(n){var a=o=>{var{attr:i,size:p,title:E}=n,P=Rr(n,wr),O=p||o.size||"1em",c;return o.className&&(c=o.className),n.className&&(c=(c?c+" ":"")+n.className),f.createElement("svg",ge({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,i,P,{className:c,style:be(be({color:n.color||o.color},o.style),n.style),height:O,width:O,xmlns:"http://www.w3.org/2000/svg"}),E&&f.createElement("title",null,E),n.children)};return Be!==void 0?f.createElement(Be.Consumer,null,o=>a(o)):a(Ve)}function Tr(n){return Sr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(n)}const kr={Sun:"🌞",Mon:"🌛",Tue:"🌮",Wed:"🍹",Thu:"🎉",Fri:"🍻",Sat:"🎨"},Cr=({dayList:n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],state:a=null,setState:o=null,onDayChange:i=null,selectedColor:p="#007bff",unselectedColor:E="#ffffff",selectedHoverColor:P="#0056b3",unselectedHoverColor:O="#f0f0f0",width:c="auto",fontSize:w="16px",fontWeight:y="normal",fontStyle:T="normal",selectedTextColor:k="#ffffff",unselectedTextColor:F="#333333",inputTextColor:G="#000000",placeholder:U="Select days",multiple:X=!1,iconAlign:M="right",displayOption:m="both",showIcons:H=!0,showTicks:Z=!0,excludeDays:V=[],tickOrder:S=3,dayOrder:D=2,iconOrder:A=1,inputBgColor:Y="#fff",inputBoxStyle:g={},dropdownContainerStyle:L={},dropdownItemStyle:N={}})=>{const[d,j]=f.useState(!1),[C,Q]=f.useState(a||[]),[z,ee]=f.useState({top:"auto",left:"auto",right:"auto",bottom:"auto",flexDirection:"row"}),K=f.useRef(null),re=f.useRef(null),fe=window.innerHeight,te=window.innerWidth,de={...kr},he=h=>{let R;C.includes(h)?R=C.filter(I=>I!==h):R=X?[...C,h]:[h],Q(R),o==null||o(R),i==null||i(R)},ve=h=>{K.current&&!K.current.contains(h.target)&&j(!1)};function ae(){if(!K.current)return{width:0,height:0};const h=K.current.style.display;K.current.style.display="flex";const R=K.current.getBoundingClientRect();return K.current.style.display=h,{width:R.width,height:R.height}}const ue=()=>{if(re.current&&K.current){const h=re.current.getBoundingClientRect(),{width:R,height:I}=ae();h.left+R<=te?ee(q=>({...q,left:"0"})):te-h.right+R<=te?ee(q=>({...q,right:"0",flexDirection:"row-reverse"})):R+20<=te?ee(q=>({...q,right:`-${te-h.right-10}px`})):ee(q=>({...q,left:"0",right:"0",flexDirection:"column"}))}};return f.useEffect(()=>{ue()},[]),f.useEffect(()=>{if(re.current&&K.current){const h=re.current.getBoundingClientRect(),{height:R}=ae();h.bottom+R>fe&&ee(I=>({...I,top:`-${R}px`,flexDirection:"column-reverse"}))}},[z.left,z.right]),f.useEffect(()=>(document.addEventListener("mousedown",ve),()=>document.removeEventListener("mousedown",ve)),[]),$.jsxs("div",{className:"cms-wrapper",children:[$.jsx("input",{ref:re,readOnly:!0,className:"cms-input",value:C.join(", "),onClick:()=>!d&&j(!0),placeholder:U,style:{fontSize:w,color:G,borderColor:p,fontWeight:y,fontStyle:T,backgroundColor:Y,...g}}),$.jsx("div",{ref:K,className:`cms-menu ${d?"show":""}`,style:{width:c,top:z.top,left:z.left,right:z.right,bottom:z.bottom,flexDirection:z.flexDirection,...L},children:n.map((h,R)=>{if(V.includes(h))return null;const I=C.includes(h);return $.jsxs("button",{onClick:()=>he(h),className:`cms-day-button cms-align-${M}`,style:{backgroundColor:I?p:E,color:I?k:F,fontSize:w,fontWeight:y,...N},onMouseEnter:q=>q.currentTarget.style.backgroundColor=I?P:O,onMouseLeave:q=>q.currentTarget.style.backgroundColor=I?p:E,children:[H&&m!=="word"&&$.jsx("span",{className:"cms-icon",style:{order:A},children:de[h]}),m!=="icon"&&$.jsx("span",{className:"cms-day-text",style:{order:D},children:h}),Z&&$.jsx(Tr,{className:"cms-tick",style:{order:S,visibility:I?"visible":"hidden"}})]},R)})})]})},Dr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Fr=({multiple:n=!1,dayList:a=Dr,state:o=null,setState:i=null,onDayChange:p=null,selectedColor:E="#007bff",unselectedColor:P="#d3d3d3",selectedHoverColor:O="#0056b3",unselectedHoverColor:c="#f0f0f0",size:w=300,fontSize:y="14px",fontWeight:T="400",fontStyle:k="normal",selectedTextColor:F="#fff",unselectedTextColor:G="#000"})=>{const[U,X]=f.useState(o||[]),[M,m]=f.useState(null),[H,Z]=f.useState(0),V=f.useMemo(()=>({displayModeBar:!1,displaylogo:!1,modeBarButtonsToRemove:["toImage"]}),[]),S=f.useMemo(()=>({height:typeof w=="number"?w:parseFloat(w),width:typeof w=="number"?w:parseFloat(w),margin:{t:0,b:0,l:0,r:0},showlegend:!1,paper_bgcolor:"transparent",plot_bgcolor:"#ed1919ff",font:{size:parseFloat(y),color:F,family:"Arial, sans-serif",weight:T,style:k}}),[w,y,T,k,F]),D=f.useCallback(g=>{X(L=>{const N=o||L;let d;return n?N.includes(g)?d=N.filter(j=>j!==g):d=[...N,g]:d=N.includes(g)?[]:[g],i?i(d):X(d),p&&p(d),d})},[n,o,i,p]),A=f.useMemo(()=>[{type:"pie",values:Array(a.length).fill(1),labels:a,textinfo:"label",textposition:"inside",automargin:!0,marker:{colors:a.map(g=>g===M?(o||U).includes(g)?O:c:(o||U).includes(g)?E:P)},hoverinfo:"label",hoverlabel:{bgcolor:a.map(g=>(o||U).includes(g)?O:c)},insidetextfont:{color:a.map(g=>(o||U).includes(g)?F:G)}}],[a,U,o,E,P,O,c,F,G,M]),Y=f.useCallback(g=>{if(g.points&&g.points.length>0){const L=g.points[0].label;D(L)}else console.warn("No points clicked")},[D]);return f.useEffect(()=>{Z(g=>g+1)},[]),$.jsx("div",{children:$.jsx(gr,{data:A,layout:S,config:V,onClick:Y,"aria-label":"Circular day selector",style:{cursor:"pointer"},onHover:g=>{var N;const L=(N=g.points)==null?void 0:N[0];L!=null&&L.label&&m(L.label)},onUnhover:()=>m(null)},H)})},Mr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ar=({multiple:n=!1,dayList:a=Mr,state:o=null,setState:i=null,onDayChange:p=null,selectedColor:E="#007bff",unselectedColor:P="#d3d3d3",selectedHoverColor:O="#0056b3",unselectedHoverColor:c="#f0f0f0",selectedTextColor:w="#fff",unselectedTextColor:y="#000",width:T="200px",displayLength:k=1,fontSize:F="16px",fontWeight:G="400",fontStyle:U="normal",optionContainerStyle:X={},optionStyle:M={}})=>{const[m,H]=f.useState(o||[]),Z=S=>{let D;n?D=m.includes(S)?m.filter(A=>A!==S):[...m,S]:D=[S],H(D),i==null||i(D),p==null||p(D)},V=S=>k&&k>0?S.slice(0,k):S;return $.jsx("div",{className:"ds-circle-wrapper",style:{width:T,...X},children:a.map((S,D)=>{const A=m.includes(S);return $.jsx("div",{className:"ds-circle",onClick:()=>Z(S),style:{backgroundColor:A?E:P,color:A?w:y,fontSize:F,fontWeight:G,fontStyle:U,...M},onMouseEnter:Y=>{Y.currentTarget.style.backgroundColor=A?O:c},onMouseLeave:Y=>{Y.currentTarget.style.backgroundColor=A?E:P},children:V(S)},D)})})};exports.CircularSelector=Fr;exports.CustomMenuSelector=Cr;exports.DefaultSelector=Ar;exports.DropdownSelector=Er;