1"use strict";(self.webpackChunkask_pcos_application=self.webpackChunkask_pcos_application||[]).push([[6719],{2408:function(e,t,i){i.d(t,{A:function(){return m}});var n=i(49457),s=i(96540),a=i(41377),o=i(61858),r=i(1612),c=i(80033);var l=e=>{let{links:t}=e;const{0:i,1:n}=(0,s.useState)(!1);return t&&0!==t.length?s.createElement("div",{className:"mb-8 border border-site-blue-dark rounded-lg overflow-hidden"},s.createElement("button",{onClick:()=>n(!i),className:"w-full flex items-center justify-between bg-white hover:bg-gray-50 transition-colors"},s.createElement("div",{className:"text-left"},s.createElement("h2",{className:"text-2xl font-semibold text-site-blue-dark mb-1"},"Want to know more?"),s.createElement("p",{className:"text-sm text-site-blue-dark"},"Expand this section to view more evidence-based resources.")),s.createElement("div",{className:"bg-[#e3eaf3] rounded-full p-1 flex-shrink-0 flex items-center justify-center"},i?s.createElement(c.Ik,{style:{strokeWidth:"6px"},size:32,className:"text-site-blue-dark "}):s.createElement(c.pte,{style:{strokeWidth:"6px"},size:32,className:"text-site-blue-dark "}))),i&&s.createElement("div",{className:"pt-4 "},s.createElement("div",{className:"space-y-3"},t.map(((e,t)=>s.createElement("div",{key:t,className:"flex items-start gap-2"},s.createElement(r.AnD,{size:18,className:"mt-1 text-site-blue-dark flex-shrink-0"}),s.createElement("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-site-blue-dark text-sm text-left underline hover:text-site-blue-dark/80 break-words"},e.title))))))):null},u=i(65830);var m=e=>{let{pdfTitle:t,pdfSubtitle:i,pdfIntroTitle:r,pdfConditionDescription:c,sortedTreatmentOptions:m,treatmentData:d,healthFactors:h,userNotes:p,logoUrl:f,doctorInstructions:x,keyToOptionIdMapping:g,pdfBlobForEmail:v,setPdfBlobForEmail:y,setIsEmailModalOpen:b,treatmentLinks:w,imageSrc:E}=e;return s.createElement("div",{className:"max-w-4xl mx-auto"},s.createElement(u.yI,null,s.createElement(u.oQ,null,"Well done! You have explored your options. You're now equipped with the knowledge to take the next step with confidence.")),s.createElement(u.yI,{title:"Save your decision aid summary"},s.createElement(u.oQ,null,"Save a summary of your decision aid journey to your phone or send it to your email."),s.createElement(u.yI,null,s.createElement("div",{className:"flex flex-col space-y-3"},s.createElement(n.lp,{document:s.createElement(o.A,{title:t,subtitle:i,introTitle:r,conditionDescription:c,treatmentOptions:m,treatmentData:d,healthFactors:h,userNotes:p,AppLogo:f,doctorInstructions:x,keyToOptionIdMapping:g})},(e=>{let{blob:t,url:i,loading:n,error:o}=e;return t&&t!==v&&y(t),s.createElement("div",{className:"flex flex-col space-y-2 w-full"},s.createElement(a.cj,{title:"Save PDF to your phone",className:"flex items-center justify-center text-center",onClick:()=>{i&&window.open(i,"_blank")},disabled:n||!i},n?"Generating PDF...":"Save PDF to your phone"),s.createElement(a.cj,{title:"Send PDF to email",className:"flex items-center justify-center text-center",onClick:()=>b(!0),disabled:n||!t}))})))),s.createElement(u.oQ,null,"Bring this summary to your doctor to support a helpful discussion.")),s.createElement(l,{links:w}),s.createElement("h1",{className:"text-2xl font-semibold text-site-blue-dark mb-4"},"Make an appointment with your doctor now"),s.createElement("div",{className:"rounded-lg overflow-hidden shadow-lg"},s.createElement("img",{src:E,alt:"Calendar appointment",className:"w-full h-auto"})))}},65830:function(e,t,i){i.d(t,{Ly:function(){return l},oQ:function(){return a},sP:function(){return c},yI:function(){return s}});var n=i(96540);const s=e=>{let{title:t,children:i,className:s="mb-[20px]",icon:a}=e;const o=t&&/\d/.test(t)?"24px":"30px";return n.createElement("div",{style:{marginBottom:"30px"},className:s},t&&n.createElement("h2",{className:"font-bold text-site-blue-dark mb-[10px] flex items-center gap-2",style:{fontSize:o}},a,t),i)},a=e=>{let{children:t,className:i="mb-4",style:s}=e;return n.createElement("p",{className:i,style:{fontSize:"20px",...s}},t)},o=e=>{if(!n.isValidElement(e))return!1;const t=e.props;return void 0!==t.index&&null!==t.index},r=e=>{if("string"==typeof e)return/^\d+\.\s*/.test(e.trim());if(n.isValidElement(e)){const t=e.props;if("string"==typeof t.children)return/^\d+\.\s*/.test(t.children.trim())}return!1},c=e=>{let{children:t,className:i=""}=e;const s=n.Children.toArray(t),a=s.some(o),c=s.some(r),l=a||c?`ml-0 list-none space-y-2 ${i}`.trim():`ml-6 list-disc space-y-2 ${i}`.trim();return n.createElement("ul",{className:l,style:{fontSize:"20px"}},s.map(((e,t)=>{if(!n.isValidElement(e))return e;const i=(e=>{if(!n.isValidElement(e))return"none";const t=e.props;if(void 0!==t.index&&null!==t.index)return"auto-index";const i=t.children;return"string"==typeof i&&/^\d+\.\s*/.test(i.trim())?"manual-number":"none"})(e),s=e.props,a=e.key;return n.cloneElement(e,{...s,numberingType:i,key:null!==a?a:t})})))},l=e=>{let{children:t,index:i,className:s="",numberingType:a="none"}=e;const o=null!=i;return o&&"auto-index"===a?n.createElement("li",{className:`flex items-start gap-2 ${s}`.trim()},n.createElement("span",{className:"shrink-0 font-semibold text-[18px] text-site-blue-dark flex items-start justify-center mt-[2px] min-w-[20px]"},i,"."),n.createElement("span",{style:{fontSize:"20px",fontFamily:"Work Sans"},className:"flex-1"},t)):"manual-number"===a?n.createElement("li",{className:`flex items-start gap-2 ${s}`.trim()},n.createElement("span",{className:"shrink-0 font-bold -mt-[2.5px] text-[20px] text-site-green-dark min-w-[24px]"},"string"==typeof t?null===(r=t.match(/^\d+\./))||void 0===r?void 0:r[0]:""),n.createElement("span",{style:{fontSize:"20px",fontFamily:"Work Sans"},className:"flex-1"},"string"==typeof t?t.replace(/^\d+\.\s*/,""):t)):o?n.createElement("li",{className:`flex items-start gap-2 ${s}`.trim()},n.createElement("span",{className:"shrink-0 font-semibold text-[18px] text-site-blue-dark flex items-start justify-center mt-[2px] min-w-[20px]"},i,"."),n.createElement("span",{style:{fontSize:"20px",fontFamily:"Work Sans"},className:"flex-1"},t)):n.createElement("li",{className:s},t);var r}},30662:function(e,t,i){i.d(t,{A:function(){return u}});var n=i(96540),s=i(31223),a=i(3375),o=i(24794),r=i(80033);var c=e=>{let{prev:t,next:i,className:s=""}=e;return n.createElement("div",{style:{marginTop:"40px",marginBottom:"20px",fontFamily:"Work Sans",fontSize:"18px"},className:`flex w-full justify-between text-sm font-semibold items-center leading-[1] text-site-blue-dark ${s}`},n.createElement("div",null,t&&n.createElement(o.Link,{to:t.to},n.createElement("div",{className:"flex items-center gap-1"},n.createElement("div",{className:"w-5xl flex justify-center items-center"},n.createElement(r.Twu,{size:64,color:"#00b8a4"})),n.createElement("div",{className:"flex-1 min-w-0 pr-2"},n.createElement("span",{className:"whitespace-normal"},t.label))))),n.createElement("div",null,i&&n.createElement(o.Link,{to:i.to},n.createElement("div",{className:"flex items-center gap-1 text-right"},n.createElement("div",{className:"flex-1 min-w-0 pl-2"},n.createElement("span",{className:"whitespace-normal"},i.label)),n.createElement("div",{className:"w-5xl flex justify-center items-center"},i.icon||n.createElement(r.eAn,{size:64,color:"#00b8a4"}))))))},l=i(81372);var u=e=>{let{children:t,title:i,optionNumber:o,pdaName:r,pdaLink:u,secondaryTitle:m,secondaryLink:d,icon:h,prevNavigation:p,nextNavigation:f,hideNavigation:x=!1,navigating:g,loading:v=!1,onNavigate:y}=e;
1return n.createElement(s.A,{style:{marginTop:"15px",fontFamily:"Work Sans",fontSize:"20px"},className:"px-10"},r&&u&&n.createElement("div",{style:{marginBottom:"40px"},className:" bg-blue-50 rounded-md border border-blue-200"},n.createElement(a.A,{pdaTitle:r,pdaLink:u,secondaryTitle:m,secondaryLink:d})),n.createElement("div",{className:"mx-auto text-site-blue-dark"},o&&n.createElement("div",{className:"text-sm text-gray-600 font-bold "},"Option ",String(o)),n.createElement("div",{className:"flex items-center gap-2"},h&&n.createElement("div",{className:"mb-[20px]"},h),n.createElement("h1",{className:"text-left font-bold text-site-blue-dark mb-[20px]",style:{fontSize:"36px",fontFamily:"Work Sans"}},i)),n.createElement("div",{className:""},t," ")),(p||f)&&!x&&n.createElement("div",{className:"flex "},y?n.createElement(l.A,{prev:p,next:f,loading:v||!!g,onNavigate:async e=>{if(y)try{await y(e)}catch(t){return void console.error("Navigation save error:",t)}}}):n.createElement(c,{prev:p,next:f})))}},81372:function(e,t,i){var n=i(24794),s=i(96540),a=i(80033);t.A=e=>{let{prev:t,next:i,loading:o,className:r="",onNavigate:c}=e;const l=(0,s.useCallback)((async e=>{const s=e===(null==i?void 0:i.to),a=e===(null==t?void 0:t.to),o=()=>{(0,n.navigate)(e)};s||a?await(async()=>{if(c)try{await c(e)}catch(t){console.error(t),alert("Failed to save your answers. Please try again.")}else o()})():o()}),[c,t,i]);return s.createElement("div",{style:{marginTop:"40px",marginBottom:"20px",fontFamily:"Work Sans",fontSize:"17px"},className:`flex w-full justify-between text-sm font-semibold items-center leading-[1] text-site-blue-dark ${r}`},s.createElement("div",null,t&&s.createElement("div",{className:"cursor-pointer",onClick:()=>l(t.to)},s.createElement("div",{className:"flex items-center gap-1"},s.createElement("div",{className:"w-5xl flex justify-center items-center"},s.createElement(a.Twu,{size:64,color:"#00b8a4"})),s.createElement("div",{className:"flex-1 min-w-0 pr-2"},s.createElement("span",{className:"whitespace-normal"},t.label))))),s.createElement("div",null,i&&s.createElement("div",{className:"cursor-pointer",onClick:()=>l(i.to)},s.createElement("div",{className:"flex items-center gap-1 text-right"},s.createElement("div",{className:"flex-1 min-w-0 pl-2"},s.createElement("span",{className:"whitespace-normal"},o?"Saving...":i.label)),s.createElement("div",{className:"w-5xl flex justify-center items-center"},s.createElement(a.eAn,{size:64,color:"#00b8a4"}))))))}},1014:function(e,t,i){i.d(t,{$:function(){return n}});const n=e=>{const t="undefined"!=typeof window?window.location.pathname:"",i=t.includes("hirsutism"),n=t.includes("pcos-diagnosis"),s=t.includes("irregular-periods"),a=t.includes("pcos-weight-management"),o=t.includes("pcos-metabolic-health"),r=t.includes("/fertility"),c=i&&"/decision-aid/hirsutism/"===t||n&&"/decision-aid/pcos-diagnosis/"===t||s&&"/decision-aid/irregular-periods/"===t||a&&"/decision-aid/pcos-weight-management/"===t||o&&"/decision-aid/pcos-metabolic-health/"===t||r&&"/decision-aid/fertility/"===t;console.log("isPcosWeightManagement",a),console.log("isRootPDAPage",c);const l=c?"Back to Decision Aids":i?"Excess Hair (Hirsutism)":n?"Pcos diagnosis":s?"Irregular Periods":a?"Body Shape and Size":o?"PCOS Metabolic Health":r?"Navigating Fertility":e||"Excess Hair (Hirsutism)",u=c?"/decision-aid":i?"/decision-aid/hirsutism":n?"/decision-aid/pcos-diagnosis":s?"/decision-aid/irregular-periods":a?"/decision-aid/pcos-weight-management":o?"/decision-aid/pcos-metabolic-health":r?"/decision-aid/fertility":"/decision-aid/hirsutism",m=i?"/decision-aid/hirsutism/options":n?"/decision-aid/pcos-diagnosis/options":s?"/decision-aid/irregular-periods/options":a?"/decision-aid/pcos-weight-management/options":o?"/decision-aid/pcos-metabolic-health/options":r?"/decision-aid/fertility/explore-your-options":"/decision-aid/hirsutism/options";let d,h;if(o){(t.includes("/fbg-test")||t.includes("/hba1c-test")||t.includes("/ogtt-test"))&&(d="Diabetes screening",h="/decision-aid/pcos-metabolic-health/options/diabetes/")}if(a){const e=t.includes("/healthy-lifestyle-not-focused-on-weight")||t.includes("/healthy-lifestyle-focused-on-weight")||t.includes("/surgery-to-support-weight-loss")||t.includes("/medications-to-support-weight-loss"),i=t.includes("/metformin-wm")||t.includes("/orlistat")||t.includes("/naltrexone-with-bupropion")||t.includes("/phentermine-and-topiramate")||t.includes("/incretins-based-medication");e?(d="Explore your options",h="/decision-aid/pcos-weight-management/explore-options"):i&&(d="Medication options",h="/decision-aid/pcos-weight-management/medications-to-support-weight-loss")}if(r){const e=t.includes("/metformin")||t.includes("/letrozole")||t.includes("/clomiphene")||t.includes("/gonadotropin")||t.includes("/ovarian-surgery"),i=t.includes("/ivf")||t.includes("/ivm"),n=t.includes("/natural-conception")||t.includes("/ovulation-induction")||t.includes("/advanced-fertility-treatments");e?(d="Ovulation induction",h="/decision-aid/fertility/option-groups/ovulation-induction"):i?(d="Advanced treatments",h="/decision-aid/fertility/option-groups/advanced-fertility-treatments"):n&&(d="Explore your options",h="/decision-aid/fertility/explore-your-options")}return{isHirsutism:i,isPcosDiagnosis:n,isIrregularPeriods:s,isPcosWeightManagement:a,isPcosMetabolicHealth:o,isFertility:r,pdaName:l,pdaLink:u,optionsLink:m,secondaryTitle:d,secondaryLink:h}}},24552:function(e){var t={linear:function(e,t,i,n){return(i-t)*e/n+t},easeInQuad:function(e,t,i,n){return(i-t)*(e/=n)*e+t},easeOutQuad:function(e,t,i,n){return-(i-t)*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,i,n){var s=i-t;return(e/=n/2)<1?s/2*e*e+t:-s/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,i,n){return(i-t)*(e/=n)*e*e+t},easeOutCubic:function(e,t,i,n){return(i-t)*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,i,n){var s=i-t;return(e/=n/2)<1?s/2*e*e*e+t:s/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,i,n){return(i-t)*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,i,n){return-(i-t)*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,i,n){var s=i-t;return(e/=n/2)<1?s/2*e*e*e*e+t:-s/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,i,n){return(i-t)*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,i,n){return(i-t)*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,i,n){var s=i-t;return(e/=n/2)<1?s/2*e*e*e*e*e+t:s/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,i,n){var s=i-t;return-s*Math.cos(e/n*(Math.PI/2))+s+t},easeOutSine:function(e,t,i,n){return(i-t)*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,i,n){return-(i-t)/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,i,n){return 0==e?t:(i-t)*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,i,n){var s=i-t;return e==n?t+s:s*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,i,n){var s=i-t;return 0===e?t:e===n?t+s:(e/=n/2)<1?s/2*Math.pow(2,10*(e-1))+t:s/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,i,n){return-(i-t)*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,i,n){return(i-t)*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,i,n){var s=i-t;return(e/=n/2)<1?-s/2*(Math.sqrt(1-e*e)-1)+t:s/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,i,n){var s,a,o,r=i-t;return o=1.70158,0===e?t:1==(e/=n)?t+r:((a=0)||(a=.3*n),(s=r)<Math.abs(r)?(s=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/s),-s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)+t)},easeOutElastic:function(e,t,i,n){var s,a,o,r=i-t;return o=1.70158,0===e?t:1==(e/=n)?t+r:((a=0)||(a=.3*n),(s=r)<Math.abs(r)?(s=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/s),s*Math.pow(2,-10*e)*Math.sin((e*n-o)*(2*Math.PI)/a)+r+t)},easeInOutElastic:function(e,t,i,n){var s,a,o,r=i-t;return o=1.70158,0===e?t:2==(e/=n/2)?t+r:((a=0)||(a=n*(.3*1.5)),(s=r)<Math.abs(r)?(s=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/s),e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/a)*.5+r+t)},easeInBack:function(e,t,i,n,s){return void 0===s&&(s=1.70158),(i-t)*(e/=n)*e*((s+1)*e-s)+t},easeOutBack:function(e,t,i,n,s){return void 0===s&&(s=1.70158),(i-t)*((e=e/n-1)*e*((s+1)*e+s)+1)+t},easeInOutBack:function(e,t,i,n,s){var a=i-t;return void 0===s&&(s=1.70158),(e/=n/2)<1?a/2*(e*e*((1+(s*=1.525))*e-s))+t:a/2*((e-=2)*e*((1+(s*=1.525))*e+s)+2)+t},easeInBounce:function(e,i,n,s){var a=n-i;return a-t.easeOutBounce(s-e,0,a,s)+i},easeOutBounce:function(e,t,i,n){var s=i-t;return(e/=n)<1/2.75?s*(7.5625*e*e)+t:e<2/2.75?s*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?s*(7.5625*(e-=2.25/2.75)*e+.9375)+t:s*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,i,n,s){var a=n-i;return e<s/2?.5*t.easeInBounce(2*e,0,a,s)+i:.5*t.easeOutBounce(2*e-s,0,a,s)+.5*a+i}};e.exports=t},28788:function(e,t,i){i.d(t,{A:function(){return g}});var n,s,a=i(74848),o=i(96540),r=i(24552);function c(e,t){return e+Math.random()*(t-e)}!function(e){e[e.Circle=0]="Circle",e[e.Square=1]="Square",e[e.Strip=2]="Strip"}(n||(n={})),function(e){e[e.Positive=1]="Positive",e[e.Negative=-1]="Negative"}(s||(s={}));const l=1e3/60;class u{constructor(e,t,i,n){this.getOptions=t;const{colors:a,initialVelocityX:o,initialVelocityY:r}=this.getOptions();var l,u;this.context=e,this.x=i,this.y=n,this.w=c(5,20),this.h=c(5,20),this.radius=c(5,10),this.vx="number"==typeof o?c(-o,o):c(o.min,o.max),this.vy="number"==typeof r?c(-r,0):c(r.min,r.max),this.shape=(l=0,u=2,Math.floor(l+Math.random()*(u-l+1))),this.angle=c(0,360)*Math.PI/180,this.angularSpin=c(-.2,.2),this.color=a[Math.floor(Math.random()*a.length)],this.rotateY=c(0,1),this.rotationDirection=c(0,1)?s.Positive:s.Negative}update(e){const{gravity:t,wind:i,friction:a,opacity:o,drawShape:r}=this.getOptions(),c=e/l;this.x+=this.vx*c,this.y+=this.vy*c,this.vy+=t*c,this.vx+=i*c,this.vx*=a**c,this.vy*=a**c,this.rotateY>=1&&this.rotationDirection===s.Positive?this.rotationDirection=s.Negative:this.rotateY<=-1&&this.rotationDirection===s.Negative&&(this.rotationDirection=s.Positive);const u=.1*this.rotationDirection*c;if(this.rotateY+=u,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=o,this.context.lineCap="round",this.context.lineWidth=2,r&&"function"==typeof r)r.call(this,this.context);else switch(this.shape){case n.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case n.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case n.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}
1this.context.closePath(),this.context.restore()}}class m{constructor(e,t){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=e=>{this.particles.splice(e,1)},this.getParticle=()=>{const e=c(this.x,this.w+this.x),t=c(this.y,this.h+this.y);return new u(this.context,this.getOptions,e,t)},this.animate=e=>{const{canvas:t,context:i,particlesGenerated:n,lastNumberOfPieces:s}=this,{run:a,recycle:o,numberOfPieces:r,debug:c,tweenFunction:l,tweenDuration:u}=this.getOptions();if(!a)return!1;const m=this.particles.length,d=o?m:n;if(d<r){s!==r&&(this.tweenProgress=0,this.tweenFrom=d,this.lastNumberOfPieces=r),this.tweenProgress=Math.min(u,Math.max(0,this.tweenProgress+e));const t=l(this.tweenProgress,this.tweenFrom,r,u),i=Math.round(t-d);for(let e=0;e<i;e++)this.particles.push(this.getParticle());this.particlesGenerated+=i}c&&(i.font="12px sans-serif",i.fillStyle="#333",i.textAlign="right",i.fillText(`Particles: ${m}`,t.width-10,t.height-20));for(let h=this.particles.length-1;h>=0;h--){const i=this.particles[h];i.update(e),(i.y>t.height||i.y<-100||i.x>t.width+100||i.x<-100)&&(o&&d<=r?this.particles[h]=this.getParticle():this.removeParticleAt(h))}return m>0||d<r},this.canvas=e;const i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.getOptions=t}}const d={width:"undefined"!=typeof window?window.innerWidth:300,height:"undefined"!=typeof window?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:r.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class h{constructor(e,t){this.lastFrameTime=0,this.setOptionsWithDefaults=e=>{const t={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...t,...d,...e},Object.assign(this,e.confettiSource)},this.update=(e=0)=>{const{options:{run:t,onConfettiComplete:i,frameRate:n},canvas:s,context:a}=this,o=Math.min(e-this.lastFrameTime,50);n&&o<1e3/n?this.rafId=requestAnimationFrame(this.update):(this.lastFrameTime=e-(n?o%n:0),t&&(a.fillStyle="white",a.clearRect(0,0,s.width,s.height)),this.generator.animate(o)?this.rafId=requestAnimationFrame(this.update):(i&&"function"==typeof i&&this.generator.particlesGenerated>0&&i.call(this,this),this._options.run=!1))},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=e;const i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.generator=new m(this.canvas,(()=>this.options)),this.options=t,this.update()}get options(){return this._options}set options(e){const t=this._options?.run,i=this._options?.recycle;this.setOptionsWithDefaults(e),this.generator&&(Object.assign(this.generator,this.options.confettiSource),"boolean"==typeof e.recycle&&e.recycle&&!1===i&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),"boolean"==typeof e.run&&e.run&&!1===t&&this.update()}}const p=o.createRef();class f extends o.Component{constructor(e){super(e),this.canvas=o.createRef(),this.canvas=e.canvasRef||p}componentDidMount(){if(this.canvas.current){const e=x(this.props)[0];this.confetti=new h(this.canvas.current,e)}}componentDidUpdate(){const e=x(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,t]=x(this.props),i={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...t.style};return(0,a.jsx)("canvas",{width:e.width,height:e.height,ref:this.canvas,...t,style:i})}}function x(e){const t={},i={},n=[...Object.keys(d),"confettiSource","drawShape","onConfettiComplete","frameRate"],s=["canvasRef"];for(const a in e){const o=e[a];n.includes(a)?t[a]=o:s.includes(a)?s[a]=o:i[a]=o}return[t,i,{}]}f.defaultProps={...d},f.displayName="ReactConfetti";const g=o.forwardRef(((e,t)=>(0,a.jsx)(f,{canvasRef:t,...e})))}}]); 2//# sourceMappingURL=ece798e9118ce53d4f7d3ce43c767d9213a26e42-5bb37f49f43f651ea43a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.