"use strict";var DesignSystem;(globalThis.webpackChunkDesignSystem=globalThis.webpackChunkDesignSystem||[]).push([[220],{7939:(t,n,e)=>{e.d(n,{Z:()=>y});var a=e(4184),s=e.n(a),i=e(1749),r=e(877),o=e(7591),l=e(8768),c=e(8661),d=e(7320);const u=t=>{const{analytics:n,analyticsLabelOverride:e,analyticsParentHeading:a,analyticsParentType:u,onAnalyticsEvent:y,children:b,className:p,inputRef:v,isAlternate:f,onClick:k,onDark:h,size:g,variation:m,..._}=t,{contentRef:A,sendButtonEvent:Z}=function(t){let{analytics:n,analyticsLabelOverride:e,analyticsParentHeading:a,analyticsParentType:s,href:i,onAnalyticsEvent:d=(0,r.vc)().defaultAnalyticsFunction,type:u,variation:y}=t;const b=(0,c.sO)();return{contentRef:b,sendButtonEvent:function(){if(!0!==n&&(!(0,r.vc)().buttonSendsAnalytics||!1===n))return;const t=e??(0,o.L)([b]),c=y??"default",p=u??"button",v=a??" ",f=s??" ";return d({event_name:"button_engagement",event_extension:l.RW,text:t,button_style:c,button_type:i?"link":p,parent_component_heading:v,parent_component_type:f,...i?{link_url:i}:{}})}}}(t),D=t.href?"a":"button",E=f&&"ds-c-button--alternate",O=h&&"ds-c-button--on-dark",S=g&&`ds-c-button--${g}`,B=m&&`ds-c-button--${m}`,C={..._,className:s()("ds-c-button",E,O,S,B,p)};function P(n){t.disabled||(Z(),k&&k(n))}return"button"!==D&&(delete C.disabled,delete C.type,t.disabled&&(C.role="link",C["aria-disabled"]=!0,delete C.href)),(0,d.tZ)(D,{ref:(0,i.Z)([v,A]),onClick:P,onKeyPress:"a"===D?function(t){" "===t.key&&P(t)}:void 0,...C,children:b})};u.defaultProps={isAlternate:!1,onDark:!1,type:"button"};const y=u},7591:(t,n,e)=>{function a(t){return t.map((t=>t.current?.textContent)).find((t=>t))}e.d(n,{L:()=>a,Z:()=>s});const s=a},1749:(t,n,e)=>{function a(t){return n=>{t.forEach((t=>{"function"==typeof t?t(n):null!=t&&(t.current=n)}))}}e.d(n,{Z:()=>a})},9867:(t,n,e)=>{e.r(n);var a=e(6652),s=e(7939),i=e(5600),r=e(7320);const o=["class-name","disabled","href","is-alternate","is-on-dark","size","type","variation","target",...i.E],l=t=>{let{isAlternate:n,isOnDark:e,analytics:a,...i}=t;return(0,r.tZ)(s.Z,{...i,isAlternate:n&&Boolean(JSON.parse(n)),onDark:e&&Boolean(JSON.parse(e)),analytics:a&&Boolean(JSON.parse(a))})};(0,a.O)("ds-button",(()=>l),{attributes:o,events:["onClick","onAnalyticsEvent"]})},5600:(t,n,e)=>{e.d(n,{E:()=>a});const a=["analytics","analytics-label-override","analytics-event-type-override","analytics-parent-heading","analytics-parent-type"]},7320:(t,n,e)=>{e.d(n,{BX:()=>a.BX,HY:()=>a.HY,tZ:()=>a.tZ}),e(8661);var a=e(6584)}},t=>{var n=(9867,t(t.s=9867));DesignSystem=n}]);
//# sourceMappingURL=ds-button.js.map