95225.6c8c979d81f5282a.js 19 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95225],{69948:function(e,n,t){var r=t(63244),o=t(40876);e.exports=function(e,n){return e&&e.length?o(e,r(n,2)):[]}},67385:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(67597),o=t(61395),a=/<(\w+)>(.*?)<\/\1>|<(\w+)\/>/,i=/(?:\r\n|\r|\n)/g;function s(e){if(!e.length)return[];var n=e.slice(0,4),t=n[0],r=n[1],o=n[2];return[[t||o,r||"",n[3]]].concat(s(e.slice(4,e.length)))}function c(e,n){void 0===n&&(n=[]);var t=e.replace(i,"").split(a);if(1===t.length)return e;var o=[],l=t.shift();return l&&o.push(l),s(t).forEach((function(e,t){var a=e[0],i=e[1],s=e[2],l=n[a]||r.createElement(r.Fragment,null);o.push((0,r.cloneElement)(l,{key:t},i?c(i,n):l.props.children)),s&&o.push(s)})),o}function l(e){var n=e.i18nKey,t=e.values,a=e.components,i=e.fallback,s=e.defaultTrans,l=e.ns,u=(0,o.Z)(l),d=u.t,f=u.lang;return(0,r.useMemo)((function(){var e=d(n,t,{fallback:i,default:s});return a&&0!==a.length?c(e,a):e}),[n,t,a,f])}},70905:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return pe}});var r=t(57611),o=t(67597),a=t(45361),i=t(69976),s=t(61395),c=t(648),l=t(6999),u=t.n(l),d=t(62049),f=t.n(d),h=t(67385),v=t(47471),m=t(51652),x=t(63747),b=function(e){var n=e.quranFont,t=(0,s.Z)("common").t,o=n===x.fr.Tajweed;return(0,r.jsx)(v.Z.Footer,{visible:(0,m.Fy)(n)||o,children:o?(0,r.jsx)(h.Z,{i18nKey:"common:fonts.tajweed-desc",components:[(0,r.jsx)(f(),{href:"/tajweed-colors",prefetch:!1},0)]}):t("fonts.qcf-desc")})},j=t(57044),_=t(16946),w=t(99968),p=t(82843),Z=t.n(p),k=t(13147),C=t(90914),g=t(49409),y=t(5330),T=t(1997),E=t(51726),S=function(){var e=(0,T.Z)((function(){return(0,E.__generator)(this,(function(e){return[2,t.e(47935).then(t.t.bind(t,47935,19)).then((function(e){return e.default}))]}))}));return function(){return e.apply(this,arguments)}}(),F=S,P=function(){var e,n=(0,c.v9)(y.Pt,c.wU),t=n.quranFont===x.fr.Tajweed,a=(0,w.ZP)("sample-verse",(function(){return F()})).data,i=(0,c.I0)();return(0,o.useEffect)((function(){if((0,m.Fy)(n.quranFont)&&a){var e=n.quranFont===x.fr.MadaniV1,t=(0,m.r$)(e,a.pageNumber),r=new FontFace(t,(0,m.nA)(e,a.pageNumber));document.fonts.add(r),r.load().then((function(){i((0,g.wC)(t))}))}}),[i,n.quranFont,a]),a?(e=t?(0,_.Z)((0,j.Z)({},a),{words:a.words.map((function(e){return(0,_.Z)((0,j.Z)({},e),{text:e.textImage})}))}):a,(0,r.jsx)("div",{dir:"rtl",children:(0,r.jsx)(k.Z,{words:e.words})})):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Z().skeletonContainer,children:(0,r.jsx)(C.Z,{children:(0,r.jsx)("div",{className:Z().skeletonPlaceholder})})}),(0,r.jsx)("div",{className:Z().skeletonContainer,children:(0,r.jsx)(C.Z,{children:(0,r.jsx)("div",{className:Z().skeletonPlaceholder})})})]})},N=t(28472),L=t(38429),q=t(71839),R=t(81787),I=t(57320),B=t(12195),W=t(70356),Q=function(){var e=(0,s.Z)("common"),n=e.t,t=e.lang,l=(0,c.I0)(),d=(0,c.v9)(y.Pt,c.wU),f=(0,R.Z)(),h=f.actions.onSettingsChange,m=f.isLoading,j=d.quranFont,_=d.quranTextFontScale,w=d.mushafLines,p=(0,o.useMemo)((function(){var e;return e={},(0,a.Z)(e,x.fr.IndoPak,[{id:x.fr.IndoPak,label:n("fonts.".concat(x.fr.IndoPak)),value:x.fr.IndoPak}]),(0,a.Z)(e,x.fr.Tajweed,[{id:x.fr.Tajweed,label:n("fonts.".concat(x.fr.Tajweed)),value:x.fr.Tajweed}]),(0,a.Z)(e,x.fr.Uthmani,[{id:x.fr.MadaniV1,label:n("fonts.".concat(x.fr.MadaniV1)),value:x.fr.MadaniV1,name:x.fr.MadaniV1},{id:x.fr.MadaniV2,label:n("fonts.".concat(x.fr.MadaniV2)),value:x.fr.MadaniV2,name:x.fr.MadaniV2},{id:x.fr.QPCHafs,label:n("fonts.".concat(x.fr.QPCHafs)),value:x.fr.QPCHafs,name:x.fr.QPCHafs}]),e}),[n]),Z=function(e,n){var t=Object.entries(p).find((function(n){return(0,i.Z)(n,2)[1].some((function(n){return n.id===e}))}));return t?(0,i.Z)(t,1)[0]:Z((0,I.kq)(n).quranFont,n)},k=Z(j,t),C=(0,o.useMemo)((function(){return Object.values(x.AN).map((function(e){return{id:e,label:n("fonts.".concat(e)),value:e,name:e}}))}),[n]),T=(0,o.useMemo)((function(){return[x.fr.Uthmani,x.fr.IndoPak,x.fr.Tajweed].map((function(e){return{name:n("fonts.".concat(e)),value:e}}))}),[n]),E=function(e,n,t,r){h(e,n,t,r,W.Z.QURAN_READER_STYLES),l((0,g.bl)())};return(0,r.jsxs)(v.Z,{id:"quran-font-section",children:[(0,r.jsx)(v.Z.Title,{isLoading:m,children:n("fonts.quran-font")}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsx)(q.Z,{items:T,selected:k,onSelect:function(e){(0,B.Q8)("font_family",k,e);var n=function(e){return(0,i.Z)(p[e],1)[0].value}(e);E("quranFont",n,(0,y.Q)({quranFont:n,locale:t}),(0,y.Q)({quranFont:d.quranFont,locale:t}))}})}),(0,r.jsxs)(v.Z.Row,{children:[(0,r.jsx)(v.Z.Label,{children:n("style")}),(0,r.jsx)(L.Z,{id:"quranFontStyles",name:"quranFontStyles",options:p[k],value:j,onChange:function(e){(0,B.Q8)("font_style",j,e),E("quranFont",e,(0,y.Q)({quranFont:e,locale:t}),(0,y.Q)({quranFont:d.quranFont,locale:t}))}})]}),k===x.fr.IndoPak&&(0,r.jsxs)(v.Z.Row,{children:[(0,r.jsx)(v.Z.Label,{children:n("fonts.lines")}),(0,r.jsx)(L.Z,{id:"lines",name:"lines",options:C,value:w,onChange:function(e){(0,B.Q8)("mushaf_lines",w,e),E("mushafLines",e,(0,y.fZ)({mushafLines:e,locale:t}),(0,y.fZ)({mushafLines:d.mushafLines,locale:t}))}})]}),(0,r.jsxs)(v.Z.Row,{id:"font-size-section",children:[(0,r.jsx)(v.Z.Label,{children:n("fonts.font-size")}),(0,r.jsx)(N.Z,{count:_,onDecrement:_===y.P0?null:function(){var e=_-1;(0,B.Q8)("font_scale",_,e),E("quranTextFontScale",e,(0,y.ou)(),(0,y.iH)())},onIncrement:_===y.NI?null:function(){var e=_+1;(0,B.Q8)("font_scale",_,e),E("quranTextFontScale",e,(0,y.iH)(),(0,y.ou)())}})]}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsx)(b,{quranFont:j})}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsx)("div",{className:u().versePreviewContainer,children:(0,r.jsx)(P,{})})})]})},M=t(20849),O=t(15129),A=t(25150),U=t.n(A),V=t(85494),D=t(85609),H=t(63264),z=t(31887),K=t(24796),X=t(19226),Y=t(82427),G=t(89773),J=function(){var e=(0,c.I0)(),n=(0,O.useRouter)(),t=(0,s.Z)("common"),a=t.t,i=t.lang,l=(0,D.useToast)(),u=(0,o.useContext)(Y.c),d=function(){var t=(0,T.Z)((function(){var t,r;return(0,E.__generator)(this,(function(o){switch(o.label){case 0:if((0,B.MY)("reset_settings"),t=function(){e((0,H.Z)(i)),u.send((0,j.Z)({type:"SET_INITIAL_CONTEXT"},z.hw))},!(0,X.jl)())return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e((0,K.UB)(i)).then(M.SI)];case 2:return o.sent(),t(),[3,4];case 3:return o.sent(),[3,4];case 4:return[3,6];case 5:t(),o.label=6;case 6:return r=[G.Z.Translations,G.Z.Reciter,G.Z.WBW_LOCALE,G.Z.FLOW],r.some((function(e){return n.query[e]}))&&(r.forEach((function(e){return delete n.query[e]})),n.push(n,void 0,{shallow:!0})),l(a("settings.reset-notif"),{status:D.ToastStatus.Success}),[2]}}))}));return function(){return t.apply(this,arguments)}}();return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:U().resetButtonContainer,children:(0,r.jsx)(V.ZP,{onClick:d,children:a("settings.reset-cta")})})})},$=t(37278),ee=t(59498),ne=t.n(ee),te=t(73756),re=t(18419),oe=t(91176),ae=t(32162),ie=t(48752),se=t(27967),ce=t(1050),le=t(43609),ue=function(){var e=(0,R.Z)(),n=e.actions.onSettingsChange,t=e.isLoading,a=(0,s.Z)("common"),i=a.t,l=a.lang,u=(0,c.I0)(),d=(0,c.v9)(ie.qw,ce.Hj),f=(0,c.v9)(y.Pt,c.wU).translationFontScale,h=(0,re.P)(),m=h.isActive,x=h.nextStep,b=(0,o.useCallback)((function(){return(0,r.jsx)("div",{children:d.map((function(e){return(0,r.jsx)(C.Z,{className:ne().skeleton},e)}))})}),[d]),j=(0,o.useMemo)((function(){return(0,le.rQ)(d.length-1,l)}),[d,l]),_=(0,o.useCallback)((function(){u((0,ae.Mi)(ae.US.Translation)),(0,B.Q8)("settings_view",ae.US.Translation,ae.US.Body),m&&x()}),[u,m,x]),w=(0,o.useCallback)((function(e){var n=e.translations.find((function(e){return e.id===d[0]})),t=i("settings.no-translation-selected");return 1===d.length&&(t=null===n||void 0===n?void 0:n.name),2===d.length&&(t=i("settings.value-and-other",{value:null===n||void 0===n?void 0:n.name,othersCount:j})),d.length>2&&(t=i("settings.value-and-others",{value:null===n||void 0===n?void 0:n.name,othersCount:j})),(0,r.jsx)(oe.Z,{label:i("settings.selected-translations"),value:t,onClick:_})}),[j,_,d,i]),p=function(e,t,r,o){n(e,t,r,o,W.Z.QURAN_READER_STYLES)};return(0,r.jsx)("div",{className:ne().container,children:(0,r.jsxs)(v.Z,{id:"translation-section",children:[(0,r.jsx)(v.Z.Title,{isLoading:t,children:i("translation")}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsx)(te.Z,{loading:b,queryKey:(0,se.c7)(l),render:w})}),(0,r.jsxs)(v.Z.Row,{children:[(0,r.jsx)(v.Z.Label,{children:i("fonts.font-size")}),(0,r.jsx)(N.Z,{count:f,onIncrement:y.U1===f?null:function(){var e=f+1;(0,B.Q8)("translation_font_scale",f,e),p("translationFontScale",e,(0,y.xo)(),(0,y.rk)())},onDecrement:y.P0===f?null:function(){var e=f-1;(0,B.Q8)("translation_font_scale",f,e),p("translationFontScale",e,(0,y.rk)(),(0,y.xo)())}})]})]})})},de=t(8522),fe=t(69948),he=t.n(fe),ve=t(49901),me=t.n(ve),xe=t(41418),be=t(57830),je=t(80665),_e=t(46581),we=function(){var e=(0,s.Z)("common"),n=e.t,t=e.lang,o=(0,R.Z)(),a=o.actions.onSettingsChange,i=o.isLoading,l=(0,O.useRouter)(),u=(0,c.v9)(_e.Xg,c.wU),d=u.selectedWordByWordLocale,f=u.wordByWordDisplay,m=u.wordByWordContentType,b=u.wordClickFunctionality,j=(0,c.v9)(y.KV,c.wU),_=function(e,n,t,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];a(e,n,t,r,o?W.Z.QURAN_READER_STYLES:W.Z.READING)},w=function(e){(0,B.Q8)("wbw_locale",d,e),l.query[G.Z.WBW_LOCALE]=e,l.push(l,void 0,{shallow:!0}),_("selectedWordByWordLocale",e,(0,_e.Ud)({value:e,locale:t}),(0,_e.Ud)({value:d,locale:t}))},p=function(e,n){var t=e?x.PT.INLINE:x.PT.TOOLTIP,r=n?(0,de.Z)(f).concat([t]):(0,ce.sj)(t,f);(0,B.Q8)("wbw_display",f,r),_("wordByWordDisplay",r,(0,_e.Hm)(r),(0,_e.Hm)(f))},Z=function(e,n){var t=e?x.Oj.Translation:x.Oj.Transliteration,r=n?(0,de.Z)(m).concat([t]):(0,ce.sj)(t,m);(0,B.Q8)("wbw_content_type",m,r),_("wordByWordContentType",r,(0,_e.zX)(r),(0,_e.zX)(m))},k=!m||!m.length,C=!m||!m.includes(x.Oj.Translation);return(0,r.jsxs)(v.Z,{children:[(0,r.jsx)(v.Z.Title,{isLoading:i,children:n("wbw")}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsxs)("div",{className:me().checkboxContainer,children:[(0,r.jsx)("div",{id:"wbw-translation-section",children:(0,r.jsx)(xe.Z,{checked:m.includes(x.Oj.Translation),id:"wbw-translation",name:"wbw-translation",label:n("translation"),onChange:function(e){return Z(!0,e)}})}),(0,r.jsx)("div",{id:"wbw-transliteration-section",children:(0,r.jsx)(xe.Z,{checked:m.includes(x.Oj.Transliteration),id:"wbw-transliteration",name:"wbw-transliteration",label:n("transliteration"),onChange:function(e){return Z(!1,e)}})}),(0,r.jsx)("div",{id:"wbw-recitation-section",children:(0,r.jsx)(xe.Z,{checked:b===x.MB.PlayAudio,id:"wbw-recitation",name:"wbw-recitation",label:n("recitation"),onChange:function(e){var n=e?x.MB.PlayAudio:x.MB.NoAudio,t=n===x.MB.PlayAudio?x.MB.NoAudio:x.MB.PlayAudio;(0,B.Q8)("audio_settings_word_click_functionality",t,n),_("wordClickFunctionality",n,(0,_e.O2)(n),(0,_e.O2)(t))}})}),(0,r.jsx)(v.Z.Footer,{children:(0,r.jsx)(h.Z,{components:{span:(0,r.jsx)("span",{className:me().source})},i18nKey:"common:reciter-summary",values:{reciterName:"Shaikh Wisam Sharieff"}})})]})}),(0,r.jsx)(je.Z,{className:me().separator}),(0,r.jsxs)(v.Z.Row,{children:[(0,r.jsx)(v.Z.Label,{children:n("trans-lang")}),(0,r.jsx)(te.Z,{queryKey:(0,se.u8)(t),render:function(e){var n=he()(e.wordByWordTranslations,"isoCode").map((function(e){var n=e.isoCode;return{label:(0,le.J_)(n),value:n}}));return(0,r.jsx)(L.Z,{size:L.h.Small,id:"wordByWord",name:"wordByWord",options:n,value:d,disabled:C,onChange:w})}})]}),(0,r.jsx)(v.Z.Footer,{children:(0,r.jsx)(h.Z,{components:{link:(0,r.jsx)(be.Z,{isNewTab:!0,href:"https://quranwbw.com/",variant:be.r.Blend})},i18nKey:"common:wbw-lang-summary",values:{source:"quranwbw"}})}),(0,r.jsxs)("div",{id:"wbw-display-section",children:[(0,r.jsx)(v.Z.Label,{children:(0,r.jsx)("p",{className:me().label,children:n("display")})}),(0,r.jsx)(v.Z.Row,{children:(0,r.jsxs)("div",{className:me().checkboxContainer,children:[(0,r.jsx)(xe.Z,{checked:f.includes(x.PT.INLINE),id:"inline",name:"inline",label:n("inline"),disabled:k,onChange:function(e){return p(!0,e)}}),(0,r.jsx)(xe.Z,{checked:f.includes(x.PT.TOOLTIP),id:"tooltip",name:"word-tooltip",label:n("tooltip"),disabled:k,onChange:function(e){return p(!1,e)}})]})})]}),(0,r.jsxs)(v.Z.Row,{children:[(0,r.jsx)(v.Z.Label,{children:n("fonts.font-size")}),(0,r.jsx)(N.Z,{count:j,onIncrement:y.I8===j?null:function(){var e=j+1;(0,B.Q8)("word_by_word_font_scale",j,e),_("wordByWordFontScale",e,(0,y.CR)(),(0,y.EQ)(),!0)},onDecrement:y.P0===j?null:function(){var e=j-1;(0,B.Q8)("word_by_word_font_scale",j,e),_("wordByWordFontScale",e,(0,y.EQ)(),(0,y.CR)(),!0)}})]})]})},pe=function(){var e=(0,re.P)(),n=e.isActive,t=e.nextStep,a=e.activeStepIndex;return(0,o.useEffect)((function(){var e=null;return n&&0===a&&(e=setTimeout((function(){return t()}),400)),function(){null!==e&&clearTimeout(e)}}),[a,n]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.Z,{}),(0,r.jsx)(Q,{}),(0,r.jsx)(we,{}),(0,r.jsx)(ue,{}),(0,r.jsx)(J,{})]})}},41418:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var r,o=t(45361),a=t(57044),i=t(16946),s=t(57611),c=t(67597),l=t(36430),u=t(37014),d=t.n(u),f=t(192),h=t.n(f);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},v.apply(null,arguments)}var m,x=function(e){return c.createElement("svg",v({viewBox:"0 0 20 20",height:16,width:16,fill:"none"},e),r||(r=c.createElement("path",{stroke:"var(--color-secondary-medium)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10h10"})))};function b(){return b=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},b.apply(null,arguments)}var j=function(e){return c.createElement("svg",b({viewBox:"0 0 20 20",height:20,width:20,fill:"none"},e),m||(m=c.createElement("path",{d:"m14 7-5.5 5.5L6 10",stroke:"var(--color-background-default)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))},_=function(e){var n=e.disabled,t=void 0!==n&&n,r=e.required,c=void 0!==r&&r,u=e.defaultChecked,f=e.checked,v=e.id,m=e.label,b=e.name,_=e.onChange;return(0,s.jsxs)("div",{className:d()(h().container,(0,o.Z)({},h().disabled,t)),children:[(0,s.jsx)(l.fC,(0,i.Z)((0,a.Z)({disabled:t,name:b,required:c,onCheckedChange:function(e){_(e)},id:v,className:h().checkbox,defaultChecked:u},void 0!==f&&{checked:f}),{children:(0,s.jsx)(l.z$,{className:d()(h().indicator,(0,o.Z)({},h().disabledIndicator,t)),children:"indeterminate"===f?(0,s.jsx)(x,{}):(0,s.jsx)(j,{})})})),m&&(0,s.jsx)("label",{className:h().label,htmlFor:v,children:m})]})}},91176:function(e,n,t){"use strict";var r=t(57611),o=t(35894),a=t.n(o),i=t(4845);n.Z=function(e){var n=e.label,t=e.value,o=e.onClick;return(0,r.jsxs)("div",{className:a().container,onClick:o,children:[(0,r.jsxs)("div",{className:a().labelContainer,children:[(0,r.jsx)("div",{className:a().label,children:n}),(0,r.jsx)("div",{className:a().value,children:t})]}),(0,r.jsx)("div",{className:a().iconContainer,children:(0,r.jsx)(i.Z,{})})]})}},6999:function(e){e.exports={versePreviewContainer:"QuranFontSection_versePreviewContainer__ZeHic"}},25150:function(e){e.exports={resetButtonContainer:"ResetButton_resetButtonContainer__6Rj9J"}},59498:function(e){e.exports={container:"TranslationSection_container__UWdQ0",changeReciterButtonContainer:"TranslationSection_changeReciterButtonContainer__ITJQ6",skeleton:"TranslationSection_skeleton__kxGgM"}},82843:function(e){e.exports={skeletonPlaceholder:"VersePreview_skeletonPlaceholder__HGF0n",skeletonContainer:"VersePreview_skeletonContainer__CNF9R"}},49901:function(e){e.exports={checkboxContainer:"WordByWordSection_checkboxContainer__Op0oH",separator:"WordByWordSection_separator__hXV_B",source:"WordByWordSection_source__sabJE",label:"WordByWordSection_label__a606F"}},192:function(e){e.exports={container:"Checkbox_container__LWbsV",checkbox:"Checkbox_checkbox__bbyfA",label:"Checkbox_label__MrEvp",disabled:"Checkbox_disabled__3XIf_",indicator:"Checkbox_indicator__6umIV",disabledIndicator:"Checkbox_disabledIndicator__Dmw2E"}},35894:function(e){e.exports={container:"SelectionCard_container__3fUza",label:"SelectionCard_label__GXY5O",value:"SelectionCard_value__VrbTY",iconContainer:"SelectionCard_iconContainer__FjKYo"}},36430:function(e,n,t){"use strict";t.d(n,{fC:function(){return C},z$:function(){return g}});var r=t(57384),o=t(67597),a=t(71641),i=t(61544),s=t(90149),c=t(82305),l=t(10810),u=t(81319),d=t(8591),f=t(4300);const h="Checkbox",[v,m]=(0,i.b)(h),[x,b]=v(h),j=(0,o.forwardRef)(((e,n)=>{const{__scopeCheckbox:t,name:i,checked:l,defaultChecked:u,required:d,disabled:h,value:v="on",onCheckedChange:m,...b}=e,[j,_]=(0,o.useState)(null),w=(0,a.e)(n,(e=>_(e))),C=(0,o.useRef)(!1),g=!j||Boolean(j.closest("form")),[y=!1,T]=(0,c.T)({prop:l,defaultProp:u,onChange:m}),E=(0,o.useRef)(y);return(0,o.useEffect)((()=>{const e=null===j||void 0===j?void 0:j.form;if(e){const n=()=>T(E.current);return e.addEventListener("reset",n),()=>e.removeEventListener("reset",n)}}),[j,T]),(0,o.createElement)(x,{scope:t,state:y,disabled:h},(0,o.createElement)(f.WV.button,(0,r.Z)({type:"button",role:"checkbox","aria-checked":Z(y)?"mixed":y,"aria-required":d,"data-state":k(y),"data-disabled":h?"":void 0,disabled:h,value:v},b,{ref:w,onKeyDown:(0,s.M)(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:(0,s.M)(e.onClick,(e=>{T((e=>!!Z(e)||!e)),g&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())}))})),g&&(0,o.createElement)(p,{control:j,bubbles:!C.current,name:i,value:v,checked:y,required:d,disabled:h,style:{transform:"translateX(-100%)"}}))})),_="CheckboxIndicator",w=(0,o.forwardRef)(((e,n)=>{const{__scopeCheckbox:t,forceMount:a,...i}=e,s=b(_,t);return(0,o.createElement)(d.z,{present:a||Z(s.state)||!0===s.state},(0,o.createElement)(f.WV.span,(0,r.Z)({"data-state":k(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:n,style:{pointerEvents:"none",...e.style}})))})),p=e=>{const{control:n,checked:t,bubbles:a=!0,...i}=e,s=(0,o.useRef)(null),c=(0,l.D)(t),d=(0,u.t)(n);return(0,o.useEffect)((()=>{const e=s.current,n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,"checked").set;if(c!==t&&r){const n=new Event("click",{bubbles:a});e.indeterminate=Z(t),r.call(e,!Z(t)&&t),e.dispatchEvent(n)}}),[c,t,a]),(0,o.createElement)("input",(0,r.Z)({type:"checkbox","aria-hidden":!0,defaultChecked:!Z(t)&&t},i,{tabIndex:-1,ref:s,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Z(e){return"indeterminate"===e}function k(e){return Z(e)?"indeterminate":e?"checked":"unchecked"}const C=j,g=w},10810:function(e,n,t){"use strict";t.d(n,{D:function(){return o}});var r=t(67597);function o(e){const n=(0,r.useRef)({value:e,previous:e});return(0,r.useMemo)((()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous)),[e])}}}]);
  2. //# sourceMappingURL=95225.6c8c979d81f5282a.js.map