{"version":3,"file":"../checkout-coupons-326.min.js","sources":["checkout-coupons-326.js"],"sourcesContent":["/**\n * Manage checkout steps state.\n *\n * DEPENDS ON:\n * - jQuery // Interact with WooCommerce events\n */\n(function (root, factory) {\n\tif ( typeof define === 'function' && define.amd ) {\n\t\tdefine([], factory(root));\n\t} else if ( typeof exports === 'object' ) {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.CheckoutCoupons = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {\n\n\t'use strict';\n\n\tvar $ = jQuery;\n\tvar _hasJQuery = ( $ != null );\n\n\tvar _hasInitialized = false;\n\tvar _publicMethods = {};\n\tvar _settings = {\n\t\tbodyClass: 'has-fc-checkout-coupons',\n\n\t\tuiProcessingClass: 'processing',\n\n\t\tsectionWrapperSelector: '.fc-step__substep',\n\t\tgeneralNoticesSelector: '.woocommerce-notices-wrapper',\n\t\tmessagesWrapperSelector: '.fc-coupon-code-messages',\n\n\t\tuseGeneralNoticesSection: 'no',\n\t\tsuppressSuccessMessages: 'no',\n\n\t\tcouponAddedSectionSelector: '.fc-step__substep-text-content--coupon-codes',\n\t\tcouponSectionSelector: '.fc-coupon-code-section',\n\t\tcouponFieldSelector: 'input[name=\"coupon_code\"]',\n\t\taddCouponButtonSelector: '.fc-coupon-code__apply',\n\t\tremoveCouponButtonSelector: '.woocommerce-remove-coupon',\n\t\t\n\t\tcouponCodeAttribute: 'data-coupon',\n\t\treferenceIdAttribute: 'data-reference-id',\n\t\texpansibleCouponSectionKeyAttribute: 'data-section-key',\n\n\t\texpansibleCouponContentSelector: '.fc-expansible-form-section__content',\n\t\texpansibleCouponToggleSelector: '.fc-expansible-form-section__toggle--###SECTION_KEY###',\n\t\texpansibleCouponToggleButtonSelector: '.expansible-section__toggle-plus--###SECTION_KEY###',\n\n\t\tsection_key_placeholder: '###SECTION_KEY###',\n\t}\n\n\n\n\t/**\n\t * METHODS\n\t */\n\n\n\n\t/**\n\t * Add notices in the coupon code section.\n\t *\n\t * @param HTML content HTML content to be displayed.\n\t */\n\tvar showNotices = function( content, referenceElement ) {\n\t\t// Try to get messages wrapper from the coupon code section\n\t\tvar messagesWrapper;\n\t\tvar sectionWrapper = referenceElement ? referenceElement.closest( _settings.sectionWrapperSelector ) : null;\n\t\tif ( sectionWrapper ) {\n\t\t\tmessagesWrapper = sectionWrapper.querySelector( _settings.messagesWrapperSelector );\n\t\t}\n\t\telse {\n\t\t\tmessagesWrapper = document.querySelector( _settings.generalNoticesSelector );\n\t\t}\n\n\t\t// Otherwise try to get messages wrapper from the general notices section\n\t\tif ( 'yes' === _settings.useGeneralNoticesSection ) {\n\t\t\tmessagesWrapper = document.querySelector( _settings.generalNoticesSelector );\n\t\t}\n\n\t\t// Add message\n\t\tif ( messagesWrapper ) {\n\t\t\tmessagesWrapper.innerHTML = content;\n\t\t}\n\t}\n\n\t/**\n\t * Remove all notices from the coupon code section.\n\t *\n\t * @param HTML content HTML content to be displayed.\n\t */\n\tvar clearNotices = function() {\n\t\tvar generalNotices = document.querySelector( _settings.generalNoticesSelector );\n\t\tif ( generalNotices ) {\n\t\t\tgeneralNotices.innerHTML = '';\n\t\t}\n\n\t\tvar messagesWrapper = document.querySelector( _settings.messagesWrapperSelector );\n\t\tif ( messagesWrapper ) {\n\t\t\tmessagesWrapper.innerHTML = '';\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Process adding a coupon code to the cart from the add coupon button.\n\t *\n\t * @param HTMLElement referenceElement The element which was used to trigger adding the coupon.\n\t */\n\tvar processAddCoupon = function( referenceElement ) {\n\t\tvar couponCode = '';\n\n\t\t// Try to get coupon code from attributes\n\t\tif ( referenceElement && referenceElement.hasAttribute( _settings.couponCodeAttribute ) ) {\n\t\t\tcouponCode = referenceElement.getAttribute( _settings.couponCodeAttribute );\n\t\t}\n\n\t\t// Try to get coupon code from coupon field\n\t\tif ( ! couponCode || '' == couponCode ) {\n\t\t\tvar couponSection = referenceElement.closest( _settings.couponSectionSelector );\n\t\t\tvar couponField = couponSection.querySelector( _settings.couponFieldSelector );\n\n\t\t\t// Bail if coupon code field was not found\n\t\t\tif ( ! couponField ) { return; }\n\n\t\t\t// Focus on add coupon button and bail if coupon field is empty\n\t\t\tif ( '' === couponField.value.trim() ) {\n\t\t\t\tcouponField.value = ''; // Clear space chars if any\n\t\t\t\tcouponField.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcouponCode = couponField.value;\n\t\t}\n\n\t\t// Bail if coupon code was not provided\n\t\tif ( ! couponCode || '' == couponCode ) { return; }\n\n\t\t_publicMethods.addCouponCode( couponCode, referenceElement );\n\t}\n\t\n\t/**\n\t * Process removing a coupon code to the cart from the add coupon button.\n\t *\n\t * @param HTMLElement referenceElement The remove coupon button element.\n\t */\n\tvar processRemoveCoupon = function( referenceElement ) {\n\t\t// Bail if add coupon button not provided\n\t\tif ( ! referenceElement ) { return; }\n\n\t\tvar couponCode = '';\n\n\t\t// Try to get coupon code from button attributes\n\t\tif ( referenceElement.hasAttribute( _settings.couponCodeAttribute ) ) {\n\t\t\tcouponCode = referenceElement.getAttribute( _settings.couponCodeAttribute );\n\t\t}\n\n\t\t// Bail if coupon code was not provided\n\t\tif ( ! couponCode || '' == couponCode ) { return; }\n\n\t\t_publicMethods.removeCouponCode( couponCode, referenceElement );\n\t}\n\n\n\n\t/**\n\t * Handle document clicks and route to the appropriate function.\n\t */\n\tvar handleClick = function( e ) {\n\n\t\t// ADD COUPON\n\t\tif ( e.target.closest( _settings.addCouponButtonSelector ) ) {\n\t\t\te.preventDefault();\n\t\t\tvar addCouponButton = e.target.closest( _settings.addCouponButtonSelector );\n\t\t\tprocessAddCoupon( addCouponButton );\n\t\t}\n\t\t// REMOVE COUPON\n\t\telse if ( e.target.closest( _settings.removeCouponButtonSelector ) ) {\n\t\t\te.preventDefault();\n\t\t\tvar removeCouponButton = e.target.closest( _settings.removeCouponButtonSelector );\n\t\t\tprocessRemoveCoupon( removeCouponButton );\n\t\t}\n\n\t};\n\n\t/**\n\t * Handle keypress event.\n\t */\n\t var handleKeyDown = function( e ) {\n\t\t// ENTER on input fields\n\t\tif ( FCUtils.keyboardKeys.ENTER === e.key && e.target.closest( _settings.couponFieldSelector ) ) {\n\t\t\t// Prevents submitting form\n\t\t\te.preventDefault();\n\n\t\t\t// ADD COUPON\n\t\t\tprocessAddCoupon( e.target.closest( _settings.couponFieldSelector ) );\n\t\t}\n\t};\n\n\n\n\t/**\n\t * Use the same method that WooCommerce uses to block other parts of the checkout form while updating.\n\t * The UI is unblocked by the WooCommerce `checkout.js` script (which is replaced with a modified version but keeps the same behavior)\n\t * using the checkout fragment selector, then unblocking after the checkout update is completed.\n\t *\n\t * @param HTMLElement element Element to block the UI and show the loading indicator.\n\t */\n\t_publicMethods.blockUI = function( element ) {\n\t\t// Bail if jQuery is not available\n\t\tif ( ! _hasJQuery ) { return; }\n\n\t\t// Bail if element is invalid\n\t\tif ( ! element ) { return; }\n\n\t\t$( element ).addClass( _settings.uiProcessingClass ).block( {\n\t\t\tmessage: null,\n\t\t\toverlayCSS: {\n\t\t\t\tbackground: '#fff',\n\t\t\t\topacity: 0.6\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Unblock UI element to be used again.\n\t *\n\t * @param HTMLElement element Element to get the UI unblocked.\n\t *\n\t * @see blockUI\n\t */\n\t_publicMethods.unblockUI = function( element ) {\n\t\t// Bail if jQuery is not available\n\t\tif ( ! _hasJQuery ) { return; }\n\n\t\t$( element ).removeClass( _settings.uiProcessingClass ).unblock();\n\t}\n\n\n\n\t/**\n\t * Add a coupon code to the cart.\n\t *\n\t * @param string couponCode The coupon code to be added to the cart.\n\t */\n\t_publicMethods.addCouponCode = function( couponCode, referenceElement ) {\n\t\t// Bail if coupon code was not provided\n\t\tif ( ! couponCode || '' == couponCode ) { return; }\n\n\t\tclearNotices();\n\n\t\t// Get reference id and save to reference element\n\t\tvar reference_id = Math.floor( Math.random() * 1000 );\n\t\tif ( referenceElement ) {\n\t\t\treferenceElement.setAttribute( _settings.referenceIdAttribute, reference_id );\n\t\t}\n\n\t\t// Block coupon section\n\t\tvar couponAddedSection = document.querySelector( _settings.couponAddedSectionSelector );\n\t\t_publicMethods.blockUI( couponAddedSection );\n\n\t\t// Add security nonce\n\t\tvar data = {\n\t\t\tsecurity: _settings.addCouponCodeNonce,\n\t\t\tcoupon_code: couponCode,\n\t\t\treference_id: reference_id,\n\t\t}\n\n\t\t$.ajax({\n\t\t\ttype:\t\t'POST',\n\t\t\turl:\t\tfcSettings.wcAjaxUrl.replace( '%%endpoint%%', 'fc_add_coupon_code' ),\n\t\t\tdata:\t\tdata,\n\t\t\tdataType: 'json',\n\t\t\tsuccess:\tfunction( response ) {\n\n\t\t\t\t// Get back the reference id\n\t\t\t\tvar referenceElement;\n\t\t\t\tif ( response.reference_id ) {\n\t\t\t\t\treferenceElement = document.querySelector( '[' + _settings.referenceIdAttribute + '=\"' + response.reference_id + '\"]' );\n\t\t\t\t}\n\n\t\t\t\t// Maybe process success\n\t\t\t\tif ( response.result && 'success' === response.result ) {\n\t\t\t\t\t// Maybe add messages\n\t\t\t\t\tif ( response.message && 'yes' !== _settings.suppressSuccessMessages ) {\n\t\t\t\t\t\tshowNotices( response.message, referenceElement );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Maybe remove coupon code value from the field\n\t\t\t\t\tvar couponField = document.querySelector( _settings.couponFieldSelector );\n\t\t\t\t\tif ( couponField ) {\n\t\t\t\t\t\tcouponField.value = '';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Maybe close the coupon code field section\n\t\t\t\t\tif ( window.CollapsibleBlock ) {\n\n\t\t\t\t\t\t// Get expansible content section\n\t\t\t\t\t\tvar expansibleCouponContent = referenceElement.closest( _settings.expansibleCouponContentSelector );\n\n\t\t\t\t\t\t// Maybe collapse/expanse sections after adding coupon\n\t\t\t\t\t\tif ( expansibleCouponContent ) {\n\t\t\t\t\t\t\t// Collapse the coupon code field content section\n\t\t\t\t\t\t\tCollapsibleBlock.collapse( expansibleCouponContent );\n\n\t\t\t\t\t\t\t// Get section key and toggle elements\n\t\t\t\t\t\t\tvar section_key = expansibleCouponContent.getAttribute( _settings.expansibleCouponSectionKeyAttribute );\n\t\t\t\t\t\t\tvar expansibleCouponToggle = document.querySelector( _settings.expansibleCouponToggleSelector.replace( _settings.section_key_placeholder, section_key ) );\n\t\t\t\t\t\t\tvar expansibleCouponToggleButton = document.querySelector( _settings.expansibleCouponToggleButtonSelector.replace( _settings.section_key_placeholder, section_key ) );\n\n\t\t\t\t\t\t\t// Maybe expand coupon code toggle section\n\t\t\t\t\t\t\tif ( expansibleCouponToggle ) {\n\t\t\t\t\t\t\t\tCollapsibleBlock.expand( expansibleCouponToggle );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Maybe focus back to the add coupon code button\n\t\t\t\t\t\t\tif ( expansibleCouponToggleButton ) {\n\t\t\t\t\t\t\t\texpansibleCouponToggleButton.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$( document.body ).trigger( 'wc_fragment_refresh' );\n\t\t\t\t\t$( document.body ).trigger( 'applied_coupon_in_checkout', [ data.coupon_code ] );\n\t\t\t\t\t$( document.body ).trigger( 'update_checkout', { update_shipping_method: false } );\n\t\t\t\t}\n\t\t\t\t// Maybe process error\n\t\t\t\telse if ( response.result && 'error' === response.result ) {\n\t\t\t\t\t// Display new messages\n\t\t\t\t\tshowNotices( response.message, referenceElement );\n\n\t\t\t\t\t// Trigger error event\n\t\t\t\t\t$( document.body ).trigger( 'checkout_error' , [ response.message ] );\n\n\t\t\t\t\t// Unblock coupon section\n\t\t\t\t\tvar couponAddedSection = document.querySelector( _settings.couponAddedSectionSelector );\n\t\t\t\t\tif ( couponAddedSection ) {\n\t\t\t\t\t\t_publicMethods.unblockUI( couponAddedSection );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\t};\n\n\n\n\t/**\n\t * Remove coupon from the cart.\n\t *\n\t * @param string couponCode The coupon code to be removed from the cart.\n\t */\n\t_publicMethods.removeCouponCode = function( couponCode, referenceElement ) {\n\t\t// Bail if coupon code was not provided\n\t\tif ( ! couponCode || '' == couponCode ) { return; }\n\n\t\tclearNotices();\n\n\t\t// Get reference id and save to reference element\n\t\tvar reference_id = Math.floor( Math.random() * 1000 );\n\t\tif ( referenceElement ) {\n\t\t\treferenceElement.setAttribute( _settings.referenceIdAttribute, reference_id );\n\t\t}\n\n\t\t// Block coupon section\n\t\tvar couponAddedSection = document.querySelector( _settings.couponAddedSectionSelector );\n\t\t_publicMethods.blockUI( couponAddedSection );\n\n\t\t// Add security nonce\n\t\tvar data = {\n\t\t\tsecurity: _settings.removeCouponCodeNonce,\n\t\t\tcoupon_code: couponCode,\n\t\t\treference_id: reference_id,\n\t\t}\n\n\t\t$.ajax({\n\t\t\ttype:\t\t'POST',\n\t\t\turl:\t\tfcSettings.wcAjaxUrl.replace( '%%endpoint%%', 'fc_remove_coupon_code' ),\n\t\t\tdata:\t\tdata,\n\t\t\tdataType: 'json',\n\t\t\tsuccess:\tfunction( response ) {\n\t\t\t\t// Get back the reference id\n\t\t\t\tvar referenceElement;\n\t\t\t\tif ( response.reference_id ) {\n\t\t\t\t\treferenceElement = document.querySelector( '[' + _settings.referenceIdAttribute + '=\"' + response.reference_id + '\"]' );\n\t\t\t\t}\n\n\t\t\t\t// Maybe process success\n\t\t\t\tif ( response.result && 'success' === response.result ) {\n\t\t\t\t\t// Maybe add messages\n\t\t\t\t\tif ( response.message && 'yes' !== _settings.suppressSuccessMessages ) {\n\t\t\t\t\t\tshowNotices( response.message, referenceElement );\n\t\t\t\t\t}\n\n\t\t\t\t\t$( document.body ).trigger( 'wc_fragment_refresh' );\n\t\t\t\t\t$( document.body ).trigger( 'removed_coupon_in_checkout', [ data.coupon_code ] );\n\t\t\t\t\t$( document.body ).trigger( 'update_checkout', { update_shipping_method: false } );\n\t\t\t\t}\n\t\t\t\t// Maybe process error\n\t\t\t\telse if ( response.result && 'error' === response.result ) {\n\t\t\t\t\t// Display new messages\n\t\t\t\t\tshowNotices( response.message, referenceElement );\n\n\t\t\t\t\t// Unblock coupon section\n\t\t\t\t\tvar couponAddedSection = document.querySelector( _settings.couponAddedSectionSelector );\n\t\t\t\t\tif ( couponAddedSection ) {\n\t\t\t\t\t\t_publicMethods.unblockUI( couponAddedSection );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\t};\n\n\n\n\t/**\n\t * Initialize component and set related handlers.\n\t */\n\t_publicMethods.init = function( options ) {\n\t\tif ( _hasInitialized ) { return; }\n\n\t\t// Merge settings\n\t\t_settings = FCUtils.extendObject( _settings, options );\n\n\t\t// Add event listeners\n\t\twindow.addEventListener( 'click', handleClick, true );\n\t\tdocument.addEventListener( 'keydown', handleKeyDown, true );\n\n\t\t// Add init class\n\t\tdocument.body.classList.add( _settings.bodyClass );\n\n\t\t_hasInitialized = true;\n\t};\n\n\n\n\t//\n\t// Public APIs\n\t//\n\treturn _publicMethods;\n\n});\n"],"names":["root","factory","define","amd","exports","module","CheckoutCoupons","global","this","window","showNotices","content","referenceElement","messagesWrapper","sectionWrapper","closest","_settings","sectionWrapperSelector","querySelector","messagesWrapperSelector","document","generalNoticesSelector","useGeneralNoticesSection","innerHTML","clearNotices","generalNotices","processAddCoupon","couponCode","hasAttribute","couponCodeAttribute","getAttribute","couponField","couponSectionSelector","couponFieldSelector","value","trim","focus","_publicMethods","addCouponCode","handleClick","e","removeCouponButton","target","addCouponButtonSelector","preventDefault","addCouponButton","removeCouponButtonSelector","removeCouponCode","handleKeyDown","FCUtils","keyboardKeys","ENTER","key","$","jQuery","_hasJQuery","_hasInitialized","bodyClass","uiProcessingClass","suppressSuccessMessages","couponAddedSectionSelector","referenceIdAttribute","expansibleCouponSectionKeyAttribute","expansibleCouponContentSelector","expansibleCouponToggleSelector","expansibleCouponToggleButtonSelector","section_key_placeholder","blockUI","element","addClass","block","message","overlayCSS","background","opacity","unblockUI","removeClass","unblock","reference_id","data","Math","floor","random","setAttribute","couponAddedSection","security","addCouponCodeNonce","coupon_code","ajax","type","url","fcSettings","wcAjaxUrl","replace","dataType","success","response","expansibleCouponToggleButton","result","CollapsibleBlock","expansibleCouponContent","collapse","section_key","expansibleCouponToggle","expand","body","trigger","update_shipping_method","removeCouponCodeNonce","init","options","extendObject","addEventListener","classList","add"],"mappings":"CAMA,CAAWA,EAAMC,KACO,YAAlB,OAAOC,QAAyBA,OAAOC,IAC3CD,OAAO,GAAID,EAAY,CAAC,EACM,UAAnB,OAAOG,QAClBC,OAAOD,QAAUH,EAAY,EAE7BD,EAAKM,gBAAkBL,EAAY,CAEpC,GAAoB,aAAlB,OAAOM,OAAyBA,OAASC,KAAKC,QAAUD,KAAKD,OAAQ,SAAUP,GAmD/D,SAAdU,EAAwBC,EAASC,GAKnCC,GAFGC,EAAiBF,EAAmBA,EAAiBG,QAASC,EAAUC,sBAAuB,EAAI,MAEpFH,EAAeI,cAAeF,EAAUG,uBAAwB,EAGhEC,SAASF,cAAeF,EAAUK,sBAAuB,GAK3ER,EADI,QAAUG,EAAUM,yBACNF,SAASF,cAAeF,EAAUK,sBAAuB,EAIvER,KACJA,EAAgBU,UAAYZ,EAE9B,CAOmB,SAAfa,IACH,IAAIC,EAAiBL,SAASF,cAAeF,EAAUK,sBAAuB,EACzEI,IACJA,EAAeF,UAAY,KAIvBV,EADiBO,SAASF,cAAeF,EAAUG,uBAAwB,KAE/EN,EAAgBU,UAAY,GAE9B,CASuB,SAAnBG,EAA6Bd,GAChC,IAAIe,EAAa,GAQjB,GAAK,EAJJA,EADIf,GAAoBA,EAAiBgB,aAAcZ,EAAUa,mBAAoB,EACxEjB,EAAiBkB,aAAcd,EAAUa,mBAAoB,EAIpEF,IAAc,IAAMA,EAAa,CACvC,IACII,EADgBnB,EAAiBG,QAASC,EAAUgB,qBAAsB,EAC9Cd,cAAeF,EAAUiB,mBAAoB,EAG7E,GAAK,CAAEF,EAAg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