PageSourceSearch

https://www.luskeye.com/wp-content/plugins/gravityforms/assets/js/…/gform-products.5d88f84acb15b2df9b6d.min.js

js luskeye.com collected 2026-09-30 20:53:19 UTC 4,926 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgravityforms=self.webpackChunkgravityforms||[]).push([[157],{3445:function(e,t,n){n.r(t),n.d(t,{default:function(){return F}});var r=n(5798),i=n(455),c=n(9280),u=n.n(c),o=n(3771),a=n(1295),d=function(e,t){switch(e.inputType){case"select":return g(e,t,"value");case"radio":return v(e,t,"value");default:return e.label}},l=function(e,t){switch(e.inputType){case"select":return g(e,t,"price");case"price":return(0,r.getNode)(".ginput_amount",t,!0).value;case"calculation":return(0,r.getNode)(".ginput_calculated_price",t,!0).value;case"radio":return v(e,t,"price");default:return e.basePrice?e.basePrice:0}},f=function(e){return"hidden"===e.getAttribute("data-conditional-logic")},p=function(e,t){return(0,r.getNode)("#field_".concat(e.dataset.formid,"_").concat(t),e,!0)},s=function(e,t){if(!e)return null;var n=e.split("|")[0],r=t.choices.filter((function(e){return e.value===n}));return r&&r.length?r[0]:null},g=function(e,t,n){var i=(0,r.getNode)("select",t,!0),c=s(i.options[i.selectedIndex].value,e);return c?c[n]:""},v=function(e,t,n){var i=(0,r.getNodes)("input",!0,t,!0).find((function(e){return e.checked})),c=i?s(i.value,e):null;return c?c[n]:""},h=function(e,t,n){var r=[];return e.options?(Object.keys(e.options).forEach((function(i){var c=e.options[i],u=p(t,i);"checkbox"===c.inputType?r=r.concat(m(c,u,e.label,n)):_(c,u)&&r.push({id:i,name:d(c,u),field_label:e.label,price:n.toNumber(l(c,u))})})),r):[]},m=function(e,t,n,i){if(!t)return[];if(f(t))return[];var c=(0,r.getNodes)(".gfield_checkbox input",!0,t,!0);if(!c.length)return[];var u=[];return c.forEach((function(t){if(t.checked){var r=s(t.value,e),c={id:String(e.id),name:r.value,field_label:n,price:i.toNumber(r.price)};u.push(c)}})),u},_=function(e,t){return!!t&&(!f(t)&&!!d(e,t))},b=function(e,t,n){var r=p(t,e.id);return!!y(e,r)&&{id:String(e.id),name:d(e,r),price:n.toNumber(l(e,r))}},y=function(e,t){return!!t&&(!f(t)&&!!d(e,t))},N=n(2557),k=function(e){var t=e.detail.formId;x(t)},E=function(e){var t=A(e.target),n=w(e.target),i=e.target;(0,r.trigger)({event:"gform/products/product_field_changed",data:{event:e,formId:t,productFieldId:n,htmlInput:i},native:!1}),x(t)},w=function(e){var t=e.closest(".gfield"),n=t.className.split(" ").find((function(e){return e.startsWith("gfield_price_")}));return void 0===n?t.id.split("_").pop():n.split("_").pop()},x=function(){var e=(0,i.A)(u().mark((function e(t){var n,i,c,f,p,s,g;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new a.A(window.gf_global.gf_currency_config),i=(0,r.getNode)("#gform_".concat(t),document,!0)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,(0,N.x)("gform_theme_config/common/form/product_meta",t);case 6:if(c=e.sent,f=c?c.products:null){e.next=10;break}return e.abrupt("return");case 10:return p={products:[]},Object.keys(f).forEach((function(e){var c=f[e],u=(0,r.getNode)("#field_".concat(t,"_").concat(e),i,!0);u&&I(c,u,i)&&p.products.push({id:e,name:d(c,u),price:n.toNumber(l(c,u)),quantity:q(c,u,i),options:h(c,i,n)})})),(s=!!c.shipping&&b(c.shipping,i,n))&&(p.shipping=s),e.next=16,(0,r.filter)({event:"gform/products/product_changed",data:{formId:t,products:p}});case 16:g=e.sent,p=g.products,t=g.formId,o.hZ(t,"products",p);case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(e,t,n){if(!t)return!1;if(f(t))return!1;var r=d(e,t),i=l(e,t),c=q(e,t,n);return r&&""!==i&&c},q=function(e,t,n){var i=(0,r.getNode)(".gfield_quantity_".concat(n.dataset.formid,"_").concat(e.id),n,!0),c=i?(0,r.getNode)("input, select",i,!0):(0,r.getNode)(".ginput_quantity",t,!0);return c?c.value?parseFloat(c.value):0:1},A=function(e){var t=e.closest("form");return t?t.dataset.formid:null};window.gform.products={getPaymentAmount:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=o.Jt(e,"products");if(0===(null==n?void 0:n.products.length))return 0;for(var r=0,i=0;i<n.products.length;i++){for(var c=n.products[i],u=c.price,a=0;a<c.options.length;a++)u+=c.options[a].price;if(u*=c.quantity,t&&parseFloat(t)===parseFloat(c.id))return u;r+=u}return n.shipping&&(r+=n.shipping.price),n.discount&&(r-=n.discount),r}};var L=n(428),S=n.n(L),F=function(e){x(e),document.addEventListener("gform/conditionalLogic/applyRules/end",k),document.querySelectorAll('.gfield_price input[type="text"], .gfield_price input[type="number"]').forEach((function(e){e.addEventListener("input",E),e.addEventListener("change",E)})),document.querySelectorAll(".gfield_price select").forEach((function(e){
1S()(e).on("change",E)})),document.querySelectorAll(".ginput_calculated_price").forEach((function(e){e.addEventListener("change",E)})),document.querySelectorAll('.gfield_price input[type="radio"], .gfield_price input[type="checkbox"]').forEach((function(e){e.addEventListener("click",E)})),(0,r.consoleInfo)("Gravity Forms Theme: Initialized product field.")}}}]);

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.