@crystaldesign/diva-support 25.4.0-beta.27 → 25.4.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 953.diva-support.umd.min.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[953],{7186:(e,t,n)=>{"use strict";n.d(t,{Z:()=>O});var a=n(7363),r=n(7726),o=n(4062),i=n(9074),s=n(1522),c=n(4039),l=n(7843),d=n(8815),f=n(5739),u=n(883),h=n(3966),p=n(431);function getSwitchBaseUtilityClass(e){return(0,p.ZP)("PrivateSwitchBase",e)}(0,h.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var m=n(7514);const g=(0,l.ZP)(u.Z)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),w=(0,l.ZP)("input",{shouldForwardProp:c.Z})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),v=a.forwardRef((function SwitchBase(e,t){const{autoFocus:n,checked:a,checkedIcon:i,className:c,defaultChecked:l,disabled:u,disableFocusRipple:h=!1,edge:p=!1,icon:v,id:y,inputProps:k,inputRef:S,name:b,onBlur:C,onChange:x,onFocus:z,readOnly:Z,required:R=!1,tabIndex:F,type:M,value:E,...O}=e,[P,I]=(0,d.Z)({controlled:a,default:Boolean(l),name:"SwitchBase",state:"checked"}),j=(0,f.Z)();let q=u;j&&void 0===q&&(q=j.disabled);const B="checkbox"===M||"radio"===M,$={...e,checked:P,disabled:q,disableFocusRipple:h,edge:p},T=(e=>{const{classes:t,checked:n,disabled:a,edge:r}=e,i={root:["root",n&&"checked",a&&"disabled",r&&`edge${(0,s.Z)(r)}`],input:["input"]};return(0,o.Z)(i,getSwitchBaseUtilityClass,t)})($);return(0,m.jsxs)(g,{component:"span",className:(0,r.Z)(T.root,c),centerRipple:!0,focusRipple:!h,disabled:q,tabIndex:null,role:void 0,onFocus:e=>{z&&z(e),j&&j.onFocus&&j.onFocus(e)},onBlur:e=>{C&&C(e),j&&j.onBlur&&j.onBlur(e)},ownerState:$,ref:t,...O,children:[(0,m.jsx)(w,{autoFocus:n,checked:a,defaultChecked:l,className:T.input,disabled:q,id:B?y:void 0,name:b,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;I(t),x&&x(e,t)},readOnly:Z,ref:S,required:R,ownerState:$,tabIndex:F,type:M,..."checkbox"===M&&void 0===E?{}:{value:E},...k}),P?i:v]})}));var y=n(6177);const k=(0,y.Z)((0,m.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),S=(0,y.Z)((0,m.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),b=(0,y.Z)((0,m.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(e){return(0,p.ZP)("MuiCheckbox",e)}const C=(0,h.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var x=n(518),z=n(8981),Z=n(2893);const R=(0,l.ZP)(v,{shouldForwardProp:e=>(0,c.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,s.Z)(n.size)}`],"default"!==n.color&&t[`color${(0,s.Z)(n.color)}`]]}})((0,x.Z)((({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,i.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,z.Z)()).map((([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,i.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}}))),...Object.entries(e.palette).filter((0,z.Z)()).map((([t])=>({props:{color:t},style:{[`&.${C.checked}, &.${C.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${C.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}))),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})))),F=(0,m.jsx)(S,{}),M=(0,m.jsx)(k,{}),E=(0,m.jsx)(b,{}),O=a.forwardRef((function Checkbox(e,t){const n=(0,Z.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:i=F,color:c="primary",icon:l=M,indeterminate:d=!1,indeterminateIcon:f=E,inputProps:u,size:h="medium",disableRipple:p=!1,className:g,...w}=n,v=d?f:l,y=d?f:i,k={...n,disableRipple:p,color:c,indeterminate:d,size:h},S=(e=>{const{classes:t,indeterminate:n,color:a,size:r}=e,i={root:["root",n&&"indeterminate",`color${(0,s.Z)(a)}`,`size${(0,s.Z)(r)}`]},c=(0,o.Z)(i,getCheckboxUtilityClass,t);return{...t,...c}})(k);return(0,m.jsx)(R,{type:"checkbox",inputProps:{"data-indeterminate":d,...u},icon:a.cloneElement(v,{fontSize:v.props.fontSize??h}),checkedIcon:a.cloneElement(y,{fontSize:y.props.fontSize??h}),ownerState:k,ref:t,className:(0,r.Z)(S.root,g),disableRipple:p,...w,classes:S})}))},8942:(e,t,n)=>{var a=n(5108),r="undefined"!=typeof Element,o="function"==typeof Map,i="function"==typeof Set,s="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,a,c,l;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(!equal(e[a],t[a]))return!1;return!0}if(o&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(l=e.entries();!(a=l.next()).done;)if(!t.has(a.value[0]))return!1;for(l=e.entries();!(a=l.next()).done;)if(!equal(a.value[1],t.get(a.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(l=e.entries();!(a=l.next()).done;)if(!t.has(a.value[0]))return!1;return!0}if(s&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(a=n;0!=a--;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((n=(c=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(t,c[a]))return!1;if(r&&e instanceof Element)return!1;for(a=n;0!=a--;)if(("_owner"!==c[a]&&"__v"!==c[a]&&"__o"!==c[a]||!e.$$typeof)&&!equal(e[c[a]],t[c[a]]))return!1;return!0}return e!=e&&t!=t}e.exports=function isEqual(e,t){try{return equal(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return a.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},4376:(e,t,n)=>{"use strict";n.d(t,{Z:()=>lib_Snowfall});var a=n(7363),r=n(8942);function random(e,t){const n=Math.random()*(t-e+1)+e;return Number.isInteger(e)&&Number.isInteger(t)?Math.floor(n):n}function lerp(e,t,n){return(1-n)*e+n*t}function getSize(e){return e?{height:e.offsetHeight,width:e.offsetWidth}:{height:0,width:0}}const o=2*Math.PI,i={color:"#dee4fd",radius:[.5,3],speed:[1,3],wind:[-.5,2],changeFrequency:200,rotationSpeed:[-1,1],opacity:[1,1]};class Snowflake{static createSnowflakes(e,t,n){if(!e)return[];const a=[];for(let r=0;r<t;r++)a.push(new Snowflake(e,n));return a}constructor(e,t={}){this.updateConfig(t);const{radius:n,wind:a,speed:r,rotationSpeed:o,opacity:i}=this.config;this.params={x:random(0,e.offsetWidth),y:random(-e.offsetHeight,0),rotation:random(0,360),radius:random(...n),speed:random(...r),wind:random(...a),rotationSpeed:random(...o),nextSpeed:random(...r),nextWind:random(...a),nextRotationSpeed:random(...o),opacity:random(...i)},this.framesSinceLastUpdate=0}selectImage(){this.config.images&&this.config.images.length>0?this.image=function randomElement(e){return e[Math.floor(Math.random()*e.length)]}(this.config.images):this.image=void 0}updateConfig(e){const t=this.config;this.config={...i,...e},this.config.changeFrequency=random(this.config.changeFrequency,1.5*this.config.changeFrequency),this.params&&!r(this.config.radius,null==t?void 0:t.radius)&&(this.params.radius=random(...this.config.radius)),r(this.config.images,null==t?void 0:t.images)||this.selectImage()}updateTargetParams(){this.params.nextSpeed=random(...this.config.speed),this.params.nextWind=random(...this.config.wind),this.image&&(this.params.nextRotationSpeed=random(...this.config.rotationSpeed))}update(e,t,n=1){const{x:a,y:r,rotation:o,rotationSpeed:i,nextRotationSpeed:s,wind:c,speed:l,nextWind:d,nextSpeed:f,radius:u}=this.params;this.params.x=(a+c*n)%(e+2*u),this.params.x>e+u&&(this.params.x=-u),this.params.y=(r+l*n)%(t+2*u),this.params.y>t+u&&(this.params.y=-u),this.image&&(this.params.rotation=(o+i)%360),this.params.speed=lerp(l,f,.01),this.params.wind=lerp(c,d,.01),this.params.rotationSpeed=lerp(i,s,.01),this.framesSinceLastUpdate++>this.config.changeFrequency&&(this.updateTargetParams(),this.framesSinceLastUpdate=0)}getImageOffscreenCanvas(e,t){var n,a;if(e instanceof HTMLImageElement&&e.loading)return e;let r=Snowflake.offscreenCanvases.get(e);if(r||(r={},Snowflake.offscreenCanvases.set(e,r)),!(t in r)){const a=document.createElement("canvas");a.width=t,a.height=t,null===(n=a.getContext("2d"))||void 0===n||n.drawImage(e,0,0,t,t),r[t]=a}return null!==(a=r[t])&&void 0!==a?a:e}drawCircle(e){e.moveTo(this.params.x,this.params.y),e.arc(this.params.x,this.params.y,this.params.radius,0,o)}drawImage(e){const{x:t,y:n,rotation:a,radius:r}=this.params,o=a*Math.PI/180,i=Math.cos(o),s=Math.sin(o);1!==this.params.opacity&&(e.save(),e.globalAlpha=this.params.opacity),e.setTransform(i,s,-s,i,t,n);const c=this.getImageOffscreenCanvas(this.image,r);e.drawImage(c,-r/2,-r/2,r,r),1!==this.params.opacity&&e.restore()}}Snowflake.offscreenCanvases=new WeakMap;const s=Snowflake,c={pointerEvents:"none",backgroundColor:"transparent",position:"absolute",top:0,left:0,width:"100%",height:"100%"};var l,d,__classPrivateFieldGet=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)},__classPrivateFieldSet=function(e,t,n,a,r){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?r.call(e,n):r?r.value=n:t.set(e,n),n};class SnowfallCanvas{get ctx(){return __classPrivateFieldGet(this,l,"f")}get canvas(){return __classPrivateFieldGet(this,d,"f")}set canvas(e){__classPrivateFieldSet(this,d,e,"f"),__classPrivateFieldSet(this,l,e.getContext("2d"),"f")}constructor(e,t){this.lastUpdate=Date.now(),this.snowflakes=[],l.set(this,void 0),d.set(this,void 0),__classPrivateFieldSet(this,d,e,"f"),__classPrivateFieldSet(this,l,e.getContext("2d"),"f"),this.config={snowflakeCount:150,...i,...t},this.snowflakes=[],this.snowflakes=s.createSnowflakes(e,t.snowflakeCount||150,t),this.play()}updateConfig(e){this.config={...this.config,...e};const t=this.config.snowflakeCount-this.snowflakes.length;t>0&&(this.snowflakes=[...this.snowflakes,...s.createSnowflakes(this.canvas,t,e)]),t<0&&(this.snowflakes=this.snowflakes.slice(0,this.config.snowflakeCount));for(const e of this.snowflakes)e.updateConfig(this.config)}render(e=1){const{ctx:t,canvas:n,snowflakes:a}=this;if(!t||!n)return;const{offsetWidth:r,offsetHeight:o}=n;for(const t of a)t.update(r,o,e);if(t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,r,o),this.config.images&&this.config.images.length>0)for(const e of a)e.drawImage(t);else{t.beginPath();for(const e of a)e.drawCircle(t);t.fillStyle=this.config.color,t.fill()}}loop(){const e=Date.now(),t=Date.now()-this.lastUpdate;this.lastUpdate=e;const n=t/16.666666666666668;this.render(n),this.animationFrame=requestAnimationFrame((()=>this.loop()))}play(){this.loop()}pause(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0)}}l=new WeakMap,d=new WeakMap;function useDeepMemo(e){const[t,n]=(0,a.useState)(e);return function useDeepCompareEffect(e,t){const n=(0,a.useRef)(t);return r(t,n.current)||(n.current=t),(0,a.useEffect)(e,n.current)}((()=>n(e)),[e]),t}const lib_Snowfall=({color:e=i.color,changeFrequency:t=i.changeFrequency,radius:n=i.radius,speed:r=i.speed,wind:o=i.wind,rotationSpeed:s=i.rotationSpeed,opacity:l=i.opacity,snowflakeCount:d=150,images:f,style:u}={})=>{const h=(p=u,(0,a.useMemo)((()=>({...c,...p||{}})),[p]));var p;const m=(0,a.useRef)(null),g=(e=>{const[t,n]=(0,a.useState)(getSize(e.current)),r=(0,a.useCallback)((()=>{e.current&&n(getSize(e.current))}),[e]);return(0,a.useEffect)((()=>{const{ResizeObserver:t}=window;if(e.current){if(r(),"function"==typeof t){const n=new t(r);return n.observe(e.current),()=>n.disconnect()}return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)}}),[e,r]),t})(m),w=useDeepMemo({color:e,changeFrequency:t,radius:n,speed:r,wind:o,rotationSpeed:s,images:f,snowflakeCount:d,opacity:l}),v=(0,a.useRef)(w),y=(0,a.useRef)();return(0,a.useEffect)((()=>(!y.current&&m.current&&(y.current=new SnowfallCanvas(m.current,v.current)),()=>{var e;null===(e=y.current)||void 0===e||e.pause(),y.current=void 0})),[]),(0,a.useEffect)((()=>{y.current&&y.current.updateConfig(w)}),[w]),a.createElement("canvas",{ref:m,height:g.height,width:g.width,style:h,"data-testid":"SnowfallCanvas"})}}}]);
|
|
2
|
+
(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[953],{7186:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var o=n(7363),r=n(7726),a=n(4062),s=n(9074),i=n(1522),c=n(4039),l=n(7843),d=n(8815),f=n(5739),u=n(883),p=n(3966),h=n(431);function getSwitchBaseUtilityClass(e){return(0,h.ZP)("PrivateSwitchBase",e)}(0,p.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var m=n(7562),g=n(7514);const w=(0,l.ZP)(u.Z)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),v=(0,l.ZP)("input",{shouldForwardProp:c.Z})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),y=o.forwardRef((function SwitchBase(e,t){const{autoFocus:n,checked:o,checkedIcon:r,defaultChecked:s,disabled:c,disableFocusRipple:l=!1,edge:u=!1,icon:p,id:h,inputProps:y,inputRef:k,name:S,onBlur:b,onChange:C,onFocus:x,readOnly:P,required:z=!1,tabIndex:F,type:Z,value:R,slots:M={},slotProps:E={},...O}=e,[I,j]=(0,d.Z)({controlled:o,default:Boolean(s),name:"SwitchBase",state:"checked"}),B=(0,f.Z)();let q=c;B&&void 0===q&&(q=B.disabled);const T="checkbox"===Z||"radio"===Z,$={...e,checked:I,disabled:q,disableFocusRipple:l,edge:u},L=(e=>{const{classes:t,checked:n,disabled:o,edge:r}=e,s={root:["root",n&&"checked",o&&"disabled",r&&`edge${(0,i.Z)(r)}`],input:["input"]};return(0,a.Z)(s,getSwitchBaseUtilityClass,t)})($),U={slots:M,slotProps:{input:y,...E}},[A,H]=(0,m.Z)("root",{ref:t,elementType:w,className:L.root,shouldForwardComponentProp:!0,externalForwardedProps:{...U,component:"span",...O},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{x&&x(e),B&&B.onFocus&&B.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{b&&b(e),B&&B.onBlur&&B.onBlur(e)})(t)}}),ownerState:$,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:q,role:void 0,tabIndex:null}}),[W,D]=(0,m.Z)("input",{ref:k,elementType:v,className:L.input,externalForwardedProps:U,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;j(t),C&&C(e,t)})(t)}}),ownerState:$,additionalProps:{autoFocus:n,checked:o,defaultChecked:s,disabled:q,id:T?h:void 0,name:S,readOnly:P,required:z,tabIndex:F,type:Z,..."checkbox"===Z&&void 0===R?{}:{value:R}}});return(0,g.jsxs)(A,{...H,children:[(0,g.jsx)(W,{...D}),I?r:p]})}));var k=n(6177);const S=(0,k.Z)((0,g.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),b=(0,k.Z)((0,g.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),C=(0,k.Z)((0,g.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(e){return(0,h.ZP)("MuiCheckbox",e)}const x=(0,p.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var P=n(518),z=n(8981),F=n(2893),Z=n(85);const R=(0,l.ZP)(y,{shouldForwardProp:e=>(0,c.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,i.Z)(n.size)}`],"default"!==n.color&&t[`color${(0,i.Z)(n.color)}`]]}})((0,P.Z)((({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,s.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,z.Z)()).map((([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,s.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}}))),...Object.entries(e.palette).filter((0,z.Z)()).map((([t])=>({props:{color:t},style:{[`&.${x.checked}, &.${x.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${x.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}))),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})))),M=(0,g.jsx)(b,{}),E=(0,g.jsx)(S,{}),O=(0,g.jsx)(C,{}),I=o.forwardRef((function Checkbox(e,t){const n=(0,F.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:s=M,color:c="primary",icon:l=E,indeterminate:d=!1,indeterminateIcon:f=O,inputProps:u,size:p="medium",disableRipple:h=!1,className:w,slots:v={},slotProps:y={},...k}=n,S=d?f:l,b=d?f:s,C={...n,disableRipple:h,color:c,indeterminate:d,size:p},x=(e=>{const{classes:t,indeterminate:n,color:o,size:r}=e,s={root:["root",n&&"indeterminate",`color${(0,i.Z)(o)}`,`size${(0,i.Z)(r)}`]},c=(0,a.Z)(s,getCheckboxUtilityClass,t);return{...t,...c}})(C),P=y.input??u,[z,I]=(0,m.Z)("root",{ref:t,elementType:R,className:(0,r.Z)(x.root,w),shouldForwardComponentProp:!0,externalForwardedProps:{slots:v,slotProps:y,...k},ownerState:C,additionalProps:{type:"checkbox",icon:o.cloneElement(S,{fontSize:S.props.fontSize??p}),checkedIcon:o.cloneElement(b,{fontSize:b.props.fontSize??p}),disableRipple:h,slots:v,slotProps:{input:(0,Z.Z)("function"==typeof P?P(C):P,{"data-indeterminate":d})}}});return(0,g.jsx)(z,{...I,classes:x})}))},8942:(e,t,n)=>{var o=n(5108),r="undefined"!=typeof Element,a="function"==typeof Map,s="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,o,c,l;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(o=n;0!=o--;)if(!equal(e[o],t[o]))return!1;return!0}if(a&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(l=e.entries();!(o=l.next()).done;)if(!t.has(o.value[0]))return!1;for(l=e.entries();!(o=l.next()).done;)if(!equal(o.value[1],t.get(o.value[0])))return!1;return!0}if(s&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(l=e.entries();!(o=l.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((n=(c=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;if(r&&e instanceof Element)return!1;for(o=n;0!=o--;)if(("_owner"!==c[o]&&"__v"!==c[o]&&"__o"!==c[o]||!e.$$typeof)&&!equal(e[c[o]],t[c[o]]))return!1;return!0}return e!=e&&t!=t}e.exports=function isEqual(e,t){try{return equal(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return o.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},4376:(e,t,n)=>{"use strict";n.d(t,{Z:()=>lib_Snowfall});var o=n(7363),r=n(8942);function random(e,t){const n=Math.random()*(t-e+1)+e;return Number.isInteger(e)&&Number.isInteger(t)?Math.floor(n):n}function lerp(e,t,n){return(1-n)*e+n*t}function getSize(e){return e?{height:e.offsetHeight,width:e.offsetWidth}:{height:0,width:0}}const a=2*Math.PI,s={color:"#dee4fd",radius:[.5,3],speed:[1,3],wind:[-.5,2],changeFrequency:200,rotationSpeed:[-1,1],opacity:[1,1]};class Snowflake{static createSnowflakes(e,t,n){if(!e)return[];const o=[];for(let r=0;r<t;r++)o.push(new Snowflake(e,n));return o}constructor(e,t={}){this.updateConfig(t);const{radius:n,wind:o,speed:r,rotationSpeed:a,opacity:s}=this.config;this.params={x:random(0,e.offsetWidth),y:random(-e.offsetHeight,0),rotation:random(0,360),radius:random(...n),speed:random(...r),wind:random(...o),rotationSpeed:random(...a),nextSpeed:random(...r),nextWind:random(...o),nextRotationSpeed:random(...a),opacity:random(...s)},this.framesSinceLastUpdate=0}selectImage(){this.config.images&&this.config.images.length>0?this.image=function randomElement(e){return e[Math.floor(Math.random()*e.length)]}(this.config.images):this.image=void 0}updateConfig(e){const t=this.config;this.config={...s,...e},this.config.changeFrequency=random(this.config.changeFrequency,1.5*this.config.changeFrequency),this.params&&!r(this.config.radius,null==t?void 0:t.radius)&&(this.params.radius=random(...this.config.radius)),r(this.config.images,null==t?void 0:t.images)||this.selectImage()}updateTargetParams(){this.params.nextSpeed=random(...this.config.speed),this.params.nextWind=random(...this.config.wind),this.image&&(this.params.nextRotationSpeed=random(...this.config.rotationSpeed))}update(e,t,n=1){const{x:o,y:r,rotation:a,rotationSpeed:s,nextRotationSpeed:i,wind:c,speed:l,nextWind:d,nextSpeed:f,radius:u}=this.params;this.params.x=(o+c*n)%(e+2*u),this.params.x>e+u&&(this.params.x=-u),this.params.y=(r+l*n)%(t+2*u),this.params.y>t+u&&(this.params.y=-u),this.image&&(this.params.rotation=(a+s)%360),this.params.speed=lerp(l,f,.01),this.params.wind=lerp(c,d,.01),this.params.rotationSpeed=lerp(s,i,.01),this.framesSinceLastUpdate++>this.config.changeFrequency&&(this.updateTargetParams(),this.framesSinceLastUpdate=0)}getImageOffscreenCanvas(e,t){var n,o;if(e instanceof HTMLImageElement&&e.loading)return e;let r=Snowflake.offscreenCanvases.get(e);if(r||(r={},Snowflake.offscreenCanvases.set(e,r)),!(t in r)){const o=document.createElement("canvas");o.width=t,o.height=t,null===(n=o.getContext("2d"))||void 0===n||n.drawImage(e,0,0,t,t),r[t]=o}return null!==(o=r[t])&&void 0!==o?o:e}drawCircle(e){e.moveTo(this.params.x,this.params.y),e.arc(this.params.x,this.params.y,this.params.radius,0,a)}drawImage(e){const{x:t,y:n,rotation:o,radius:r}=this.params,a=o*Math.PI/180,s=Math.cos(a),i=Math.sin(a);1!==this.params.opacity&&(e.save(),e.globalAlpha=this.params.opacity),e.setTransform(s,i,-i,s,t,n);const c=this.getImageOffscreenCanvas(this.image,r);e.drawImage(c,-r/2,-r/2,r,r),1!==this.params.opacity&&e.restore()}}Snowflake.offscreenCanvases=new WeakMap;const i=Snowflake,c={pointerEvents:"none",backgroundColor:"transparent",position:"absolute",top:0,left:0,width:"100%",height:"100%"};var l,d,__classPrivateFieldGet=function(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)},__classPrivateFieldSet=function(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n};class SnowfallCanvas{get ctx(){return __classPrivateFieldGet(this,l,"f")}get canvas(){return __classPrivateFieldGet(this,d,"f")}set canvas(e){__classPrivateFieldSet(this,d,e,"f"),__classPrivateFieldSet(this,l,e.getContext("2d"),"f")}constructor(e,t){this.lastUpdate=Date.now(),this.snowflakes=[],l.set(this,void 0),d.set(this,void 0),__classPrivateFieldSet(this,d,e,"f"),__classPrivateFieldSet(this,l,e.getContext("2d"),"f"),this.config={snowflakeCount:150,...s,...t},this.snowflakes=[],this.snowflakes=i.createSnowflakes(e,t.snowflakeCount||150,t),this.play()}updateConfig(e){this.config={...this.config,...e};const t=this.config.snowflakeCount-this.snowflakes.length;t>0&&(this.snowflakes=[...this.snowflakes,...i.createSnowflakes(this.canvas,t,e)]),t<0&&(this.snowflakes=this.snowflakes.slice(0,this.config.snowflakeCount));for(const e of this.snowflakes)e.updateConfig(this.config)}render(e=1){const{ctx:t,canvas:n,snowflakes:o}=this;if(!t||!n)return;const{offsetWidth:r,offsetHeight:a}=n;for(const t of o)t.update(r,a,e);if(t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,r,a),this.config.images&&this.config.images.length>0)for(const e of o)e.drawImage(t);else{t.beginPath();for(const e of o)e.drawCircle(t);t.fillStyle=this.config.color,t.fill()}}loop(){const e=Date.now(),t=Date.now()-this.lastUpdate;this.lastUpdate=e;const n=t/16.666666666666668;this.render(n),this.animationFrame=requestAnimationFrame((()=>this.loop()))}play(){this.loop()}pause(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0)}}l=new WeakMap,d=new WeakMap;function useDeepMemo(e){const[t,n]=(0,o.useState)(e);return function useDeepCompareEffect(e,t){const n=(0,o.useRef)(t);return r(t,n.current)||(n.current=t),(0,o.useEffect)(e,n.current)}((()=>n(e)),[e]),t}const lib_Snowfall=({color:e=s.color,changeFrequency:t=s.changeFrequency,radius:n=s.radius,speed:r=s.speed,wind:a=s.wind,rotationSpeed:i=s.rotationSpeed,opacity:l=s.opacity,snowflakeCount:d=150,images:f,style:u}={})=>{const p=(h=u,(0,o.useMemo)((()=>({...c,...h||{}})),[h]));var h;const m=(0,o.useRef)(null),g=(e=>{const[t,n]=(0,o.useState)(getSize(e.current)),r=(0,o.useCallback)((()=>{e.current&&n(getSize(e.current))}),[e]);return(0,o.useEffect)((()=>{const{ResizeObserver:t}=window;if(e.current){if(r(),"function"==typeof t){const n=new t(r);return n.observe(e.current),()=>n.disconnect()}return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)}}),[e,r]),t})(m),w=useDeepMemo({color:e,changeFrequency:t,radius:n,speed:r,wind:a,rotationSpeed:i,images:f,snowflakeCount:d,opacity:l}),v=(0,o.useRef)(w),y=(0,o.useRef)();return(0,o.useEffect)((()=>(!y.current&&m.current&&(y.current=new SnowfallCanvas(m.current,v.current)),()=>{var e;null===(e=y.current)||void 0===e||e.pause(),y.current=void 0})),[]),(0,o.useEffect)((()=>{y.current&&y.current.updateConfig(w)}),[w]),o.createElement("canvas",{ref:m,height:g.height,width:g.width,style:p,"data-testid":"SnowfallCanvas"})}}}]);
|