1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[566],{5901:(e,t,n)=>{n.d(t,{ZP:()=>O});var s=n(3353),o=n(1401),i=n(4585),r=n(3633),l=n(7763),p=n(2047),a=n(1934),c=n(5680);const d={};d.render=function(e){(0,a.elementOpen)("form",null,null,"ref",e.createListForm,"class",void 0!==e.display&&"inline"==e.display?"ds-u-flex ds-u-items-start ds-u-gap-8":"ds-u-grid ds-u-gap-16"),(0,a.component)(c.Z,"comp",{type:"text",value:e.value,name:"name",label:"Nazwa listy",placeholder:"",errorMessage:e.errorMessage,input:e.validate,className:"js-input-new-shopping-list ds-u-flex-1"}),(0,p.ZP)((0,l.O)(e,{type:"submit",variant:"primary",text:void 0!==e.display&&"inline"==e.display?"Dodaj":"Dodaj listÄ",loading:e.loading})),(0,a.elementClose)("form")};var u=n(254),h=n(8814);const g="SET_ERROR_MESSAGE",m="SET_LOADING",f=e=>({type:m,payload:{loading:e}}),b="CLEAR_FORM",y={errorMessage:"",value:"",loading:!1},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case s.RECEIVE_PROPS:return{...e,...t.payload};case g:return{...e,errorMessage:t.payload.isValid?"":"Pole nie może byÄ puste"};case m:return{...e,loading:t.payload.loading};case b:return{...e,value:"",loading:!1}}return e},L=e=>""!=e.trim(),P=(0,o.sQ)({createListForm:{submit:async(e,t)=>{e.preventDefault();const n=e.target.elements[0].value;if(L(n)){t.dispatch(f(!0));try{const e=t.state.fromBasket?await(0,u.K6)(n):await(0,u.Dn)(n);e.hash&&(t.state.redirect?window.location.href=h.Z.parsePath(h.Z.user_shopping_list_details,{hash:e.hash}):(t.props.onSubmit(e),t.dispatch({type:b}),t.el.reset()))}finally{t.dispatch(f(!1))}}else t.props.validate(n)}}});const v=P((0,o.Sx)({componentDidMount(){const e=this.el.querySelector(".js-input-new-shopping-list .js-input");e?.focus()}})((0,s.createComponent)(function(e){return d.render(e)},S))),O=(0,i.JJ)((0,r.xC)({reducer:{stateReducer:S}}),(0,i.$j)(function(e){return{...e.stateReducer}},function(e){return{validate:t=>{return e((n=L(t),{type:g,payload:{isValid:n}}));var n}}})(v))},566:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Fe});var s=n(870),o=n(254),i=n(9055),r=n(3353),l=n(1401),p=n(7763),a=n(1934);const c={},d=["class","ds-listbox-item__text"],u=["class","ds-spinner"],h=["type","checkbox","class","ds-checkbox"],g=["class","ds-u-flex ds-u-items-center ds-u-gap-16"],m=["role","option","tabindex","-1"];c.render=function(e){if((0,a.elementOpen)("label","QRXjr2y",m,"class","shopping-list-item ds-listbox-item ds-listbox-item--checkbox "+(e.isChecked?"ds-listbox-item--active":"")),(0,a.elementOpen)("span","^`0G9vs",d),(0,a.text)(e.name),(0,a.elementClose)("span"),(0,a.elementOpen)("span","r@Z~qj*",g),1==e.loading)(0,a.elementVoid)("span","Hxk/jLD",u);else{(0,a.elementOpenStart)("input","%$4`|5.",h,"ref",e.checkboxEl,"value",e.id);for(let t=0,n=(0,p.Qb)({checked:e.isChecked}),s=n.length;t<s;t+=2)(0,a.attr)(n[t],n[t+1]);(0,a.elementOpenEnd)(),(0,a.skip)(),(0,a.elementClose)("input")}(0,a.elementClose)("span"),(0,a.elementClose)("label")};const f=(0,l.Sx)({componentDidMount(){}}),b=(0,l.sQ)({checkboxEl:{change(e,t){t.props.change({checked:e.target.checked,value:e.target.value})}}}),y=(0,r.createComponent)(function(e){return c.render(e)}),S=(0,l.qC)(f,b)(y);var L=n(6486),P=n(5901);const v={},O=["class","ds-add-to-wishlist-btn__icon-add icon-heart"],w=["class","ds-add-to-wishlist-btn__icon-added icon-heart-solid"],_=["class","ds-button__content"],T=["class","ds-button__spinner ds-spinner"],E=["aria-haspopup","dialog","aria-label","Zapisz produkt na liÅcie zakupowej"],C=["class","icon-x-mark"],x=["class","ds-u-cursor-pointer js-shopping-list-close-btn","style","position: relative; left: 0.5rem;","role","button","tabindex","0","aria-label","Zamknij listy zakupowe"],k=["class","add-to-shopping-list__header"],A=["class","ds-u-color-neutral-100"],j=["class","ds-u-skeleton ds-u-mb-16 ds-u-pt-16 ds-u-pb-16"],R=["class","ds-button ds-button--outlined-primary ds-button--block"],F=["class","ds-u-mt-16 ds-u-mb-16"],D=["class","add-to-shopping-list__wrapper ds-listbox__wrapper"],Z=["class","ds-button__content"],M=["class","ds-button__spinner ds-spinner"],z=["type","button","class","ds-button ds-button--primary ds-button--block"],I=["class","add-to-shopping-list__footer"],N=["role","group","tabindex","-1"];function $(e){return v.render(e)}v.render=function(e){if((0,a.elementOpen)("div",null,null),(0,a.elementOpen)("button","J;p$T_I",E,"ref",e.btn,"class","ds-button ds-button--icon ds-add-to-wis
1hlist-btn "+(e.productShoppingLists.shoppingLists.length>0?"ds-add-to-wishlist-btn--added":""),"aria-expanded",e.productShoppingLists.isOpen?"true":"false","aria-controls","shopping-list-panel-"+e.productShoppingLists.productId),(0,a.elementOpen)("span","0yv?@QB",_),(0,a.elementVoid)("i","g^w^hmZ",O),(0,a.elementVoid)("i","w_=6vZf",w),(0,a.elementClose)("span"),(0,a.elementVoid)("span","0EA5iT@",T),(0,a.elementClose)("button"),1==e.productShoppingLists.isOpen){(0,a.elementOpen)("div","pQ4_.^O",N,"ref",e.shoppingListModal,"style",(0,p.W2)({top:e.productShoppingLists.top+"px",left:e.productShoppingLists.left+"px"}),"id","shopping-list-panel-"+e.productShoppingLists.productId,"aria-labelledby","shopping-list-panel-heading-"+e.productShoppingLists.productId,"class","add-to-shopping-list ds-select__listbox ds-listbox ds-listbox--checkbox "+(e.productShoppingLists.leftWindowEdge?"add-to-shopping-list--right":"")),(0,a.elementOpen)("div","{4^=N6R",k),(0,a.elementOpen)("span",null,null,"id","shopping-list-panel-heading-"+e.productShoppingLists.productId),(0,a.text)("Zapisz na liÅcie"),(0,a.elementClose)("span"),(0,a.elementOpen)("span","B9;S=1z",x,"ref",e.btn),(0,a.elementVoid)("i","Kzm]fZ7",C),(0,a.elementClose)("span"),(0,a.elementClose)("div"),(0,a.elementOpen)("div","L5?o3<!",D),0==e.userShoppingLists.data.length&&(1!=e.userShoppingLists.isLoading&&((0,a.elementOpen)("p","E1i}(_O",A),(0,a.elementOpen)("small",null,null),(0,a.text)("Nie masz jeszcze żadnej listy zakupowej."),(0,a.elementClose)("small"),(0,a.elementClose)("p")),1==e.userShoppingLists.isLoading&&(0,a.elementVoid)("div","BBB/V6{",j)),(0,a.elementOpen)("div","+k9L6d{",F),0==e.productShoppingLists.showForm?((0,a.elementOpen)("button","l*#O|xM",R,"ref",e.showFormBtn),(0,a.text)("Dodaj nowÄ
listÄ"),(0,a.elementClose)("button")):(0,a.component)(P.ZP,"createShoppingListForm",{redirect:!1,onSubmit:e.addShoppingList,display:"inline"}),(0,a.elementClose)("div");{let t=e.userShoppingLists.data,n=0,s=t.length,o=t[0];for(;n<s;n++,o=t[n])(0,a.component)(S,""+o.id,{id:o.id,name:o.name,isChecked:(0,L.includes)(e.productShoppingLists.shoppingLists,o.id),loading:(0,L.includes)(e.productShoppingLists.loadings,o.id),change:e.set})}(0,a.elementClose)("div"),(0,a.elementOpen)("div","u2%Z`{E",I),(0,a.elementOpen)("button","cDg5R}V",z,"ref",e.btn),(0,a.elementOpen)("span",";P1P_#Z",Z),(0,a.text)("Gotowe"),(0,a.elementClose)("span"),(0,a.elementVoid)("span","~,'n^C%",M),(0,a.elementClose)("button"),(0,a.elementClose)("div"),(0,a.elementClose)("div")}(0,a.elementClose)("div")};const B=e=>{const t=e.el.querySelector(".ds-add-to-wishlist-btn").getBoundingClientRect();e.props.setLeftPosition(t.left+t.width),e.props.setTopPosition(t.top+t.height);const n=e.el.getBoundingClientRect().left;let s=0;const o=e.el.closest(".js-product-slider");o&&(s=o.getBoundingClientRect().left),n-s<360&&e.props.setToTheRight()},U=()=>{window.APP_STORE_PAGE_CONTROLLER._handleScroll&&(window.removeEventListener("scroll",window.APP_STORE_PAGE_CONTROLLER._handleScroll),window.APP_STORE_PAGE_CONTROLLER._handleScroll=null,delete window.APP_STORE_PAGE_CONTROLLER._handleScroll)},V=e=>{window.APP_STORE_PAGE_CONTROLLER._handleScroll=()=>{B(e)},window.addEventListener("scroll",window.APP_STORE_PAGE_CONTROLLER._handleScroll)},q=e=>{const t=e.el.querySelector(".ds-add-to-wishlist-btn");null==t||t.focus()},G=e=>{const t=e.el.querySelector(".js-shopping-list-close-btn");null==t||t.focus()},J=e=>{e.props.togglePanel(),B(e),e.getState().productShoppingLists.isOpen?(V(e),requestAnimationFrame(()=>{G(e)})):(U(),q(e))},Q=()=>{const e=(0,l.Sx)({componentDidMount(){this.props.togglePanel(),this.props.getUserShoppingListsAction(),B(this),document.body.addEventListener("click",e=>{((e,t)=>{const n=e.target;if(n.closest(".ds-listbox"))return;const s=n.closest(".ds-add-to-wishlist-btn");s&&s.isEqualNode(t.el.firstElementChild)||t.getState().productShoppingLists.isOpen&&(t.props.closePanel(),U(),q(t))})(e,this)}),V(this),setTimeout(()=>{G(this)},200)}}),t=(0,l.sQ)({btn:{click(e,t){J(t)},keydown(e,t){"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),J(t))}},showFormBtn:{click(e,t){e.preventDefault(),t.props.toggleForm()}},shoppingListModal:{keydown(e,t){if("Escape"===e.key)return e.preventDefault(),t.props.closePanel(),U(),void q(t);if("Tab"!==e.key)return;const n=(e=>{const t=e.el.querySelector(".add-to-shopping-list");return t?Array.from(t.querySelectorAll(["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not
1([tabindex="-1"])'].join(", "))).filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")):[]})(t);if(0===n.length)return;const s=n[0],o=n[n.length-1],i=document.activeElement;e.shiftKey?i===s&&(e.preventDefault(),o.focus()):i===o&&(e.preventDefault(),s.focus())}}}),n=(0,r.createComponent)($);return(0,l.qC)(e,t)(n)};var W=n(3633);const K="shopping_lists",Y=`${K}/getUserShoppingListsAction`,H={data:[],isLoading:!1,errors:""},X=(0,W.oM)({name:K,initialState:H,reducers:{getUserShoppingListsAction:e=>{e.isLoading=!0,e.errors=""},getUserShoppingListsSuccessAction:(e,t)=>{let{payload:n}=t;e.isLoading=!1,e.data=n},getUserShoppingListsErrorAction:(e,t)=>{let{payload:n}=t;e.isLoading=!1,e.errors=n}}}),{getUserShoppingListsAction:ee,getUserShoppingListsSuccessAction:te,getUserShoppingListsErrorAction:ne}=X.actions,se=X.reducer;n(560);const oe="product_shopping_lists",ie=`${oe}/addToShoppingListAction`,re=`${oe}/removeFromShoppingListAction`,le=(0,W.oM)({name:oe,initialState:{isOpen:!1,leftWindowEdge:!1,productId:"",shoppingLists:[],loadings:[],error:"",productData:null,showForm:!1,top:0,left:0},reducers:{setToTheRight:e=>{e.leftWindowEdge=!0},closePanel:e=>{document.body.classList.remove("shopping-list-modal-is-open"),e.isOpen=!1},togglePanel:e=>{document.body.classList.toggle("shopping-list-modal-is-open",!e.isOpen),e.isOpen=!e.isOpen},toggleForm:e=>{e.showForm=!e.showForm},setLeftPosition:(e,t)=>{let{payload:n}=t;e.left=n},setTopPosition:(e,t)=>{let{payload:n}=t;e.top=n},addToShoppingListAction:(e,t)=>{let{payload:n}=t;e.loadings.push(n),e.error=""},addToShoppingListSuccessAction:(e,t)=>{let{payload:n}=t;e.loadings.splice(e.loadings.indexOf(n),1),e.shoppingLists.push(n)},addToShoppingListErrorAction:(e,t)=>{let{payload:n,payload:s}=t;e.loadings.splice(e.loadings.indexOf(s),1),e.error=n},removeFromShoppingListAction:(e,t)=>{let{payload:n}=t;e.loadings.push(n),e.error=""},removeFromShoppingListSuccessAction:(e,t)=>{let{payload:n}=t;e.loadings.splice(e.loadings.indexOf(n),1),e.shoppingLists.splice(e.shoppingLists.indexOf(n),1)},removeFromShoppingListErrorAction:(e,t)=>{let{payload:n,payload:s}=t;e.loadings.splice(e.loadings.indexOf(s),1),e.error=n}}}),{setLeftPosition:pe,setTopPosition:ae,setToTheRight:ce,closePanel:de,togglePanel:ue,toggleForm:he,addToShoppingListAction:ge,addToShoppingListSuccessAction:me,addToShoppingListErrorAction:fe,removeFromShoppingListAction:be,removeFromShoppingListErrorAction:ye,removeFromShoppingListSuccessAction:Se}=le.actions,Le=le.reducer;const Pe=Q(),ve=(0,i.Z)(function(e){return Object.assign(Object.assign({},e),{productShoppingLists:Object.assign(Object.assign({},e.productShoppingLists),{shoppingLists:e.productShoppingLists.shoppingLists.map(e=>Number(e))})})},function(e){return{set:t=>t.checked?e(ge(Number(t.value))):e(be(Number(t.value))),addShoppingList:t=>({addToShoppingListAction:e(ge(t.id)),getUserShoppingListsAction:e(ee()),toggleForm:e(he())}),setToTheRight:()=>e(ce()),setLeftPosition:t=>e(pe(t)),setTopPosition:t=>e(ae(t)),togglePanel:()=>e(ue()),closePanel:()=>e(de()),toggleForm:()=>e(he()),getUserShoppingListsAction:()=>e(ee())}})(Pe);var Oe=n(7159),we=n(4857);function*_e(){try{const e=yield(0,o._T)();yield(0,we.gz)(te(e))}catch(e){yield(0,we.gz)(ne(e))}}function*Te(){yield(0,we.Fm)(Y,_e)}var Ee=n(7303);const Ce=e=>e.productShoppingLists.productId,xe=e=>e.productShoppingLists.productData;function ke(e){let{payload:t}=e;return function*(){try{let e=yield(0,we.Ys)(Ce),n=yield(0,we.Ys)(xe);(yield(0,o.oM)(`${t}`,e))&&(yield(0,we.gz)(me(t)),(0,Ee.Mp)(n))}catch(e){yield(0,we.gz)(fe(e.message))}}()}function Ae(e){let{payload:t}=e;return function*(){try{let e=yield(0,we.Ys)(Ce);(yield(0,o.Bs)(`${t}`,e))&&(yield(0,we.gz)(Se(t)))}catch(e){yield(0,we.gz)(ye(e.message))}}()}function*je(){yield(0,we.Fm)(ie,ke),yield(0,we.Fm)(re,Ae)}const Re=e=>{const t=(0,Oe.ZP)(),n=(0,W.xC)({reducer:{userShoppingLists:se,productShoppingLists:Le},preloadedState:{userShoppingLists:H,productShoppingLists:Object.assign(Object.assign({},e),{shoppingLists:e.shoppingLists.map(e=>+e),loadings:[],error:"",showForm:!1})},middleware:e=>e().concat(t)});return t.run(function*(){yield(0,we.$6)([(0,we.rM)(Te),(0,we.rM)(je)])}),n},Fe=e=>{const t=(0,o.$s)(e),n=(0,o.$s)(e,"data-product"),i=Re(Object.assign({productData:n},t));(0,s.Z)(e,ve,i)}},9055:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4585).$j},870:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(3353),o=n(4585);function i(e,t,n){(0,s.render)(e,(0,o.JJ)(n,t))}},4585:(e,t,n)=>{var s=n(1934),o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){return function(){function t(){o(this,t),this.refs=Object.create(null),this.props=null,this.childInstance=new e,s.link(this,this.childInstance)}return i(t,[{key:"el",set:function(e){return this.childInstance.el=e,e},get:function(){return this.childInstance.el}}]),t}()},a=function(e){for(var t=e;t;t=s.getParent(t))if(t.store)return t.store;return null},c={},d=function(){return c},u=function(e){return{dispatch:e}},h=function(e,t,n){return Object.assign({},n,e,t)};var g=Object.prototype.hasOwnProperty;function m(e,t){if(e===t)return!0;
1if(!e||!t)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(var o=0;o<n.length;o++)if(!g.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;return!0}t.$j=function(e,t,n){var s=!!e,i=s&&1!==e.length,c=t||u;if(t&&"function"!=typeof t){var g=t;c=function(e){return Object.keys(g).reduce(function(t,n){return t[n]=function(){return e(g[n].apply(g,arguments))},t},{})}}var f=1!==c.length,b=e||d,y=n||h;return function(e){return function(e){function t(){o(this,t);var n=l(this,e.call(this));return n.store=null,n.storeConnection=null,n.renderProps=null,n.ownProps=null,n.stateProps=null,n.dispatchProps=null,n.mapStateToPropsFn=b,n.mapDispatchToPropsFn=c,n}return r(t,e),t.prototype.apply=function(e){if(s&&!this.storeConnection&&this.subscribeToStore(),!m(this.ownProps,e)){var t=this.store||a(this);this.ownProps===e&&null!==this.renderProps||(this.ownProps=e,!i&&this.stateProps||(this.stateProps=this.mapStateToProps(t.getState(),e)),!f&&this.dispatchProps||(this.dispatchProps=this.mapDispatchToProps(t.dispatch,e)),this.renderProps=y(this.stateProps,this.dispatchProps,e)),this.childInstance.apply(this.renderProps)}},t.prototype.subscribeToStore=function(){var e=this;s&&!this.storeConnection&&(this.store||(this.store=a(this)),this.storeConnection=this.store.subscribe(function(){var t=e.ownProps,n=e.mapStateToProps(e.store.getState(),t);if(n!==e.stateProps){var s=y(n,e.dispatchProps,t);e.stateProps=n;var o=!m(e.renderProps,s);e.renderProps=s,o&&e.childInstance.apply(e.renderProps)}}))},t.prototype.mapStateToProps=function(e,t){var n=this.mapStateToPropsFn.call(null,e,t);return"function"==typeof n&&(this.mapStateToPropsFn=n,n=this.mapStateToPropsFn.call(null,e,t)),n},t.prototype.mapDispatchToProps=function(e,t){var n=this.mapDispatchToPropsFn.call(null,e,t);return"function"==typeof n&&(this.mapDispatchToPropsFn=n,n=this.mapDispatchToPropsFn.call(null,e,t)),n},t.prototype.componentWillUnmount=function(){s&&(this.storeConnection(),this.storeConnection=null,this.store=null),this.mapStateToPropsFn=null,this.mapDispatchToPropsFn=null},t}(p(e))}},t.JJ=function(e,t){return function(t){function n(){o(this,n);var s=l(this,t.call(this));return s.store=e,s}return r(n,t),n.prototype.apply=function(e){m(e,this.props)||this.childInstance.apply(e)},n.prototype.componentWillUnmount=function(){},n}(p(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.