!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=192)}({166:function(e,t,n){"use strict";e.exports=function(e){"function"==typeof e?e():"object"==typeof e&&Object.keys(e).forEach((function(t){"function"==typeof e[t]&&e[t]()}))}},167:function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},168:function(e,t,n){var r=n(180),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},169:function(e,t,n){var r=n(168).Symbol;e.exports=r},176:function(e,t,n){"use strict";function r(){if($(".js-renove-spinner").length>0){const e=n(177),t=parseFloat($(".js-swiper-renove").data("customer-balance")),r=$(".js-swiper-renove").data("customer-paymenttype");$(".js-product-wrapper").each((function(){parseFloat($(this).data("price"))>t&&r!==e.UNICO&&($(this).addClass("product-card--disabled"),$(this).find("hl-tag").attr("disabled","true").attr("size","md"))})),$(".js-renove-spinner").remove()}}function i(){$.spinner().start();var e=$(".js-filters-section").data("filter-url");e=(e=e+P.functions.getFilterURLParams()+P.functions.getSortURLParams())+P.functions.getPricesTariffURLParams()+P.functions.getRenoveURLParams(),$.ajax({url:e,data:{page:1,selectedUrl:e},method:"GET"}).then((function(t){var n=$(t).find(".js-results-count");$(".js-results-count").empty().html(n.html()),n=$(t).find(".js-result-brand"),$(".js-result-brand").empty().html(n.html()),n=$(t).find(".js-plp-refinebar"),$(".js-plp-refinebar").empty().html(n.html()),y(),n=$(t).find(".js-plp-sort-order"),$(".js-plp-sort-order").empty().html(n.html()),n=$(t).find(".js-applied-filers"),$(".js-applied-filers").empty().html(n.html()),T(),n=$(t).find(".js-product-grid"),$(".js-product-grid").empty().html(n.html()),E(e),O(),function(){if($(".js-renove-line").length>0){const e=$(".js-renove-line:checked").data("msisdn"),t=$(".js-swiper-renove").data("setmsisdn-url");""!=e&&$.get(t,{msisdn:e})}}(),r(),$.spinner().stop()})).then((function(){$(".js-input-filter:checked").closest("hl-collapsible").find('button[aria-expanded="false"]').trigger("click"),$(".js-input-filter-hideable:checked").closest("hl-collapsible").find(".js-filter-show-more").trigger("click")})).catch((function(){$.spinner().stop()}))}function o(e){$.spinner().start(),$.ajax({url:e,method:"GET"}).then((function(t){$(".js-product-grid").empty().html(t),r(),$.spinner().stop(),E(e)})).catch((function(){$.spinner().stop()}))}function l(e,t){let n=null,r=null,i=null;if("ecorating"===e?(n=$("#ecorating-filter"),r=$("#ecorating-filter-dual"),i=document.querySelector('hl-slider[identifier="ecorating-filter"]')):"price"===e&&(n=$("#price-filter"),r=$("#price-filter-dual"),i=document.querySelector('hl-slider[identifier="price-filter"]'),i||(i=document.querySelector('hl-slider[identifier="monthly-fee-filter"]'),n=$("#monthly-fee-filter"),r=$("#monthly-fee-filter-dual"))),n&&r&&i)if("min"===t){let e=$(n).attr("min"),t=$(r).val();i.setValue(e,t).then((function(){P.functions.applyFilter()}))}else if("max"===t){let e=$(r).attr("max"),t=$(n).val();i.setValue(t,e).then((function(){P.functions.applyFilter()}))}else"both"===t&&i.reset().then((function(){P.functions.applyFilter()}))}function a(){var e=document.querySelector('hl-slider[identifier="price-filter"]');e||(e=document.querySelector('hl-slider[identifier="monthly-fee-filter"]')),e.reset().then((function(){return(e=document.querySelector('hl-slider[identifier="ecorating-filter"]'))?e.reset():Promise.resolve()})).then(()=>{P.functions.applyFilter()})}var c=!1;function s(){if($(window).width()<992){$(".js-plp-refinebar").detach().appendTo($(".js-plp-modal-refinebar")),c=!0}else if(c){let e=$(".js-plp-refinebar").detach();g(),e.appendTo($(".js-filters-section"))}}function f(e){$("<div>").append($(e)).find(".grid-footer").data("sort-options").options.forEach((function(e){$("option."+e.id).val(e.url)}))}function u(){let e=$(".js-quick-device-filters").data("device-cgid");var t=$('nav.js-devices-subnav a[data-cgid="'+e+'"]');t.length&&$(t).addClass("active")}function p(e){var t={},n=e.split("?")[1];if(n)for(var r=n.split("&"),i=0;i<r.length;i++){var o=r[i].split("="),l=decodeURIComponent(o[0]),a=decodeURIComponent(o[1]||"");t[l]=a}return t}const d=(e,t)=>{if(null!=e&&null!=t)return Object.entries(e).forEach(([e,n])=>{t.searchParams.set(e,n)}),t},h=(e,t)=>{if(e!==[]&&null!=e&&null!=t){var n=new URLSearchParams(t.search);return e.forEach(e=>{n.delete(e)}),t.search=n.toString(),t}},m=e=>{if(null!=e){var t=$('link[rel="canonical"]');if(t){var n=t.attr("href").split("?")[0]+e.search;t.attr("href",n)}}};function E(e){if(function(e){return null==e}(e))return;const t=p(e),n=new URL(window.location.origin+window.location.pathname),r=Object.entries(t).filter(([e])=>"sz"===e).reduce((e,[t,n])=>(e[t]=n,e),{}),i={};Object.entries(t).forEach(([e,t])=>{if("start"===e){var n=parseInt(r.sz,10)+parseInt(t,10);i.page=n/parseInt(r.sz,10),i.sz=n}});let o=document.querySelector('hl-slider[identifier="price-filter"]'),l=null,a=null;o&&(l=parseInt($("#price-filter").val(),10),a=parseInt($("#price-filter-dual").val(),10)),document.querySelector('hl-slider[identifier="monthly-fee-filter"]')&&(l=parseInt($("#monthly-fee-filter").val(),10),a=parseInt($("#monthly-fee-filter-dual").val(),10)),Object.entries(t).forEach(([e,t])=>{(function(e){return e.startsWith("pre")||"srule"===e})(e)&&(i[e]=t),"pmin"===e&&(i[e]=function(e,t){return null===e||Number.isNaN(e)?t:e}(l,t)),"pmax"===e&&(i[e]=function(e,t){return null===e||Number.isNaN(e)?t:e}(a,t))});const c=Object.keys(i).length>0?d(i,n):h(["sz","page"],n);c&&(window.history.pushState(null,null,c),m(c),I())}function v(){$(".js-search-results").on("click",".show-more a",(function(e){e.stopPropagation(),e.preventDefault();var t=$(this).data("url");$.spinner().start(),$(this).trigger("search:showMore",e),$.ajax({url:t,data:{selectedUrl:t},method:"GET"}).done((function(e){$(".grid-footer").replaceWith(e),f(e),E(t),r()})).fail((function(){})).always((function(){$.spinner().stop()}))}))}function I(){var e=$(".show-more a");if(e.length>0){var t=new URL(window.location.href),n=new URLSearchParams(t.search),r=(n.get("page")?parseInt(n.get("page"),10):1)+1,i=r*(n.get("sz")&&n.get("page")?parseInt(n.get("sz"),10)/parseInt(n.get("page"),10):$(".js-product-grid .js-product-tile").length);n.set("page",r),n.set("sz",i),t.search=n.toString(),e.attr("href",t.href)}}function g(){$(".btn-borderless-black").trigger("click")}function S(e){window.location.href=e.getAttribute("data-href")}function O(){const e=p(window.location.href);let t=null,n=null,r=null,i=null,o=null;t=function(e){let t=null;return Object.entries(e).forEach(e=>{const[n,r]=e;"OSPEcoRating"===r&&(t=n.replace("prefn",""))}),t}(e),Object.entries(e).forEach(e=>{const[l,a]=e;switch(l){case"prefmin"+t:n=a;break;case"prefmax"+t:r=a;break;case"pmin":i=a;break;case"pmax":o=a}});let l=null,a=null,c=null;l=$("#ecorating-filter"),a=$("#ecorating-filter-dual"),c=document.querySelector('hl-slider[identifier="ecorating-filter"]'),n||(n=$(l).attr("min")),r||(r=$(a).attr("max")),n&&r&&c.setValue(n,r),l=$("#price-filter"),a=$("#price-filter-dual"),c=document.querySelector('hl-slider[identifier="price-filter"]'),c||(c=document.querySelector('hl-slider[identifier="monthly-fee-filter"]'),l=$("#monthly-fee-filter"),a=$("#monthly-fee-filter-dual")),i||(i=$(l).attr("min")),o||(o=$(a).attr("max")),i&&o&&c.setValue(i,o)}function T(){$(".js-applied-filers").contents().filter((function(){return 8===this.nodeType})).remove(),$(".js-applied-filers").html().trim().length?$(".js-remove-plp-filters").addClass("d-md-block"):$(".js-remove-plp-filters").removeClass("d-md-block")}function y(){let e=document.querySelectorAll(".checkbox-list-filter__toggle .btn");e.forEach((function(e){e.addEventListener("click",(function(){this.closest(".checkbox-list-filter").querySelectorAll(".form-group.hideable").forEach((function(e){e.classList.toggle("hidden")})),this.closest(".checkbox-list-filter").querySelectorAll(".form-group.hideable.hidden").length?e.innerHTML='<hl-icon name="solaris__form-plus-default"></hl-icon>Ver más':e.innerHTML='<hl-icon name="solaris__form-minus-default"></hl-icon>Ver menos'}))}))}const P={functions:{getFilterURLParams:function(){let e="",t=1,n=function(){let e=[],t=1;return $(".js-boolean-filters").each((function(){let n=$(this).data("filter-attribute"),r=[];$(this).find("input:checked").each((function(){r.push($(this).val())}));let i=r.join("|");i&&(e.push("prefn"+t+"="+n+"&prefv"+t+"="+i),t+=1)})),e}();n.length>0&&(e+="&"+n.join("&"),t+=n.length);let r=function(e){let t=parseInt($("#ecorating-filter").val(),10),n=parseInt($("#ecorating-filter-dual").val(),10),r=parseInt($("#ecorating-filter-dual").attr("min"),10),i=parseInt($("#ecorating-filter").attr("max"),10);if(t>r||n<i)return"prefn"+e+"=OSPEcoRating&prefmin"+e+"="+t+"&prefmax"+e+"="+n}(t);r&&(e+="&"+r);let i=function(){if(document.querySelector('hl-slider[identifier="price-filter"]')){let e=parseInt($("#price-filter").val(),10),t=parseInt($("#price-filter-dual").val(),10),n=parseInt($("#price-filter-dual").attr("min"),10),r=parseInt($("#price-filter").attr("max"),10),i=parseInt($("#price-filter").attr("step")||0,10);if(e<t&&(e>n||t+i<r))return"pmin="+e+"&pmax="+t}}();i&&(e+="&"+i);let o=function(){if(document.querySelector('hl-slider[identifier="monthly-fee-filter"]')){let e=parseInt($("#monthly-fee-filter").val(),10),t=parseInt($("#monthly-fee-filter-dual").val(),10),n=parseInt($("#monthly-fee-filter-dual").attr("min"),10),r=parseInt($("#monthly-fee-filter").attr("max"),10);if(e>n||t<r)return"pmin="+e+"&pmax="+t}}();return o&&(e+="&"+o),e},getSortURLParams:function(){let e=$(".js-plp-sort-order option:selected").data("id");return e?"&srule="+e:""},getPricesTariffURLParams:function(){var e="";if($(".js-tariff-prices-filter").length>0){var t=$(".js-enable-tariff-prices").is(":checked");e="&enabletariffprices="+t,e=t?e+"&tarifftype="+$(".js-tariff-type:checked").val():e}return e},applyFilter:i,sortGrid:o,clearRangeFilter:l,addEventOnClickButtonMoreResults:v,buildShowMoreHref:I,updateSortOptions:f,setActiveDeviceFilter:u,handelModalFilters:s,handleFilterButtonClick:g,handleOffersButtonClick:S,changeURL:E,addParamsToURL:d,removeParamsFromURL:h,updateCanonicalURL:m,getParamsFromUrl:p,getRenoveURLParams:function(){var e="";if($(".js-renove-line").length>0){const t=$(".js-renove-line:checked").data("msisdn");""!=t&&(e="&msisdn="+t)}return e}},init:function(){r(),y(),$(document).on("change",".js-boolean-filters .js-input-filter",(function(){i()})),$(document).on("click",".js-applied-filers .js-remove-plp-filter .hl-tag .btn, .js-remove-plp-filter-unique",(function(){let e=$(this).hasClass("js-remove-plp-filter-unique"),t=e?$(this):$(this).parent().parent(),n=t.data("attribute-type"),r=t.data("attribute-id").toLowerCase();if(e&&r){$(".js-"+r+"-input-filter").toArray().forEach((function(e){e.checked=!1}))}else if("boolean"===n){let e=t.data("attribute-value");$(".js-"+r+'-input-filter[value="'+e+'"]').prop("checked",!1)}else l(n,t.data("limit-type"));i()})),$(document).on("click",".js-remove-plp-filters",(function(e){$(".js-input-filter").prop("checked",!1),a(),i()})),$(document).on("change","#ecorating-filter",i),$(document).on("change","#ecorating-filter-dual",i),$(document).on("change","#price-filter",i),$(document).on("change","#price-filter-dual",i),$(document).on("change","#monthly-fee-filter",i),$(document).on("change","#monthly-fee-filter-dual",i),$(document).on("change",".js-plp-sort-order",(function(){o($(this).val())})),$(document).on("change",".js-plp-tariff-input",(function(){var e=$(this);(e.hasClass("js-enable-tariff-prices")||$(".js-enable-tariff-prices").is(":checked"))&&($(".js-input-filter").prop("checked",!1),a()),e.hasClass("js-enable-tariff-prices")&&(e.is(":checked")?$(".tariff-type-filters").removeClass("d-none").addClass("d-flex"):$(".tariff-type-filters").addClass("d-none").removeClass("d-flex"))})),$(document).on("click",".js-plp-customer-offers",(function(){S(this)})),$(document).on("click",".js-plp-close-modal-filters",g);var e=n(178);$(window).on("resize",e((function(){s()}),500)),s(),u(),window.addEventListener("load",(function(){O(),$(".js-input-filter:checked").closest("hl-collapsible").find('button[aria-expanded="false"]').trigger("click"),$(".js-input-filter-hideable:checked").closest("hl-collapsible").find(".js-filter-show-more").trigger("click")})),T()},showMore:function(){v(),I()},showModalEmptyCartError:function(){const e=document.querySelectorAll(".js-empty-cart-error-modal");if(e.length>0){const t=e[0];setTimeout((function(){$(t).modal()}),1800)}}};e.exports=P},177:function(e,t,n){"use strict";e.exports={TARIFFS_MAPPING:"TariffsMapping",RENOVE:"renove",CHANGETARIFF:"changeTariff",RENOVE_CHANGETARIFF:"renoveChangeTariff",DOWNGRADE:"Downgrade",ENTERTAINMENT:"entertainment",INSURANCE:"insurance",APLAZADO:"APLAZADO",UNICO:"UNICO",PRIMARIO:"1",SECUNDARIO:"2",AMBOS:"3",DEVICES:"Dispositivos",PRINCIPAL_STRING:"principal",SECUNDARIO_STRING:"secundario",CONVERGENTE:"convergente",GEMELO:"_GEMELO",FAKE:"FAKE",PEACH:"PEACH",PRODUCT_TYPE:{DEVICE:"device",TARIFF:"tariff",SVA:"sva",SERVICE:"service",VOICE_PLAN:"voice plan",COMMITMENT:"commitment"},SVA_TYPE:{INSURANCE:"insurance",CYS:"cys",HEALTH:"health",ENTERTAINMENT:"entertainment",SECURITYSUMMARY:"securitySummary",MUSIC:"music",APPLE:"apple",TV:"tv",SHOWNSECURITYSUMMARY:"shownSecuritySummary"},SVA_SUBTYPE:{APPLE:"apple"},LINE_TYPE:{MOBILELINEINTARIFF:"mobileLineInTariff",MOBILELINEADDITIONAL:"mobileLineAdditional"},OSPATTRIBUTES:{OSPPRODUCTTYPE:"OSPProductType",OSPCONVERGENTLINETYPE:"OSPConvergentLineType",OSPCUSTOMERACTIVEPRODUCT:"OSPCustomerActiveProduct",OSPCOMMERCIALACT:"OSPCommercialAct",OSPTSUBTYPE:"OSPTSubtype",OSPPRETITTLE:"OSPPretittle",OSPSVAICON:"OSPSvaIcon",OSPDEVICEINSURANCE:"OSPDeviceInsurance"},SSO_CODE:"ssocode",SSO_ID:"ssoid",CUSTOMER_LINE:"customerLine",CUSTOMER_DOC_LOG:"customerDocLog",CUSTOMER_LIC_LOG:"customerLicLog",INDIVIDUAL_INDENTIFICATION:"individualIdentification",ORGANIZATION_INDENTIFICATION:"organizationIdentification",HTTP_ERRORS:{BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},INTERNAL_SERVER:{CODE:500,MESSAGE:"Internal Server Error"},CONFLICT:{CODE:409,MESSAGE:"Conflict"}},HTTP_CODES:{OK:{CODE:200,MESSAGE:"Ok"}},CUSTOMER_TYPES:{CLIENT:"Client",NO_CLIENT:"No client",PROSPECT:"Prospect"},CUSTOMER_STATUS:{ACTIVE:"Active",PROSPECT:"Prospect"},TOKENPIN:{BASKET_COST_LIMIT:600,RETRIES_LIMIT:3,VAP:"PIN VAP",HOME_DELIVERY:"PIN ENTREGA",PDT_PIN:"PENDIENTE PIN"},NIF:"NIF",CIF:"CIF",RENOVE_LINE_TYPE:{MOBILE:"movil"},MOBILE_ONLY_DEFAULT_TARIFF:"-",RENOVE_FLOWS:{PEACH:"Peach",VAP:"Renove VaP",UNIQUE_PAYMENT:"Renove Único"},RISKY_DEVICE:"RISKY DEVICE",COMMUNICATIONS:{campaignId:"campaignId=",tarifa:"tarifa=",type:"type="},ORGTYPE_RESIDENTIAL:"RESIDENCIAL",TARIFF_MOBILE:"mobile",TARIFF_CONVERGENT:"convergent",TRANSATION_TABLE_TYPE:{mobile:"ChangeTariffGo",convergent:"ChangeTariffLove"},MIXED_RENOVE:"renove mixto",PRIMARY_RENOVE:"renove primario",POSPAGO:"POSPAGO",NEWTARIFFPB:"newTariffPB",CAMBIOTARIFA:"Cambio de tarifa puro"}},178:function(e,t,n){var r=n(167),i=n(179),o=n(181),l=Math.max,a=Math.min;e.exports=function(e,t,n){var c,s,f,u,p,d,h=0,m=!1,E=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function $(t){var n=c,r=s;return c=s=void 0,h=t,u=e.apply(r,n)}function I(e){return h=e,p=setTimeout(S,t),m?$(e):u}function g(e){var n=e-d;return void 0===d||n>=t||n<0||E&&e-h>=f}function S(){var e=i();if(g(e))return O(e);p=setTimeout(S,function(e){var n=t-(e-d);return E?a(n,f-(e-h)):n}(e))}function O(e){return p=void 0,v&&c?$(e):(c=s=void 0,u)}function T(){var e=i(),n=g(e);if(c=arguments,s=this,d=e,n){if(void 0===p)return I(d);if(E)return clearTimeout(p),p=setTimeout(S,t),$(d)}return void 0===p&&(p=setTimeout(S,t)),u}return t=o(t)||0,r(n)&&(m=!!n.leading,f=(E="maxWait"in n)?l(o(n.maxWait)||0,t):f,v="trailing"in n?!!n.trailing:v),T.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=d=s=p=void 0},T.flush=function(){return void 0===p?u:O(i())},T}},179:function(e,t,n){var r=n(168);e.exports=function(){return r.Date.now()}},180:function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(5))},181:function(e,t,n){var r=n(182),i=n(167),o=n(184),l=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):l.test(e)?NaN:+e}},182:function(e,t,n){var r=n(183),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},183:function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},184:function(e,t,n){var r=n(185),i=n(188);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},185:function(e,t,n){var r=n(169),i=n(186),o=n(187),l=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?i(e):o(e)}},186:function(e,t,n){var r=n(169),i=Object.prototype,o=i.hasOwnProperty,l=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=l.call(e);return r&&(t?e[a]=n:delete e[a]),i}},187:function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},188:function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},192:function(e,t,n){"use strict";var r=n(166);$(document).ready((function(){r(n(176))}))},5:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}});