PageSourceSearch

https://calc-js.signs.com/custom-size-handler-min.js?v=1789092699276

js signs.com collected 2026-09-24 19:32:08 UTC 5,654 bytes, 1 lines download raw bytes

1"use strict";(this.webpackJsonpSharedCalc=this.webpackJsonpSharedCalc||[]).push([[8731],{233:function(t,e,a){a.r(e),a.d(e,{CustomSizeHandler:function(){return m}});var i=a(659),r=a(3),o=a(5896),n=a(9552),c=a(7843),l=a(9949),s=a(3760),u=a(5337),d=a(7538),p=a(2224),f=a(5859),h=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},m=function(){function t(t,e,a,i,o,c,l,s){var u=this;this.componentHelper=t,this.templateConfigHelper=e,this.calculator=a,this.calcDOMHelper=i,this.componentFactory=o,this.calcInfoService=c,this.sizeService=l,this.attributeService=s,this.dynamicSize=!1,this.setData=function(t,e){u.id=t,u.attributeId=e.attribute_id},this.init=function(){u.calculatorData=u.calculator.getData(),u.config=u.templateConfigHelper.getMergedConfig(),u.setCustomSizeTooltipEvent(),u.showCustomSizeModal=u.showCustomSizeModal.bind(u),u.mainElementRef.addEventListener("calc.customSizeModal",u.showCustomSizeModal)},this.showCustomSizeModal=function(t){return e=u,a=void 0,r=function(){var e;return function(t,e){var a,i,r,o,n={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(l){return function(c){if(a)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(a=1,i&&(r=2&c[0]?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(!((r=(r=n.trys).length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){n=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){n.label=c[1];break}if(6===c[0]&&n.label<r[1]){n.label=r[1],r=c;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(c);break}r[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t],i=0}finally{a=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}(this,function(a){switch(a.label){case 0:return this.calcInfoService.isCustomModalOpen?[2,!1]:(this.calcInfoService.setCustomSizeModalStatus(!0),e="dropdown",this.componentHelper.getComponentInstance("box_".concat(t.detail.attribute_id))&&(e="box"),[4,this.componentFactory.getComponent({id:"custom_size",type:n.I.CUSTOM_SIZE,sub_type:"custom-size-attribute",data:{display_type:e,attribute_data:t.detail}})]);case 1:return a.sent(),[2]}})},new((i=void 0)||(i=Promise))(function(t,o){function n(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(e){var a;e.done?t(e.value):(a=e.value,a instanceof i?a:new i(function(t){t(a)})).then(n,c)}l((r=r.apply(e,a||[])).next())});var e,a,i,r},this.setCustomSizeTooltipEvent=function(){var t=u.mainElementRef.querySelector(".custom-size-tooltip");t&&t.addEventListener("click",function(){var t=u.calculatorData.prod_attrs[u.attributeId],e=t.prod_attr_vals,a=null;for(var i in e)if(u.sizeService.isCustomSizeBySizeValue(t,i)){a=e[i].prod_attr_val_id;break}r.U.dispatchEvent(u.mainElementRef,"calc.changeSpecs",{attribute_id:u.attributeId,prod_attr_val_id:a})})},this.changeCustomValueDisplay=function(){u.calculatorData=u.calculator.getData();var t=u.calculatorData.prod_attrs[u.attributeId],e=JSON.parse(JSON.stringify(u.calculatorData.selectedSpecs)),a=e[u.attributeId],i="dropdown";if(u.componentHelper.getComponentInstance("box_".concat(t.attribute_id))&&(i="box"),"dropdown"==i&&"select"==u.config.attr_dropdown_display){var r=u.mainElementRef.querySelector(".dropdown-attr-".concat(t.attribute_id)).querySelector("select");for(var o in r.options)if("temp_custom"==r.options[o].value){r.remove(o);break}}if(u.sizeService.isCustomSizeBySizeValue(t,a)){var n="";if(u.sizeService.hasDynamicSize(u.calculatorData)&&u.attributeService.hasSizeUnit(u.calculatorData))n=u.sizeService.getCustomSizeDisplayByUnit(e.width,e.height,e.size_unit,u.calculatorData);else{var c=u.calculatorData.prod_attrs,l=u.sizeService.getSizeAttrIds(c),s=e[l.width_attr_id],d=e[l.height_attr_id],p=c[l.width_attr_id].prod_attr_vals,f=c[l.height_attr_id].prod_attr_vals;if(u.sizeService.hasHeightOrWidthAttributeId(l)){var h=u.attributeService.getValueOfMatchingProdAttrVal(p,s),m=u.attributeService.getValueOfMatchingProdAttrVal(f,d);n="".concat(h," x ").concat(m)}
1else h=p[s].attr_value,m=f[d].attr_value,n="".concat(h," x ").concat(m)}if("dropdown"==i)if("simple"==u.config.attr_dropdown_display||"roller"==u.config.attr_dropdown_display||"simple_attr_addon"==u.config.attr_dropdown_display)u.mainElementRef.querySelector("#attr_container_".concat(t.attribute_id,"_label")).innerHTML=n;else{r=u.mainElementRef.querySelector(".dropdown-attr-".concat(t.attribute_id)).querySelector("select");var v=document.createElement("option");v.value="temp_custom",v.text=n,r.add(v);var _=r.options.length;r.options[_-1].classList.add("hidden"),r.options[_-1].setAttribute("selected","selected")}"box"==i&&(u.mainElementRef.querySelector(".box-list.selected").querySelector(".attr-val").innerHTML=n)}},this.mainElementRef=this.calcDOMHelper.getCalcDOM()}return function(t,e,a,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,a,i);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(n=(o<3?r(n):o>3?r(e,a,n):r(e,a))||n);return o>3&&n&&Object.defineProperty(e,a,n),n}([(0,i.injectable)(),h("design:paramtypes",[o.w,s.j,l.t,u.a,d.e,c.t,p.t,f.e])],t)}()}}]);

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.