PageSourceSearch

https://sevencycles.com/7/wp-content/plugins/advanced-coupons-for-…/dist/common/NoticesPlugin.b7812937.js

js sevencycles.com collected 2026-10-01 12:10:51 UTC 2,673 bytes, 1 lines download raw bytes

1function k(){const{registerCheckoutFilters:c}=wc.blocksCheckout,{select:o}=wp.data;c("advanced-coupons-extension",{coupons:n=>{const t=o("wc/store/cart").getCartData(),{acfwp_block:e}=t.extensions;return n.map(a=>{let i=e.coupons.find(r=>r.code===a.code);return{...a,label:i.label?i.label:a.label}})}})}function O(){const{subscribe:c,select:o}=wp.data;c(()=>{const n=o("wc/store/cart"),s=n.getCartData(),{acfwp_block:t}=s.extensions;if(n.isApplyingCoupon()){const a=n.getCouponBeingApplied();t.coupons.find(r=>r.code===a&&r.force_apply)&&jQuery(".wc-block-components-notices").hide()}})}const p={ACFWP_NOTICE_ONE_CLICK_APPLY:"ACFWP_NOTICE_ONE_CLICK_APPLY",ACFWP_NOTICE_NON_QUALIFYING:"ACFWP_NOTICE_NON_QUALIFYING"},{dispatch:l,useSelect:N}=wp.data,f=(c,o,n)=>{var t;const s=(t=c.val())==null?void 0:t.toString().trim();c.off("click"),c.on("click",()=>{c.prop("disabled",!0),l("wc/store/cart").applyCoupon(s).then(()=>{l("core/notices").createNotice("success","".concat(o.replace("{coupon_code}","".concat(s))),{type:"snackbar",context:n}),l("core/notices").removeNotice(p.ACFWP_NOTICE_ONE_CLICK_APPLY,n)})})},w=c=>{const o="acfw/notices",{StoreNoticesContainer:n}=wc.blocksCheckout,s=N(e=>e("wc/store/cart").getCartData()),{acfwp_block:t}=s.extensions;return!t||!t.one_click_apply.notices?null:(t.one_click_apply.notices.forEach(e=>{l("core/notices").createNotice(e.type,e.message,{context:o,id:p.ACFWP_NOTICE_ONE_CLICK_APPLY}).then(()=>{const a=jQuery("button.acfw_apply_notification");a.length&&f(a,t.one_click_apply.on_apply_success,o)})}),React.createElement(n,{context:o}))},{dispatch:_,useSelect:E}=wp.data,{useEffect:g,useRef:y}=wp.element;var C,d;const A=(d=(C=wp.htmlEntities)==null?void 0:C.decodeEntities)!=null?d:c=>c,I=()=>{const c="acfw/non-qualifying-notices",{StoreNoticesContainer:o}=wc.blocksCheckout,n=y([]),s=E(t=>{var a,i,r,u;const e=t("wc/store/cart").getCartData();return(u=(r=(i=(a=e==null?void 0:e.extensions)==null?void 0:a.acfwp_block)==null?void 0:i.non_qualifying)==null?void 0:r.notices)!=null?u:[]});return g(()=>{const t=s.map(e=>"".concat(p.ACFWP_NOTICE_NON_QUALIFYING,"_").concat(e.id));n.current.forEach(e=>{t.includes(e)||_("core/notices").removeNotice(e,c)}),s.forEach(e=>{_("core/notices").createNotice(e.type,A(e.message),{context:c,id:"".concat(p.ACFWP_NOTICE_NON_QUALIFYING,"_").concat(e.id)})}),n.current=t},[JSON.stringify(s)]),React.createElement(o,{context:c})};function h(){const{registerPlugin:c}=wp.plugins,{ExperimentalOrderMeta:o}=wc.blocksCheckout;c("acfw-notices",{render:()=>React.createElement(o,null,React.createElement(w,null),React.createElement(I,null)),scope:"woocommerce-checkout"})}export{k as C,O as a,h as r};

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.