1import{c as p,d as f}from"../chunks/chunk-QBXDV46J.min.js?v=a41b816ae42eb0233c705c3db5b8f52196852d5a";import{g as d}from"../chunks/chunk-DMYXLCJV.min.js?v=d53f836afd277bec77549ecc64abb773212012b6";import{J as u,c as s,e as m}from"../chunks/chunk-XD26YMVM.min.js?v=dc288bca9a7d2b46c2ed5db162460410b6d1245f";import"../chunks/chunk-5RFOD5JI.min.js?v=2ea3255526bc4d2e1079234ff1cadf5107d5fdd9";var{launchModalForm:h,DynamicModalWrapperManager:N}=await import("./form-modal-launcher.min.js?v=869fb014637397da7b141ade4ec2881bd2e2f853"),n={widgetName:"data-widget-name",ctaText:"data-download-cta-text",setupName:"data-setup-name",videoGuidId:"data-video-guid-id",ctaType:"data-widget-cta-type",variation:"data-widget-variation",instanceId:"data-widget-instance-id",modalType:"data-modal-type"};function D(e){return e.is(`*[${n.widgetName}]`)?e:e.closest(`*[${n.widgetName}]`)}function I(e){let t=(e.is(`*[${n.ctaText}]`)?e.attr(n.ctaText):null)?.trim();if(s(t)){let o=e.is(".js-cta-text-element")?e:e.find(".js-cta-text-element");o.length===0&&(o=e),t=o.text().trim()}return t}function T(e){let{$ctaButton:t}=e,o=t.attr(n.setupName);return m(o)&&o.trim().length>0?{setupName:o}:{}}function S(e){let{widgetName:t,$widgetEl:o}=e;return t==="DocSelectorBladeWidgetController"?{documentSelector:[].slice.call(o.find(".docSelector-list input:checked, .docSelector-list .docSelector-title[value]")).map(i=>$(i).attr("value")).filter(m)}:{}}function x(e){let{widgetName:t,$ctaButton:o}=e;return t==="VideoCarouselBladeWidgetController"?{videoSelector:o.attr("data-video-guid-id")}:{}}function g(e){let t=D(e),o=I(e),r=e.attr(n.ctaType),i=t.attr(n.widgetName),a=t.attr(n.variation),c=t.attr(n.instanceId),l=t.attr(n.modalType);return{$ctaButton:e,$widgetEl:t,widgetName:i,variation:a,instanceId:c,modalType:l,ctaText:o,ctaType:f.includes(r)?r:null}}function w(e,t){let{ctaText:o,ctaType:r,$ctaButton:i}=t;e.setup.tracking??={usePageOfferId:!1};let{tracking:a}=e.setup;a.ctaText=o,a.ctaType=r,a.ctaElement=i}var k=N;async function F(e){let{instanceId:t}=e;if(s(t))throw d.warn("Property 'instanceId' cannot be Nil",e),new Error("Property 'instanceId' cannot be Nil");let o=T(e),r=S(e),i={...o,...r},a=u.WidgetData.Get(t,i);if(p(a,"ResourceForm",!0)){w(a,e),d.debug("initializeDocumentForm");let{appInstance:c,componentInstance:l}=await h({formSettingsKey:"document",widgetData:a,isInModal:!0});return{appInstance:c,componentInstance:l}}throw new Error("The referenced widgetData is not of type 'ResourceForm'")}async function y(e,t){let{instanceId:o}=e;if(s(o))throw d.warn("Property 'instanceId' cannot be Nil",e),new Error("Property 'instanceId' cannot be Nil");let r=T(e),i=x(e),a={...r,...i},c=u.WidgetData.Get(o,a);if(p(c,t==="video"?"VideoForm":"GatedVideoForm",!0)){w(c,e);let{appInstance:M,componentInstance:L}=await h({formSettingsKey:t,widgetData:c,isInModal:!0});return{appInstance:M,componentInstance:L}}throw new Error("The referenced widgetData is not of type 'VideoForm' or 'GatedVideoForm'")}window.McForm??={};window.McForm.CtaModalLauncher??={launchVideoForm:y,launchDocumentForm:F};function W(){$(document).on("click",`.js-cta-modal-launcher[${n.modalType}='Document']`,function(){let e=g($(this));F(e).catch(d.error)}),$(document).on("click",`.js-cta-modal-launcher[${n.modalType}='Video']`,function(){let e=g($(this));y(e,"video").catch(d.error)}),$(document).on("click",`.js-cta-modal-launcher[${n.modalType}='VideoGated']`,function(){let e=g($(this));y(e,"video-gated").catch(d.error)})}export{k as dynamicModalWrapper,W as initCtaModalLauncherListeners,F as launchDocumentForm,y as launchVideoForm}; 2 3//# sourceMappingURL=https://static.mastercontrol.com/assets/js/marketo/form-cta-modal-launcher.min.js.map?v=9e2465bc014cb0bccfe7ab9bb2aaea27e08865ae
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.