Changeset 2463755
- Timestamp:
- 01/27/2021 05:47:14 PM (5 years ago)
- Location:
- i2-azon/trunk
- Files:
-
- 4 edited
-
dist/js/blocks.js (modified) (1 diff)
-
dist/js/blocks.js.map (modified) (1 diff)
-
i2-azon.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2-azon/trunk/dist/js/blocks.js
r2460809 r2463755 4 4 Licensed under the MIT License (MIT), see 5 5 http://jedwatson.github.io/classnames 6 */!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var o=a.apply(null,n);o&&e.push(o)}else if("object"===i)for(var l in n)r.call(n,l)&&n[l]&&e.push(l)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},,,,function(e,t,r){"use strict";r.r(t);var n=lodash,a=(n.some,n.isEmpty),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.imageUrl,r=e.size,n=void 0===r?"":r,a=e.ext,i=void 0===a?"jpg":a,l=e.style,c=e.className,s=e.onClick;return React.createElement("img",{className:c,style:l||null,onClick:function(){return s?s():null},src:o(t,n,i)})},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jpg",n=t?"._SL"+t+"_":"";return"NOIMG"==e||"#"==e||a(e)?tfGlobal.homeUrl+"/wp-content/plugins/i2-azone/dist/images/no-image-available.png":"https://m.media-amazon.com/images/I/"+e+n+"."+(r||"jpg")},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&"#"!=e){var r=JSON.parse(e);return r&&r.length>t?r[t].URL:"NOIMG"}},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&"#"!=e){var r=JSON.parse(e);return r&&r.length>t?r[t].EXT:"jpg"}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.isLink,r=e.id,n=e.href,a=e.style,i=e.className,o=e.onClick,l=e.children,c=e.target,s=void 0===c?"_blank":c,u=e.rel,m=void 0===u?"nofollow noopener noreferrer":u,f=e.elm,d=void 0===f?"span":f;return t?React.createElement("a",{id:r,href:n,style:a,className:i,onClick:o,target:s,rel:m},l):wp.element.createElement(d,{id:r,style:a,className:i,onClick:o},l)},u=function(e){return tfGlobal.storeUrl+"/dp/"+e},m=function(e){return"1"==tfGlobal.add_proxy_link?tfGlobal.homeUrl+"/"+tfGlobal.proxy_link_slug+"/"+e:tfGlobal.storeUrl+"/dp/"+e+("1"==tfGlobal.donotAddLink?"":"/?tag="+tfGlobal.partnerTagForLink+"&linkCode=ogi&th=1&psc=1")},f=function(e){return tfGlobal.storeUrl+"/s?k="+e},d=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,r=t.color,n=t.bgColor,i=t.padding,o=t.border,l={};(a(r)||(l.color=r),a(n)||(l.backgroundColor=n),a(i)||(l.padding=i),a(o))||(1==o.useRadius&&(null===(e=o.radius)||void 0===e?void 0:e.val)>0&&(l.borderRadius=o.radius.val+o.radius.unit),1==o.use&&null!=o.color?l.border=o.size.val+o.size.unit+" solid "+o.color:l.borderColor=o.color);return l},g=[{value:"Featured",label:"Featured"},{value:"AvgCustomerReviews",label:"Avg Customer Reviews"},{value:"NewestArrivals",label:"Newest Arrivals"},{value:"Price:HighToLow",label:"Price: High To Low"},{value:"Price:LowToHigh",label:"Price: Low To High"},{value:"Relevance",label:"Relevance"}];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(n=(o=l.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw i}}return r}(e,t)||R(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var C=lodash,x=C.has,w=C.get,S=C.map,k=C.remove,O=C.first,z=C.difference,_=C.dropWhile,N=C.includes,I=C.isEqual, j=C.chunk,A=wp.blockEditor.RichTextToolbarButton,P=wp.element,B=P.useState,T=P.useEffect,L=wp.richText,F=L.toggleFormat,U=L.applyFormat,D=(L.removeFormat,L.insert),H=L.create,W=wp.components,M=W.Flex,G=W.FlexItem,V=W.FlexBlock,X=W.ExternalLink,J=W.ToggleControl,K=W.Notice,$=(W.RangeControl,W.SelectControl),q=W.TextControl,Z=W.Button,Y=W.ButtonGroup,Q=W.Modal,ee=W.Spinner,te=W.Card,re=W.CardBody,ne=W.CardDivider,ae=W.CardFooter,ie=(W.CardHeader,W.CardMedia),oe=wp.apiFetch,le=wp.i18n.__,ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.item_ids,r=e.products,n=e.updateValue,a=e.formaterProps,o=e.isSingle,s=void 0!==o&&o,d=e.isFormater,p=void 0!==d&&d,b=B(!1),R=v(b,2),E=R[0],C=R[1],P=B({term:"",rating:4,minPrice:40,maxPrice:0,minSavingPercent:0,sortBy:"Featured",categoryId:"all"}),L=v(P,2),W=L[0],ce=L[1],se=B([{value:"all",label:"All Category"}]),ue=v(se,2),me=ue[0],fe=ue[1],de=B("all"),ge=v(de,2),pe=ge[0],he=(ge[1],B(!1)),be=v(he,2),ye=be[0],ve=be[1],Re=B(!0),Ee=v(Re,2),Ce=Ee[0],xe=Ee[1],we=B(!0),Se=v(we,2),ke=Se[0],Oe=Se[1],ze=B(!1),_e=v(ze,2),Ne=_e[0],Ie=_e[1],je=B(0),Ae=v(je,2),Pe=Ae[0],Be=Ae[1],Te=B(null),Le=v(Te,2),Fe=Le[0],Ue=Le[1],De=B(0),He=v(De,2),We=He[0],Me=He[1],Ge=B(null),Ve=v(Ge,2),Xe=Ve[0],Je=Ve[1],Ke=B(null),$e=v(Ke,2),qe=$e[0],Ze=$e[1];T((function(){W.term.length>0&&tt()}),[pe]),T((function(){nt()}),[t]),T((function(){Ne&&(!Ce||Ce&&W.term.length>2)&&Ye(0)}),[Ce]),T((function(){var e=localStorage.getItem("fromServer");xe("true"==e),Ie(!0)}),[]),T((function(){(W.term.length>0||!Ce)&&We>0&&Ye()}),[We,E]);var Ye=function(e){if(E&&!ye){Je(null);var t=0!=e?We:e,r=W.term.length>0?W.term:"NOTERM";ve(!0),oe({path:"/i2-azon/v1/search/"+r+"?si="+W.categoryId+"&page="+t+"&sortBy="+W.sortBy+"&sourceRemote="+Ce}).then((function(e){if(x(e,"Errors"))Je(w(e,"Errors[0].Message")),Ue(null),ve(!1);else{if(me.length<2){var t=w(e,"SearchResult.SearchRefinements.SearchIndex.Bins",[]),r=[{value:"all",label:"All Category"}];t.length>0&&(t.map((function(e){return r.push({value:e.Id,label:e.DisplayName})})),fe(r))}var n=w(e,"SearchResult.TotalResultCount",0);Qe(n),Ue(e),0==n&&(!Ce&&W.term.length>0?(Je(le("No result found, search on amazon ","themesfirst")),Ze(!0)):Je(le("No result found","themesfirst"))),ve(!1)}}))}},Qe=function(e){Be(e>=100?10:e>10?parseInt(e/10)+(e%10>0?1:0):0)},et=function(e){1==We&&1==e?(Me(0),Ye(0)):Me(e-1)},tt=function(){We>0&&Me(0),Ye(0)},rt=function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(p){if(a.value.start==a.value.end){var o=U(H({text:i+" "}),{type:"themesfirst/amazonlinkformat",attributes:{href:m(r),target:ke?"_blank":"_self",rel:"nofollow noopener noreferrer"}},0,i.length);a.onChange(D(a.value,o))}else a.onChange(U(a.value,{type:"themesfirst/amazonlinkformat",attributes:{href:m(r),target:ke?"_blank":"_self",rel:"nofollow noopener noreferrer"}}));C(!1)}else"add"==e?n(s?{item_ids:[r]}:{item_ids:[].concat(y(t),[r])}):"delete"==e?it(r):(k(t,(function(e){return I(e,r)})),n({item_ids:y(t)}))},nt=function(){var e=S(r,"asin"),a=z(e,t),i=z(t,e);if(a.length>0){var o=_(r,(function(e){return N(a,e.asin)}));n({products:o})}i.length>0&&at(i.join(","))},at=function(e){oe({path:"/i2-azon/v1/contents/"+e}).then((function(e){if(null!=e){var t=s?[]:y(r);e.map((function(e){var r=e;r.active_image_Index=0;var n=JSON.parse(e.image_ids);n.length>0&&(delete r.image_ids,r.image=n[0]),t.push(r)})),n({products:t})}}))},it=function(e){oe({path:"/i2-azon/v1/delete/"+e}).then((function(r){1==r?(k(t,(function(t){return I(t,e)})),n({item_ids:y(t)}),Ye(We)):Je(le("Error on removing product, please try again","themefirst"))}))},ot=function(e){localStorage.setItem("fromServer",e),Ue(null),xe(e)};return React.createElement(React.Fragment,null,p?React.createElement(React.Fragment,null,React.createElement(A,{icon:a.isActive?"editor-unlink":"admin-links",title:le("Amazon link","themesfirst"),onClick:function(){a.isActive?a.onChange(F(a.value,{type:"themesfirst/amazonlinkformat"})):C(!0)},group:"primary",isActive:a.isActive})," "):React.createElement(M,null,React.createElement("span",null,React.createElement(Z,{variant:"outlined",isPrimary:!0,onClick:function(e){return C(!0)}},le("Search Products","themesfirst"))),t.length>0&&React.createElement(Z,{icon:"image-rotate",isSecondary:!0,size:"24",isBusy:ye,variant:"outlined",onClick:nt,disabled:0==z(t,S(r,"asin")).length})),E&&React.createElement(Q,{open:E,title:le("Search Products","themesfirst"),onRequestClose:function(){return C(!1)},"aria-labelledby":"form-dialog-title",style:{width:"90%",maxWidth:"1080px"}},React.createElement("figure",{style:{minHeight:"400px"}},React.createElement(M,{className:"tf-top-pagination-wrapper"},React.createElement(G,null,React.createElement(M,null,React.createElement(G,null,React.createElement(J,{label:"Use API?",help:le(Ce?"Active Server Amazon API":"Active Server Local DB","themesfirst"),checked:Ce,onChange:function(){return ot(!Ce)}})),p&&React.createElement(G,null,React.createElement(J,{label:"Open link in new tab?",help:le(ke?"link will open in new tab":"link will open in same tab","themesfirst"),checked:ke,onChange:function(){return Oe(!ke)}})))),Pe>1&&React.createElement(Y,{style:{marginLeft:"auto"}},We>0&&React.createElement(Z,{onClick:function(){return et(We)},icon:"arrow-left-alt2"},le("Prev","themesfirst")),React.createElement(Z,{isPrimary:!0,disabled:!0,icon:"editor-kitchensink"}," ",We+1," ",le("of","themesfirst")," ",Pe),We<Pe-1&&React.createElement(Z,{onClick:function(){return et(We+2)},icon:"arrow-right-alt2",iconPosition:"right"},le("Next","themesfirst")))),ye&&React.createElement(M,{justify:"center"},React.createElement(V,{style:{minHeight:"50px",textAlign:"center"}},React.createElement(ee,null))),Xe&&React.createElement(K,{status:"error",onRemove:function(){Je(null),Ze(null)}},Xe," ",qe&&React.createElement(X,{href:f(W.term)},W.term)),React.createElement("div",{style:{marginTop:"15px",marginBottom:"15px"}},React.createElement(M,{className:"tf-flex-sf-container"},React.createElement(G,null,React.createElement(q,{label:le("Search Terms","themesfirst"),value:W.term,onChange:function(e){return ce(h(h({},W),{},{term:e}))}})),React.createElement(G,null,Ce&&React.createElement($,{label:le("Sort By","themesfirst"),value:W.sortBy,onChange:function(e){ce(h(h({},W),{},{sortBy:e}))},options:g})),React.createElement(G,null,React.createElement(Z,{icon:"search",isBusy:ye,className:"tf-full-button",style:{marginBottom:"8px"},disabled:Ce&&W.term.length<3,isPrimary:!0,onClick:function(){return tt()}},le("Search","themesfirst"))))),Fe&&Fe.SearchResult.Items.length>0&&j(Fe.SearchResult.Items,3).map((function(e){return React.createElement(M,{justify:"center",style:{marginBottom:"10px"}},e.map((function(e){return React.createElement(G,{style:{maxWidth:"33%",alignSelf:"flex-start"}},Ce?React.createElement(te,{className:"tf-card"},-1==t.indexOf(w(e,"ASIN"))?React.createElement(Z,{icon:"plus",isSecondary:!0,size:"24",onClick:function(t){return rt("add",w(e,"ASIN"),w(e,"ItemInfo.Title.DisplayValue","No Title"))},className:"tf-card-button tf-button-add"}):React.createElement(Z,{icon:"minus",isSecondary:!0,size:"24",onClick:function(t){return rt("remove",w(e,"ASIN"))},className:"tf-card-button tf-button-minus"}),React.createElement(ie,{className:"tf-card-image"},React.createElement("img",{src:w(e,"Images.Primary.Large.URL","#")})),React.createElement(re,{size:"small"},React.createElement("strong",{style:{marginTop:0,display:"block"}},"ASIN :",w(e,"ASIN","no asin")),w(e,"ItemInfo.Title.DisplayValue","No Title"),React.createElement(ne,{className:"tf-card-devider"}),O(e.BrowseNodeInfo.BrowseNodes).ContextFreeName),React.createElement(ae,{size:"small"},React.createElement(G,null,x(e,"Offers.Listings[0].SavingBasis.DisplayAmount")?React.createElement("span",null,React.createElement("s",null,w(e,"Offers.Listings[0].SavingBasis.DisplayAmount"))," "," "," "):"",React.createElement("b",null,w(e,"Offers.Listings[0].Price.DisplayAmount","No Price"))),React.createElement(G,{style:{marginLeft:"auto"}},React.createElement(X,{href:w(e,"DetailPageURL")})))):React.createElement(te,{className:"tf-card"},-1==t.indexOf(w(e,"asin"))?React.createElement(Z,{icon:"plus",isSecondary:!0,size:"24",onClick:function(t){return rt("add",w(e,"asin"),w(e,"title",""))},className:"tf-card-button tf-button-add"}):React.createElement(Z,{icon:"minus",isSecondary:!0,size:"24",onClick:function(t){return rt("remove",w(e,"asin"))},className:"tf-card-button tf-button-minus"}),React.createElement(Z,{icon:"trash",isSecondary:!0,size:"24",onClick:function(t){return rt("delete",w(e,"asin"))},className:"tf-card-button tf-button-minus tf-button-trash"}),React.createElement(ie,{className:"tf-card-image"},React.createElement(i,{imageUrl:l(w(e,"image_ids","#")),ext:c(w(e,"image_ids","#"))})),React.createElement(re,{size:"small"},React.createElement("strong",{style:{marginTop:0,display:"block"}},"ASIN :",w(e,"asin","no asin")),w(e,"title","No Title")),React.createElement(ae,{size:"small"},React.createElement(G,null,x(e,"saving")?React.createElement("span",null,React.createElement("s",null,w(e,"saving"))," "," "):"",React.createElement("b",null,w(e,"display_price",le("No Price","themesfirst")))),React.createElement(G,{style:{marginLeft:"auto"}},React.createElement(X,{href:u(w(e,"asin"))})))))})))})))))};(0,wp.richText.registerFormatType)("themesfirst/amazonlinkformat",{title:(0,wp.i18n.__)("Amazon link (i2-azon)","themesfirst"),tagName:"a",className:"i2-azon-amazon-link",edit:function(e){return React.createElement(ce,{isFormater:!0,formaterProps:e,item_ids:[]})}});var se=wp.i18n.__,ue=(se("Text"),se("Number"),se("Button"),se("Yes/No"),se("Image"),se("Rating"),se("Link"),se("Flat"),se("3D"),se("Amazon"),se("Custom"),se("Highlighter","themes-first"),se("","themes-first"),se("Thumbnail","themes-first"),se("Thumbnail","themes-first"),se("Title","themes-first"),se("Product Name","themes-first"),se("ASIN","themes-first"),se("ASIN","themes-first"),se("Rating","themes-first"),se("Rating","themes-first"),se("Reviews","themes-first"),se("Reviews","themes-first"),se("Manufacturer","themes-first"),se("Manufacturer","themes-first"),se("Brand","themes-first"),se("Brand","themes-first"),se("Model","themes-first"),se("Model","themes-first"),se("Product Group","themes-first"),se("Group","themes-first"),se("Amazon Fulfilled","themes-first"),se("Amazon Fulfilled","themes-first"),se("Prime Benefits","themes-first"),se("Prime Benefits","themes-first"),se("Price","themes-first"),se("Price","themes-first"),se("Saving","themes-first"),se("","themes-first"),se("Button","themes-first"),se("View On Amazon","themes-first"),se("Highlighter","themes-first"),se("","themes-first"),se("Thumbnail","themes-first"),se("Thumbnail","themes-first"),se("Title","themes-first"),se("Product Name","themes-first"),se("ASIN","themes-first"),se("ASIN","themes-first"),se("Price","themes-first"),se("Price","themes-first"),se("Saving","themes-first"),se("","themes-first"),se("Button","themes-first"),se("View On Amazon","themes-first"),se("Please Select","themes-first"),se("Amazon","themes-first"),se("Rounded","themes-first"),se("3D","themes-first"),se("Link","themes-first"),se("Please Select","themes-first"),se("Small","themes-first"),se("Medium","themes-first"),se("Big","themes-first"),se("Larg","themes-first"),se("Please Select","themes-first"),se("Middle","themes-first"),se("Top","themes-first"),se("Bottom","themes-first"),se("Right","themes-first"),se("Left","themes-first"),[{name:se("Small"),slug:"small",size:12},{name:se("Medium"),slug:"medium",size:18},{name:se("Larg"),slug:"larg",size:24},{name:se("Extra"),slug:"extra",size:36}]),me=r(0),fe=r.n(me);function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(n=(o=l.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ge(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ge(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe=lodash.chunk,he=wp.components,be=he.Flex,ye=he.FlexItem,ve=he.FlexBlock,Re=he.Button,Ee=he.Modal,Ce=he.Spinner,xe=wp.element,we=xe.useState,Se=xe.useEffect,ke=wp.i18n.__,Oe=wp.apiFetch,ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.image,r=e.prodPos,n=e.updateImages,a=e.asin,o=e.size,l=we(!1),c=de(l,2),s=c[0],u=c[1],m=we(!1),f=de(m,2),d=f[0],g=f[1],p=we([]),h=de(p,2),b=h[0],y=h[1];return Se((function(){s&&(g(!0),Oe({path:"/i2-azon/v1/images/"+a}).then((function(e){y(JSON.parse(e)),g(!1)})))}),[s]),React.createElement("figure",null,React.createElement("figure",{style:{position:"relative"}},React.createElement(Re,{icon:"images-alt2",isPrimary:!0,size:"24","aria-label":"remove",onClick:function(){return u(!0)},style:{position:"absolute",top:"15px",left:"15px"}}),t&&React.createElement(i,{imageUrl:t.URL,ext:t.EXT?t.EXT:"jpg",size:o})),s?React.createElement(Ee,{open:s,title:ke("Select Image","themesfirst"),onRequestClose:function(e){return u(!1)},"aria-labelledby":"form-dialog-title"},React.createElement("div",{style:{minHeight:"400px"}},d&&React.createElement(be,{justify:"center"},React.createElement(ve,{style:{minHeight:"100px",textAlign:"center"}},React.createElement(Ce,null))),b.length>0&&pe(b,3).map((function(e){return React.createElement(be,{justify:"center"},e.map((function(e){return React.createElement(ye,{style:{maxWidth:"33%"}},React.createElement(i,{onClick:function(){return n(r,e)},className:fe()("tf-mdl-image",{"tf-mdl-image-active":t&&e.URL==t.URL}),imageUrl:e.URL,size:"400",ext:e.EXT?e.EXT:"jpg"}))})))})))):null)};function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){Ie(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var je=wp.components,Ae=je.Flex,Pe=je.FlexItem,Be=je.FlexBlock,Te=je.RangeControl,Le=je.Button,Fe=je.ButtonGroup,Ue=wp.i18n.__,De=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.field,r=e.onChange,n=t.size,a=t.unit,i=function(){return"%"==a?100:500},o=function(){return"%"==a?5:50};return React.createElement(React.Fragment,null,React.createElement(Ae,null,React.createElement(Pe,null,Ue("Width","themesfirst")),React.createElement(Be,{className:"tf-text-align-end"},React.createElement(Fe,{size:"small","aria-label":"small outlined button group",style:{marginLeft:"auto"}},React.createElement(Le,{onClick:function(){return r(Ne(Ne({},t),{},{unit:"%",size:60}))},isPrimary:"%"==a,isSmall:!0},"%"),React.createElement(Le,{onClick:function(){return r(Ne(Ne({},t),{},{unit:"px",size:300}))},isPrimary:"%"!=a,isSmall:!0},"px")))),React.createElement(Ae,null,React.createElement(Be,null,React.createElement(Te,{label:n+a,withInputField:!0,value:n,onChange:function(e){return r(Ne(Ne({},t),{},{size:e}))},min:o(),step:1,max:i()}))))};function He(e){return function(e){if(Array.isArray(e))return Ge(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Me(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(n=(o=l.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw i}}return r}(e,t)||Me(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(e,t){if(e){if("string"==typeof e)return Ge(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ge(e,t):void 0}}function Ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ve=wp.i18n.__,Xe=wp.blocks.registerBlockType,Je=wp.components,Ke=Je.Button,$e=Je.FontSizePicker,qe=Je.TextControl,Ze=Je.ToggleControl,Ye=Je.PanelBody,Qe=wp.blockEditor,et=Qe.InspectorControls,tt=Qe.MediaUpload,rt=Qe.MediaUploadCheck,nt=Qe.RichText,at=Qe.PanelColorSettings,it=wp.element,ot=it.useEffect,lt=it.useState,ct=lodash.has;function st(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Xe("themesfirst/i2-azon-image",{title:Ve("Image i2AZON","themesfirst"),icon:"format-image",category:"themesfirst",keywords:[Ve("Image","themesfirst"),Ve("Amazon Image","themesfirst"),Ve("i2 azon","themesfirst")],attributes:{item_ids:{type:"array",default:[]},products:{type:"array",default:[]},block_id:{type:"string",default:""},link:{type:"string",default:""},alt_text:{type:"string",default:""},text:{type:"string",default:Ve("CLICK HERE","themesfirst")},showText:{type:"boolean",default:!0},textOnTop:{type:"boolean",default:!1},useBorder:{type:"boolean",default:!1},borderColor:{default:"#231f20"},paddingSize:{type:"string"},fontSize:{type:"number",default:18},color:{default:"#ffffff"},bgColor:{default:"#231f20"},useLink:{type:"boolean",default:!0},customLink:{type:"string",default:""},width:{type:"object",default:{size:400,unit:"px",full:780}}},supports:{align:!0},edit:function(e){e.attributes;var t=e.clientId,r=e.attributes,n=r.item_ids,a=r.width,i=r.block_id,o=r.useLink,l=r.customLink,c=r.alt_text,s=(r.paddingSize,r.useBorder),u=r.borderColor,m=(r.active_image_index,r.products),f=(r.custom_img,r.link,r.text),d=r.color,g=r.bgColor,p=r.fontSize,h=r.showText,b=r.textOnTop,y=e.setAttributes;""!=i&&null!=i||y({block_id:t});var v=We(lt([{value:g,onChange:function(e){return y({bgColor:e})},label:Ve("Background Color","themesfirst")},{value:d,onChange:function(e){return y({color:e})},label:Ve("Text Color","themesfirst")}]),2),R=v[0],E=v[1];ot((function(){!s&&R.length>2?(R.pop(),E(He(R))):s&&2==R.length&&(R.push({value:u,onChange:function(e){return y({borderColor:e})},label:Ve("Border Color","themesfirst")}),E(He(R)))}),[s]);var C=function(e){if(ct(e,"item_ids"))y(e);else if(1==e.products.length&&(y({products:[{asin:e.products[0].asin,title:e.products[0].title,image:e.products[0].image}]}),""==c)){var t=e.products[0].title;if(t.length>70){var r=t.lastIndexOf(" ",70);t=t.substring(0,r)}y({alt_text:t})}},x=function(e,t){var r=He(m);r[e].image=t,y({products:r})};return React.createElement(React.Fragment,null,React.createElement(et,null,React.createElement(Ye,{title:Ve("Common","themesfirst"),initialOpen:!0},React.createElement(ce,{item_ids:n,products:m,updateValue:C,isSingle:!0}),React.createElement("hr",null),n.length>0&&React.createElement("h4",null,Ve("ASIN","themesfirst")," : ",n[0]," "),React.createElement(De,{field:a,onChange:function(e){return y({width:e})}}),React.createElement("hr",null),React.createElement(Ze,{label:Ve("Use Link?","themesfirst"),checked:o,onChange:function(){return y({useLink:!o})}}),o&&React.createElement(React.Fragment,null," ",React.createElement(qe,{label:Ve("Alt Text","themesfirst"),help:Ve("Image alt text","themesfirst"),value:c,onChange:function(e){return y({alt_text:e})}}),React.createElement(qe,{label:Ve("URL (By default amazon link)","themesfirst"),help:Ve("Optional (custom url should start with http)","themesfirst"),value:l,onChange:function(e){return y({customLink:e})}})),React.createElement(Ze,{label:"Show Text?",checked:h,onChange:function(){return y({showText:!h})}}),h&&React.createElement(Ze,{label:"Text On Top?",help:b?"Text on top.":"Text on bottom",checked:b,onChange:function(){return y({textOnTop:!b})}}),React.createElement(Ze,{label:Ve("Use Border?","themesfirst"),checked:s,onChange:function(){return y({useBorder:!s})}})),React.createElement(Ye,{title:Ve("Font Size","themesfirst"),initialOpen:!1},React.createElement($e,{fontSizes:ue,value:p,fallbackFontSize:18,withSlider:!0,onChange:function(e){y({fontSize:e||18})}})),React.createElement(at,{title:Ve("Color Settings","themesfirst"),initialOpen:!1,colorSettings:s?[{value:g,onChange:function(e){return y({bgColor:e})},label:Ve("Background Color","themesfirst")},{value:d,onChange:function(e){return y({color:e})},label:Ve("Text Color","themesfirst")},{value:u,onChange:function(e){return y({borderColor:e})},label:Ve("Border Color","themesfirst")}]:[{value:g,onChange:function(e){return y({bgColor:e})},label:Ve("Background Color","themesfirst")},{value:d,onChange:function(e){return y({color:e})},label:Ve("Text Color","themesfirst")}]})),React.createElement("figure",{className:"tf-i2 tf-i2-azon-image mywp-block-image",style:{position:"relative",width:"%a"==a.unit?"100%":a.size+a.unit}},React.createElement("div",{className:"components-resizable-box__container has-show-handle",style:{position:"relative",boxSizing:"border-box",width:"100%"}},0==m.length&&React.createElement(ce,{item_ids:n,products:m,updateValue:C,isSingle:!0}),m.map((function(e,t){return React.createElement("div",{className:(s?"has-border ":"")+"tf-amz-image-wrapper",style:{flexDirection:b?"column-reverse":"column",borderColor:u}},!ct(e,"custom_img.mediaId")&&React.createElement(ze,{image:e.image,asin:e.asin,prodPos:t,updateImages:x,size:"px"!=a.unit?null:a.size}),React.createElement("div",{className:null==e.custom_img||""==e.custom_img?"no-custom-image":"editor-post-featured-image"},null!=e.custom_img&&React.createElement("img",{src:e.custom_img.mediaUrl}),React.createElement(rt,null,React.createElement(tt,{onSelect:function(e){return function(e,t){var r=He(m);r[e].custom_img=t,y({products:r})}(t,{mediaId:e.id,mediaUrl:e.url})},value:null!=e.custom_img&&""!=e.custom_img?e.custom_img.mediaId:"",allowedTypes:["image"],render:function(e){var t=e.open;return React.createElement(Ke,{icon:"wordpress",isSecondary:!0,size:"24",className:"no-custom-image",onClick:t})}})),ct(e,"custom_img.mediaId")&&React.createElement(Ke,{icon:"trash",className:"clear-custom-image",iconSize:"24",label:"Delete",onClick:function(){return function(e){if(ct(m[e],"custom_img")){var t=He(m);delete t[e].custom_img,y({products:t})}}(t)}})),h&&React.createElement("div",{style:{clear:"both",marginTop:"0",backgroundColor:g,color:d,textAlign:"center"}},React.createElement(nt,{onChange:function(e){return y({text:e})},tagName:"p",value:f,style:{margin:0,fontSize:p+"px",lineHeight:2*p+"px"}})))})))))},save:function(e){var t=e.attributes,r=t.block_id,n=t.width,a=t.useLink,i=t.alt_text,l=t.text,c=t.bgColor,u=t.color,m=t.fontSize,f=t.useBorder,d=t.products,g=t.textOnTop,p=t.showText,h=t.borderColor;return d&&d.length>0&&React.createElement(s,{isLink:a,elm:"div",id:"tf-block-image-".concat(r),className:"tf-block-".concat(r," tf-amz-image-block-wrapper"),href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer",style:{width:n.size+n.unit}},React.createElement("div",{className:(f?"has-border ":"")+"tf-amz-image-wrapper",style:{flexDirection:g?"column-reverse":"column",borderColor:h}},React.createElement("div",{className:"tf-featured-media"},1==d.length&&!ct(d[0],"custom_img.mediaId")&&React.createElement("img",{src:o(d[0].image.URL,"px"==n.unit&&n.size<=d[0].image.Width?n.size:"",d[0].image.EXT),alt:i,height:d[0].image.Height,width:d[0].image.Width}),1==d.length&&ct(d[0],"custom_img.mediaId")&&React.createElement("img",{src:d[0].custom_img.mediaUrl,alt:i})),p&&React.createElement("div",{style:{clear:"both",marginTop:"0",backgroundColor:c,textAlign:"center"}},React.createElement("p",{style:{margin:0,fontSize:m+"px",color:u,lineHeight:2*m+"px"}},l))))}});var ft=lodash,dt=ft.isArray,gt=ft.map,pt=wp.components,ht=pt.RangeControl,bt=pt.Flex,yt=pt.ButtonGroup,vt=pt.Button,Rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.field,r=e.max,n=e.min,a=e.label,i=e.units,o=e.onChange,l=t.val,c=t.unit;return React.createElement(React.Fragment,null,React.createElement(bt,{style:{marginTop:"8px",marginBottom:"8px"}},React.createElement("div",null,a),React.createElement(yt,null,i&&dt(i)&>(i,(function(e){return React.createElement(vt,{isSmall:!0,isPrimary:c==e,onClick:function(){return o(ut(ut({},t),{},{unit:e}))}},e)})))),React.createElement(ht,{value:l,onChange:function(e){return o(ut(ut({},t),{},{val:e}))},min:n,max:r}))};function Et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(r),!0).forEach((function(t){xt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wt(e){return function(e){if(Array.isArray(e))return St(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return St(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return St(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var kt=wp.i18n.__,Ot=wp.blocks.registerBlockType,zt=(wp.element.createElement,wp.components),_t=zt.Button,Nt=zt.ButtonGroup,It=zt.Dashicon,jt=zt.Flex,At=zt.FlexItem,Pt=zt.FlexBlock,Bt=zt.RangeControl,Tt=zt.TextControl,Lt=zt.ToggleControl,Ft=zt.CheckboxControl,Ut=zt.PanelBody,Dt=wp.blockEditor,Ht=Dt.InspectorControls,Wt=Dt.MediaUpload,Mt=Dt.MediaUploadCheck,Gt=Dt.RichText,Vt=Dt.PanelColorSettings,Xt=wp.element.Fragment,Jt=lodash.has;Ot("themesfirst/i2-azon-product-box",{title:kt("Product Box i2AZON","themesfirst"),icon:"embed-photo",category:"themesfirst",keywords:[kt("Product Box","themesfirst"),kt("Amazon Product Box","themesfirst"),kt("i2 azon","themesfirst")],attributes:{item_ids:{type:"array",default:[]},products:{type:"array",default:[]},block_id:{type:"string",default:""},useBorder:{type:"boolean",default:!1},borderColor:{type:"string",default:"#231f20"},paddingSize:{type:"string"},fontSize:{type:"number",default:18},color:{type:"string",default:"#222222"},textColor:{type:"string",default:"#222222"},bgColor:{type:"string",default:"#fff"},useLink:{type:"boolean",default:!0},hideButton:{type:"boolean",default:!1},customLink:{type:"string",default:""},btnText:{type:"string",default:kt("View On Amazon","themesfirst")},boxBorder:{type:"object",default:{use:!0,color:"#222222",size:{unit:"px",val:1},useRadius:!0,radius:{unit:"px",val:4}}},btnBorder:{type:"object",default:{use:!0,color:"#222222",size:{unit:"px",val:1},useRadius:!0,radius:{unit:"px",val:4}}},icon:{type:"object",default:{cssClass:"icofont-brand-amazon",size:"icofont-md",color:"",bgColor:"transprent"}},imgWrapperWidth:{type:"number",default:25},imgWidth:{type:"number",default:300},width:{type:"object",default:{size:400,unit:"px",full:780}},isHorizontal:{type:"boolean",default:!1}},edit:function(e){e.attributes;var t,r,n,a,i,o=e.clientId,l=e.attributes,c=l.item_ids,s=l.width,u=l.imgWidth,m=l.imgWrapperWidth,f=l.hideButton,g=l.isHorizontal,p=l.btnBorder,h=l.textColor,b=l.boxBorder,y=l.block_id,v=l.icon,R=l.btnText,E=l.useLink,C=l.customLink,x=(l.paddingSize,l.useBorder),w=(l.borderColor,l.products),S=(l.custom_img,l.link,l.text,l.color),k=l.bgColor,O=e.setAttributes;""!=y&&null!=y||O({block_id:o});var z=function(e){if(Jt(e,"item_ids"))O(e);else if(1==e.products.length){var t=JSON.parse(e.products[0].features).map((function(e){return function(e){return e.replace(/\\/g,"")}(e)}));O({products:[{asin:e.products[0].asin,title:e.products[0].title,description:"",features:"<li>"+t.join("</li><li>")+"</li>",dbFeatures:t,image:e.products[0].image}]})}},_=function(e,t){var r=wt(w);r[e].image=t,O({products:r})},N=function(e,t,r,n){var a=wt(w);n>=0?a[t][r][n]=e:a[t][r]=e,O({products:a})};return React.createElement(React.Fragment,null,React.createElement(Ht,null,React.createElement(Ut,{title:kt("Common","themesfirst"),initialOpen:!0},React.createElement(ce,{item_ids:c,products:w,updateValue:z,isSingle:!0}),React.createElement("hr",null),c.length>0&&React.createElement("h4",null,kt("ASIN","themesfirst")," : ",c[0]," "),w&&w.length>0&&React.createElement(jt,null,React.createElement(Pt,null,"Features"),React.createElement(At,{style:{alignSelf:"flex-end"}},React.createElement(_t,{style:{marginBottom:"12px",height:"30px"},isSecondary:!0,onClick:function(){return function(){if(w&&w.length>0){var e=wt(w);e[0].features="<li>"+e[0].dbFeatures.join("</li><li>")+"</li>",O({products:e})}}()}}," ",kt("Reset","themesfirst")+" ("+(null===(t=w[0].dbFeatures)||void 0===t?void 0:t.length)+")"," "))),React.createElement("hr",null),React.createElement(Nt,{style:{textAlign:"right",width:"100%",marginBottom:"10px"}},React.createElement(_t,{isPrimary:g,isSmall:!0,isSecondary:!g,onClick:function(){return O({isHorizontal:!0})}},React.createElement(It,{icon:"menu-alt"})," ",kt("Horizontal","themesfirst")),React.createElement(_t,{isPrimary:!g,isSmall:!0,isSecondary:g,onClick:function(){return O({isHorizontal:!1})}},React.createElement(It,{icon:"columns"})," ",kt("Verticle","themesfirst"))),g&&React.createElement(Bt,{label:"Image Width ("+u+"px)",withInputField:!0,allowReset:!1,value:u,onChange:function(e){return O({imgWidth:e})},min:100,step:10,max:(null===(r=w[0])||void 0===r||null===(n=r.image)||void 0===n?void 0:n.Width)>200?null===(a=w[0])||void 0===a||null===(i=a.image)||void 0===i?void 0:i.Width:500}),!g&&React.createElement(Bt,{label:"Image Area ("+m+"%)",withInputField:!0,allowReset:!1,value:m,onChange:function(e){return O({imgWrapperWidth:e})},min:15,step:1,max:50}),React.createElement("hr",null),React.createElement(Lt,{label:kt("Without Links?","themesfirst"),checked:!E,onChange:function(){return O({useLink:!E})}}),E&&React.createElement(Tt,{label:kt("URL (By default amazon link)","themesfirst"),help:kt("Optional (custom url should start with http)","themesfirst"),value:C,onChange:function(e){return O({customLink:e})}}),E&&React.createElement(Lt,{label:kt("Hide Button?","themesfirst"),checked:f,onChange:function(){return O({hideButton:!f})}})),React.createElement(Ut,{title:kt("Border Setting"),initialOpen:!1},React.createElement(Ft,{label:"Use Box Border?",help:"if you want to use border",checked:b.use,onChange:function(e){return O({boxBorder:Ct(Ct({},b),{},{use:e})})}}),b.use&&React.createElement(Xt,null,React.createElement(Rt,{field:b.size,min:0,max:20,label:"Size",units:["px"],onChange:function(e){return O({boxBorder:Ct(Ct({},b),{},{size:e})})}}),React.createElement(Ft,{label:"Use Custom Radius?",help:"if you want to use custom radius",checked:b.useRadius,onChange:function(e){return O({boxBorder:Ct(Ct({},b),{},{useRadius:e})})}}),b.useRadius&&React.createElement(Rt,{field:b.radius,min:0,max:50,label:"Radius",units:["%","px"],onChange:function(e){return O({boxBorder:Ct(Ct({},b),{},{radius:e})})}}))),React.createElement(Vt,{title:kt("Color Settings","themesfirst"),initialOpen:!1,colorSettings:b.use?[{value:k,onChange:function(e){return O({bgColor:e})},label:kt("Background Color","themesfirst")},{value:S,onChange:function(e){return O({color:e})},label:kt("Heading Color","themesfirst")},{value:h,onChange:function(e){return O({textColor:e})},label:kt("Text Color","themesfirst")},{value:b.color,onChange:function(e){return O({boxBorder:Ct(Ct({},b),{},{color:e})})},label:kt("Border Color","themesfirst")}]:[{value:k,onChange:function(e){return O({bgColor:e})},label:kt("Background Color","themesfirst")},{value:S,onChange:function(e){return O({color:e})},label:kt("Heading Color","themesfirst")},{value:h,onChange:function(e){return O({textColor:e})},label:kt("Text Color","themesfirst")}]})),React.createElement("figure",{className:"tf-i2"},0==w.length&&React.createElement(ce,{item_ids:c,products:w,updateValue:z,isSingle:!0}),w.map((function(e,t){return React.createElement("div",{className:fe()({"has-border":x},"tf-i2-product",{"tf-i2-horizontal":g}),style:d({border:b,bgColor:k})},React.createElement("div",{className:"tf-i2-image",style:{width:g?"100%":m+"%"}},!Jt(e,"custom_img.mediaId")&&React.createElement(ze,{image:e.image,asin:e.asin,prodPos:t,updateImages:_,size:g?u:"px"!=s.unit?null:s.size}),React.createElement("div",{className:null==e.custom_img||""==e.custom_img?"no-custom-image":"editor-post-featured-image"},null!=e.custom_img&&React.createElement("img",{src:e.custom_img.mediaUrl}),React.createElement(Mt,null,React.createElement(Wt,{onSelect:function(e){return function(e,t){var r=wt(w);r[e].custom_img=t,O({products:r})}(t,{mediaId:e.id,mediaUrl:e.url})},value:null!=e.custom_img&&""!=e.custom_img?e.custom_img.mediaId:"",allowedTypes:["image"],render:function(e){var t=e.open;return React.createElement(_t,{icon:"wordpress",isSecondary:!0,size:"24",className:"no-custom-image",onClick:t})}})),Jt(e,"custom_img.mediaId")&&React.createElement(_t,{icon:"trash",className:"clear-custom-image",iconSize:"24",label:"Delete",onClick:function(){return function(e){if(Jt(w[e],"custom_img")){var t=wt(w);delete t[e].custom_img,O({products:t})}}(t)}}))),React.createElement("div",{className:"tf-i2-content",style:{width:g?"100%":100-m+"%"}},React.createElement(Gt,{onChange:function(e){return N(e,t,"title",-1)},tagName:"h5",className:"tf-i2-title",style:{color:S},value:e.title,formattingControls:["italic"]}),React.createElement(Gt,{onChange:function(e){return N(e,t,"features",-1)},tagName:"ul",multiline:"li",className:"tf-i2-features",value:e.features,style:{margin:0,color:h}}),E&&!f&&React.createElement("span",{className:fe()("tf-btn-wrapper","tf-btn",{"tf-button-has-border":p.use}),style:d({border:p})},React.createElement("i",{className:fe()(null==v?void 0:v.cssClass)}),React.createElement(Gt,{onChange:function(e){return O({btnText:e})},formattingControls:["bold","italic"],tagName:"span",value:R}))))}))))},save:function(e){var t=e.attributes,r=(t.item_ids,t.width),n=t.btnBorder,a=t.boxBorder,i=t.useBorder,l=t.hideButton,c=t.block_id,u=t.icon,m=t.btnText,f=t.imgWrapperWidth,g=t.imgWidth,p=t.useLink,h=t.products,b=t.textColor,y=t.color,v=t.bgColor,R=t.isHorizontal,E=h[0];return E&&React.createElement("div",{className:"tf-i2",id:c},React.createElement("div",{className:fe()({"has-border":i},"tf-i2-product",{"tf-i2-horizontal":R}),style:d({border:a,bgColor:v})},React.createElement("div",{className:"tf-i2-image",style:{width:R?"100%":f+"%",minHeight:R&&E.image.Height>0&&E.image.Width>0?E.image.Height/E.image.Width*g+"px":"auto"}},React.createElement(s,{isLink:p,href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer"},!Jt(E,"custom_img.mediaId")&&React.createElement("img",{src:o(E.image.URL,R?g:"px"==r.unit&&r.size<=E.image.Width?r.size:"",E.image.EXT),alt:E.title,height:E.image.Height,width:E.image.Width}),Jt(E,"custom_img.mediaId")&&React.createElement("img",{src:E.custom_img.mediaUrl,alt:E.title}))),React.createElement("div",{className:"tf-i2-content",style:{width:R?"100%":100-f+"%"}},React.createElement(Gt.Content,{href:"##AFFILIATELINK##",style:{color:y},target:"_blank",className:"tf-i2-title",tagName:p?"a":"span",value:E.title,rel:"nofollow noopener noreferrer"}),React.createElement(Gt.Content,{tagName:"ul",value:E.features,style:{color:b},className:"tf-i2-features"}),p&&!l&&React.createElement("a",{href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer",className:fe()("tf-btn-wrapper","tf-btn",{"tf-button-has-border":n.use}),style:d({border:n})},React.createElement("i",{className:fe()(null==u?void 0:u.cssClass)})," ",m))))}})}]);6 */!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var o=a.apply(null,n);o&&e.push(o)}else if("object"===i)for(var l in n)r.call(n,l)&&n[l]&&e.push(l)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},,,,function(e,t,r){"use strict";r.r(t);var n=lodash,a=(n.some,n.isEmpty),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.imageUrl,r=e.size,n=void 0===r?"":r,a=e.ext,i=void 0===a?"jpg":a,l=e.style,c=e.className,s=e.onClick;return React.createElement("img",{className:c,style:l||null,onClick:function(){return s?s():null},src:o(t,n,i)})},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jpg",n=t?"._SL"+t+"_":"";return"NOIMG"==e||"#"==e||a(e)?tfGlobal.homeUrl+"/wp-content/plugins/i2-azone/dist/images/no-image-available.png":"https://m.media-amazon.com/images/I/"+e+n+"."+(r||"jpg")},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&"#"!=e){var r=JSON.parse(e);return r&&r.length>t?r[t].URL:"NOIMG"}},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&"#"!=e){var r=JSON.parse(e);return r&&r.length>t?r[t].EXT:"jpg"}},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.isLink,r=e.id,n=e.href,a=e.style,i=e.className,o=e.onClick,l=e.children,c=e.target,s=void 0===c?"_blank":c,u=e.rel,m=void 0===u?"nofollow noopener noreferrer":u,f=e.elm,d=void 0===f?"span":f;return t?React.createElement("a",{id:r,href:n,style:a,className:i,onClick:o,target:s,rel:m},l):wp.element.createElement(d,{id:r,style:a,className:i,onClick:o},l)},u=function(e){return tfGlobal.storeUrl+"/dp/"+e},m=function(e){return"1"==tfGlobal.add_proxy_link?tfGlobal.homeUrl+"/"+tfGlobal.proxy_link_slug+"/"+e:tfGlobal.storeUrl+"/dp/"+e+("1"==tfGlobal.donotAddLink?"":"/?tag="+tfGlobal.partnerTagForLink+"&linkCode=ogi&th=1&psc=1")},f=function(e){return tfGlobal.storeUrl+"/s?k="+e},d=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,r=t.color,n=t.bgColor,i=t.padding,o=t.border,l={};(a(r)||(l.color=r),a(n)||(l.backgroundColor=n),a(i)||(l.padding=i),a(o))||(1==o.useRadius&&(null===(e=o.radius)||void 0===e?void 0:e.val)>0&&(l.borderRadius=o.radius.val+o.radius.unit),1==o.use&&null!=o.color?l.border=o.size.val+o.size.unit+" solid "+o.color:l.borderColor=o.color);return l},g=[{value:"Featured",label:"Featured"},{value:"AvgCustomerReviews",label:"Avg Customer Reviews"},{value:"NewestArrivals",label:"Newest Arrivals"},{value:"Price:HighToLow",label:"Price: High To Low"},{value:"Price:LowToHigh",label:"Price: Low To High"},{value:"Relevance",label:"Relevance"}];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(n=(o=l.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw i}}return r}(e,t)||R(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var C=lodash,x=C.has,w=C.get,S=C.map,k=C.remove,O=C.first,z=C.difference,_=C.dropWhile,N=C.includes,I=C.isEqual,P=C.chunk,j=wp.blockEditor.RichTextToolbarButton,A=wp.element,B=A.useState,T=A.useEffect,L=wp.richText,F=L.toggleFormat,U=L.applyFormat,D=(L.removeFormat,L.insert),H=L.create,W=wp.components,M=W.Flex,G=W.FlexItem,V=W.FlexBlock,X=W.ExternalLink,J=W.ToggleControl,K=W.Notice,$=(W.RangeControl,W.SelectControl),q=W.TextControl,Z=W.Button,Y=W.ButtonGroup,Q=W.Modal,ee=W.Spinner,te=W.Card,re=W.CardBody,ne=W.CardDivider,ae=W.CardFooter,ie=(W.CardHeader,W.CardMedia),oe=wp.apiFetch,le=wp.i18n.__,ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.item_ids,r=e.products,n=e.updateValue,a=e.formaterProps,o=e.isSingle,s=void 0!==o&&o,d=e.isFormater,p=void 0!==d&&d,b=B(!1),R=v(b,2),E=R[0],C=R[1],A=B({term:"",rating:4,minPrice:40,maxPrice:0,minSavingPercent:0,sortBy:"Featured",categoryId:"all"}),L=v(A,2),W=L[0],ce=L[1],se=B([{value:"all",label:"All Category"}]),ue=v(se,2),me=ue[0],fe=ue[1],de=B("all"),ge=v(de,2),pe=ge[0],he=(ge[1],B(!1)),be=v(he,2),ye=be[0],ve=be[1],Re=B(!0),Ee=v(Re,2),Ce=Ee[0],xe=Ee[1],we=B(!0),Se=v(we,2),ke=Se[0],Oe=Se[1],ze=B(!1),_e=v(ze,2),Ne=_e[0],Ie=_e[1],Pe=B(0),je=v(Pe,2),Ae=je[0],Be=je[1],Te=B(null),Le=v(Te,2),Fe=Le[0],Ue=Le[1],De=B(0),He=v(De,2),We=He[0],Me=He[1],Ge=B(null),Ve=v(Ge,2),Xe=Ve[0],Je=Ve[1],Ke=B(null),$e=v(Ke,2),qe=$e[0],Ze=$e[1];T((function(){W.term.length>0&&tt()}),[pe]),T((function(){nt()}),[t]),T((function(){Ne&&(!Ce||Ce&&W.term.length>2)&&Ye(0)}),[Ce]),T((function(){var e=localStorage.getItem("fromServer");xe("true"==e),Ie(!0)}),[]),T((function(){(W.term.length>0||!Ce)&&We>0&&Ye()}),[We,E]);var Ye=function(e){if(E&&!ye){Je(null);var t=0!=e?We:e,r=W.term.length>0?W.term:"NOTERM";ve(!0),oe({path:"/i2-azon/v1/search/"+r+"?si="+W.categoryId+"&page="+t+"&sortBy="+W.sortBy+"&sourceRemote="+Ce}).then((function(e){if(x(e,"Errors"))Je(w(e,"Errors[0].Message")),Ue(null),ve(!1);else{if(me.length<2){var t=w(e,"SearchResult.SearchRefinements.SearchIndex.Bins",[]),r=[{value:"all",label:"All Category"}];t.length>0&&(t.map((function(e){return r.push({value:e.Id,label:e.DisplayName})})),fe(r))}var n=w(e,"SearchResult.TotalResultCount",0);Qe(n),Ue(e),0==n&&(!Ce&&W.term.length>0?(Je(le("No result found, search on amazon ","themesfirst")),Ze(!0)):Je(le("No result found","themesfirst"))),ve(!1)}}))}},Qe=function(e){Be(e>=100?10:e>10?parseInt(e/10)+(e%10>0?1:0):0)},et=function(e){1==We&&1==e?(Me(0),Ye(0)):Me(e-1)},tt=function(){We>0&&Me(0),Ye(0)},rt=function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(p){if(a.value.start==a.value.end){var o=U(H({text:i+" "}),{type:"themesfirst/amazonlinkformat",attributes:{href:m(r),target:ke?"_blank":"_self",rel:"nofollow noopener noreferrer"}},0,i.length);a.onChange(D(a.value,o))}else a.onChange(U(a.value,{type:"themesfirst/amazonlinkformat",attributes:{href:m(r),target:ke?"_blank":"_self",rel:"nofollow noopener noreferrer"}}));C(!1)}else"add"==e?n(s?{item_ids:[r]}:{item_ids:[].concat(y(t),[r])}):"delete"==e?it(r):(k(t,(function(e){return I(e,r)})),n({item_ids:y(t)}))},nt=function(){var e=S(r,"asin"),a=z(e,t),i=z(t,e);if(a.length>0){var o=_(r,(function(e){return N(a,e.asin)}));n({products:o})}i.length>0&&at(i.join(","))},at=function(e){oe({path:"/i2-azon/v1/contents/"+e}).then((function(e){if(null!=e){var t=s?[]:y(r);e.map((function(e){var r=e;r.active_image_Index=0;var n=JSON.parse(e.image_ids);n.length>0&&(delete r.image_ids,r.image=n[0]),t.push(r)})),n({products:t})}}))},it=function(e){oe({path:"/i2-azon/v1/delete/"+e}).then((function(r){1==r?(k(t,(function(t){return I(t,e)})),n({item_ids:y(t)}),Ye(We)):Je(le("Error on removing product, please try again","themefirst"))}))},ot=function(e){localStorage.setItem("fromServer",e),Ue(null),xe(e)};return React.createElement(React.Fragment,null,p?React.createElement(React.Fragment,null,React.createElement(j,{icon:a.isActive?"editor-unlink":"admin-links",title:le("Amazon link","themesfirst"),onClick:function(){a.isActive?a.onChange(F(a.value,{type:"themesfirst/amazonlinkformat"})):C(!0)},group:"primary",isActive:a.isActive})," "):React.createElement(M,null,React.createElement("span",null,React.createElement(Z,{variant:"outlined",isPrimary:!0,onClick:function(e){return C(!0)}},le("Search Products","themesfirst"))),t.length>0&&React.createElement(Z,{icon:"image-rotate",isSecondary:!0,size:"24",isBusy:ye,variant:"outlined",onClick:nt,disabled:0==z(t,S(r,"asin")).length})),E&&React.createElement(Q,{open:E,title:le("Search Products","themesfirst"),onRequestClose:function(){return C(!1)},"aria-labelledby":"form-dialog-title",style:{width:"90%",maxWidth:"1080px"}},React.createElement("figure",{style:{minHeight:"400px"}},React.createElement(M,{className:"tf-top-pagination-wrapper"},React.createElement(G,null,React.createElement(M,null,React.createElement(G,null,React.createElement(J,{label:"Use API?",help:le(Ce?"Active Server Amazon API":"Active Server Local DB","themesfirst"),checked:Ce,onChange:function(){return ot(!Ce)}})),p&&React.createElement(G,null,React.createElement(J,{label:"Open link in new tab?",help:le(ke?"link will open in new tab":"link will open in same tab","themesfirst"),checked:ke,onChange:function(){return Oe(!ke)}})))),Ae>1&&React.createElement(Y,{style:{marginLeft:"auto"}},We>0&&React.createElement(Z,{onClick:function(){return et(We)},icon:"arrow-left-alt2"},le("Prev","themesfirst")),React.createElement(Z,{isPrimary:!0,disabled:!0,icon:"editor-kitchensink"}," ",We+1," ",le("of","themesfirst")," ",Ae),We<Ae-1&&React.createElement(Z,{onClick:function(){return et(We+2)},icon:"arrow-right-alt2",iconPosition:"right"},le("Next","themesfirst")))),ye&&React.createElement(M,{justify:"center"},React.createElement(V,{style:{minHeight:"50px",textAlign:"center"}},React.createElement(ee,null))),Xe&&React.createElement(K,{status:"error",onRemove:function(){Je(null),Ze(null)}},Xe," ",qe&&React.createElement(X,{href:f(W.term)},W.term)),React.createElement("div",{style:{marginTop:"15px",marginBottom:"15px"}},React.createElement(M,{className:"tf-flex-sf-container"},React.createElement(G,null,React.createElement(q,{label:le("Search Terms","themesfirst"),value:W.term,onChange:function(e){return ce(h(h({},W),{},{term:e}))}})),React.createElement(G,null,Ce&&React.createElement($,{label:le("Sort By","themesfirst"),value:W.sortBy,onChange:function(e){ce(h(h({},W),{},{sortBy:e}))},options:g})),React.createElement(G,null,React.createElement(Z,{icon:"search",isBusy:ye,className:"tf-full-button",style:{marginBottom:"8px"},disabled:Ce&&W.term.length<3,isPrimary:!0,onClick:function(){return tt()}},le("Search","themesfirst"))))),Fe&&Fe.SearchResult.Items.length>0&&P(Fe.SearchResult.Items,3).map((function(e){return React.createElement(M,{justify:"center",style:{marginBottom:"10px"}},e.map((function(e){return React.createElement(G,{style:{maxWidth:"33%",alignSelf:"flex-start"}},Ce?React.createElement(te,{className:"tf-card"},-1==t.indexOf(w(e,"ASIN"))?React.createElement(Z,{icon:"plus",isSecondary:!0,size:"24",onClick:function(t){return rt("add",w(e,"ASIN"),w(e,"ItemInfo.Title.DisplayValue","No Title"))},className:"tf-card-button tf-button-add"}):React.createElement(Z,{icon:"minus",isSecondary:!0,size:"24",onClick:function(t){return rt("remove",w(e,"ASIN"))},className:"tf-card-button tf-button-minus"}),React.createElement(ie,{className:"tf-card-image"},React.createElement("img",{src:w(e,"Images.Primary.Large.URL","#")})),React.createElement(re,{size:"small"},React.createElement("strong",{style:{marginTop:0,display:"block"}},"ASIN :",w(e,"ASIN","no asin")),w(e,"ItemInfo.Title.DisplayValue","No Title"),React.createElement(ne,{className:"tf-card-devider"}),O(e.BrowseNodeInfo.BrowseNodes).ContextFreeName),React.createElement(ae,{size:"small"},React.createElement(G,null,x(e,"Offers.Listings[0].SavingBasis.DisplayAmount")?React.createElement("span",null,React.createElement("s",null,w(e,"Offers.Listings[0].SavingBasis.DisplayAmount"))," "," "," "):"",React.createElement("b",null,w(e,"Offers.Listings[0].Price.DisplayAmount","No Price"))),React.createElement(G,{style:{marginLeft:"auto"}},React.createElement(X,{href:w(e,"DetailPageURL")})))):React.createElement(te,{className:"tf-card"},-1==t.indexOf(w(e,"asin"))?React.createElement(Z,{icon:"plus",isSecondary:!0,size:"24",onClick:function(t){return rt("add",w(e,"asin"),w(e,"title",""))},className:"tf-card-button tf-button-add"}):React.createElement(Z,{icon:"minus",isSecondary:!0,size:"24",onClick:function(t){return rt("remove",w(e,"asin"))},className:"tf-card-button tf-button-minus"}),React.createElement(Z,{icon:"trash",isSecondary:!0,size:"24",onClick:function(t){return rt("delete",w(e,"asin"))},className:"tf-card-button tf-button-minus tf-button-trash"}),React.createElement(ie,{className:"tf-card-image"},React.createElement(i,{imageUrl:l(w(e,"image_ids","#")),ext:c(w(e,"image_ids","#"))})),React.createElement(re,{size:"small"},React.createElement("strong",{style:{marginTop:0,display:"block"}},"ASIN :",w(e,"asin","no asin")),w(e,"title","No Title")),React.createElement(ae,{size:"small"},React.createElement(G,null,x(e,"saving")?React.createElement("span",null,React.createElement("s",null,w(e,"saving"))," "," "):"",React.createElement("b",null,w(e,"display_price",le("No Price","themesfirst")))),React.createElement(G,{style:{marginLeft:"auto"}},React.createElement(X,{href:u(w(e,"asin"))})))))})))})))))};(0,wp.richText.registerFormatType)("themesfirst/amazonlinkformat",{title:(0,wp.i18n.__)("Amazon link (i2-azon)","themesfirst"),tagName:"a",className:"i2-azon-amazon-link",edit:function(e){return React.createElement(ce,{isFormater:!0,formaterProps:e,item_ids:[]})}});var se=wp.i18n.__,ue=(se("Text"),se("Number"),se("Button"),se("Yes/No"),se("Image"),se("Rating"),se("Link"),se("Flat"),se("3D"),se("Amazon"),se("Custom"),se("Highlighter","themes-first"),se("","themes-first"),se("Thumbnail","themes-first"),se("Thumbnail","themes-first"),se("Title","themes-first"),se("Product Name","themes-first"),se("ASIN","themes-first"),se("ASIN","themes-first"),se("Rating","themes-first"),se("Rating","themes-first"),se("Reviews","themes-first"),se("Reviews","themes-first"),se("Manufacturer","themes-first"),se("Manufacturer","themes-first"),se("Brand","themes-first"),se("Brand","themes-first"),se("Model","themes-first"),se("Model","themes-first"),se("Product Group","themes-first"),se("Group","themes-first"),se("Amazon Fulfilled","themes-first"),se("Amazon Fulfilled","themes-first"),se("Prime Benefits","themes-first"),se("Prime Benefits","themes-first"),se("Price","themes-first"),se("Price","themes-first"),se("Saving","themes-first"),se("","themes-first"),se("Button","themes-first"),se("View On Amazon","themes-first"),se("Highlighter","themes-first"),se("","themes-first"),se("Thumbnail","themes-first"),se("Thumbnail","themes-first"),se("Title","themes-first"),se("Product Name","themes-first"),se("ASIN","themes-first"),se("ASIN","themes-first"),se("Price","themes-first"),se("Price","themes-first"),se("Saving","themes-first"),se("","themes-first"),se("Button","themes-first"),se("View On Amazon","themes-first"),se("Please Select","themes-first"),se("Amazon","themes-first"),se("Rounded","themes-first"),se("3D","themes-first"),se("Link","themes-first"),se("Please Select","themes-first"),se("Small","themes-first"),se("Medium","themes-first"),se("Big","themes-first"),se("Larg","themes-first"),se("Please Select","themes-first"),se("Middle","themes-first"),se("Top","themes-first"),se("Bottom","themes-first"),se("Right","themes-first"),se("Left","themes-first"),[{name:se("Small"),slug:"small",size:12},{name:se("Medium"),slug:"medium",size:18},{name:se("Larg"),slug:"larg",size:24},{name:se("Extra"),slug:"extra",size:36}]),me=r(0),fe=r.n(me);function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(n=(o=l.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ge(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ge(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe=lodash.chunk,he=wp.components,be=he.Flex,ye=he.FlexItem,ve=he.FlexBlock,Re=he.Button,Ee=he.Modal,Ce=he.Spinner,xe=wp.element,we=xe.useState,Se=xe.useEffect,ke=wp.i18n.__,Oe=wp.apiFetch,ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.image,r=e.prodPos,n=e.updateImages,a=e.asin,o=e.size,l=we(!1),c=de(l,2),s=c[0],u=c[1],m=we(!1),f=de(m,2),d=f[0],g=f[1],p=we([]),h=de(p,2),b=h[0],y=h[1];return Se((function(){s&&(g(!0),Oe({path:"/i2-azon/v1/images/"+a}).then((function(e){y(JSON.parse(e)),g(!1)})))}),[s]),React.createElement("figure",null,React.createElement("figure",{style:{position:"relative"}},React.createElement(Re,{icon:"images-alt2",isPrimary:!0,size:"24","aria-label":"remove",onClick:function(){return u(!0)},style:{position:"absolute",top:"15px",left:"15px"}}),t&&React.createElement(i,{imageUrl:t.URL,ext:t.EXT?t.EXT:"jpg",size:o})),s?React.createElement(Ee,{open:s,title:ke("Select Image","themesfirst"),onRequestClose:function(e){return u(!1)},"aria-labelledby":"form-dialog-title"},React.createElement("div",{style:{minHeight:"400px"}},d&&React.createElement(be,{justify:"center"},React.createElement(ve,{style:{minHeight:"100px",textAlign:"center"}},React.createElement(Ce,null))),b.length>0&&pe(b,3).map((function(e){return React.createElement(be,{justify:"center"},e.map((function(e){return React.createElement(ye,{style:{maxWidth:"33%"}},React.createElement(i,{onClick:function(){return n(r,e)},className:fe()("tf-mdl-image",{"tf-mdl-image-active":t&&e.URL==t.URL}),imageUrl:e.URL,size:"400",ext:e.EXT?e.EXT:"jpg"}))})))})))):null)};function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){Ie(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Pe=wp.components,je=Pe.Flex,Ae=Pe.FlexItem,Be=Pe.FlexBlock,Te=Pe.RangeControl,Le=Pe.Button,Fe=Pe.ButtonGroup,Ue=wp.i18n.__,De=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.field,r=e.onChange,n=t.size,a=t.unit,i=function(){return"%"==a?100:500},o=function(){return"%"==a?5:50};return React.createElement(React.Fragment,null,React.createElement(je,null,React.createElement(Ae,null,Ue("Width","themesfirst")),React.createElement(Be,{className:"tf-text-align-end"},React.createElement(Fe,{size:"small","aria-label":"small outlined button group",style:{marginLeft:"auto"}},React.createElement(Le,{onClick:function(){return r(Ne(Ne({},t),{},{unit:"%",size:60}))},isPrimary:"%"==a,isSmall:!0},"%"),React.createElement(Le,{onClick:function(){return r(Ne(Ne({},t),{},{unit:"px",size:300}))},isPrimary:"%"!=a,isSmall:!0},"px")))),React.createElement(je,null,React.createElement(Be,null,React.createElement(Te,{label:n+a,withInputField:!0,value:n,onChange:function(e){return r(Ne(Ne({},t),{},{size:e}))},min:o(),step:1,max:i()}))))};function He(e){return function(e){if(Array.isArray(e))return We(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return We(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return We(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Me=wp.i18n.__,Ge=wp.blocks.registerBlockType,Ve=wp.components,Xe=Ve.Button,Je=Ve.FontSizePicker,Ke=Ve.TextControl,$e=Ve.ToggleControl,qe=Ve.PanelBody,Ze=wp.blockEditor,Ye=Ze.InspectorControls,Qe=Ze.MediaUpload,et=Ze.MediaUploadCheck,tt=Ze.RichText,rt=Ze.PanelColorSettings,nt=wp.element,at=(nt.useEffect,nt.useState,lodash.has);function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){lt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Ge("themesfirst/i2-azon-image",{title:Me("Image i2AZON","themesfirst"),icon:"format-image",category:"themesfirst",keywords:[Me("Image","themesfirst"),Me("Amazon Image","themesfirst"),Me("i2 azon","themesfirst")],attributes:{item_ids:{type:"array",default:[]},products:{type:"array",default:[]},block_id:{type:"string",default:""},link:{type:"string",default:""},alt_text:{type:"string",default:""},text:{type:"string",default:Me("CLICK HERE","themesfirst")},showText:{type:"boolean",default:!0},textOnTop:{type:"boolean",default:!1},useBorder:{type:"boolean",default:!1},borderColor:{default:"#231f20"},paddingSize:{type:"string"},fontSize:{type:"number",default:18},color:{default:"#ffffff"},bgColor:{default:"#231f20"},useLink:{type:"boolean",default:!0},customLink:{type:"string",default:""},width:{type:"object",default:{size:400,unit:"px",full:780}}},supports:{align:!0},edit:function(e){e.attributes;var t=e.clientId,r=e.attributes,n=r.item_ids,a=r.width,i=r.block_id,o=r.useLink,l=r.customLink,c=r.alt_text,s=(r.paddingSize,r.useBorder),u=r.borderColor,m=(r.active_image_index,r.products),f=(r.custom_img,r.link,r.text),d=r.color,g=r.bgColor,p=r.fontSize,h=r.showText,b=r.textOnTop,y=e.setAttributes;""!=i&&null!=i||y({block_id:t});var v=function(e){if(at(e,"item_ids"))y(e);else if(1==e.products.length&&(y({products:[{asin:e.products[0].asin,title:e.products[0].title,image:e.products[0].image}]}),""==c)){var t=e.products[0].title;if(t.length>70){var r=t.lastIndexOf(" ",70);t=t.substring(0,r)}y({alt_text:t})}},R=function(e,t){var r=He(m);r[e].image=t,y({products:r})};return React.createElement(React.Fragment,null,React.createElement(Ye,null,React.createElement(qe,{title:Me("Common","themesfirst"),initialOpen:!0},React.createElement(ce,{item_ids:n,products:m,updateValue:v,isSingle:!0}),React.createElement("hr",null),n.length>0&&React.createElement("h4",null,Me("ASIN","themesfirst")," : ",n[0]," "),React.createElement(De,{field:a,onChange:function(e){return y({width:e})}}),React.createElement("hr",null),React.createElement($e,{label:Me("Use Link?","themesfirst"),checked:o,onChange:function(){return y({useLink:!o})}}),o&&React.createElement(React.Fragment,null," ",React.createElement(Ke,{label:Me("Alt Text","themesfirst"),help:Me("Image alt text","themesfirst"),value:c,onChange:function(e){return y({alt_text:e})}}),React.createElement(Ke,{label:Me("URL (By default amazon link)","themesfirst"),help:Me("Optional (custom url should start with http)","themesfirst"),value:l,onChange:function(e){return y({customLink:e})}})),React.createElement($e,{label:"Show Text?",checked:h,onChange:function(){return y({showText:!h})}}),h&&React.createElement($e,{label:"Text On Top?",help:b?"Text on top.":"Text on bottom",checked:b,onChange:function(){return y({textOnTop:!b})}}),React.createElement($e,{label:Me("Use Border?","themesfirst"),checked:s,onChange:function(){return y({useBorder:!s})}})),React.createElement(qe,{title:Me("Font Size","themesfirst"),initialOpen:!1},React.createElement(Je,{fontSizes:ue,value:p,fallbackFontSize:18,withSlider:!0,onChange:function(e){y({fontSize:e||18})}})),React.createElement(rt,{title:Me("Color Settings","themesfirst"),initialOpen:!1,colorSettings:s?[{value:g,onChange:function(e){return y({bgColor:void 0!==e?e:"#231f20"})},label:Me("Background Color","themesfirst")},{value:d,onChange:function(e){return y({color:void 0!==e?e:"#ffffff"})},label:Me("Text Color","themesfirst")},{value:u,onChange:function(e){return y({borderColor:void 0!==e?e:"#231f20"})},label:Me("Border Color","themesfirst")}]:[{value:g,onChange:function(e){return y({bgColor:void 0!==e?e:"#231f20"})},label:Me("Background Color","themesfirst")},{value:d,onChange:function(e){return y({color:void 0!==e?e:"#ffffff"})},label:Me("Text Color","themesfirst")}]})),React.createElement("figure",{className:"tf-i2 tf-i2-azon-image mywp-block-image",style:{position:"relative",width:"%a"==a.unit?"100%":a.size+a.unit}},React.createElement("div",{className:"components-resizable-box__container has-show-handle",style:{position:"relative",boxSizing:"border-box",width:"100%"}},0==m.length&&React.createElement(ce,{item_ids:n,products:m,updateValue:v,isSingle:!0}),m.map((function(e,t){return React.createElement("div",{className:(s?"has-border ":"")+"tf-amz-image-wrapper",style:{flexDirection:b?"column-reverse":"column",borderColor:u}},!at(e,"custom_img.mediaId")&&React.createElement(ze,{image:e.image,asin:e.asin,prodPos:t,updateImages:R,size:"px"!=a.unit?null:a.size}),React.createElement("div",{className:null==e.custom_img||""==e.custom_img?"no-custom-image":"editor-post-featured-image"},null!=e.custom_img&&React.createElement("img",{src:e.custom_img.mediaUrl}),React.createElement(et,null,React.createElement(Qe,{onSelect:function(e){return function(e,t){var r=He(m);r[e].custom_img=t,y({products:r})}(t,{mediaId:e.id,mediaUrl:e.url})},value:null!=e.custom_img&&""!=e.custom_img?e.custom_img.mediaId:"",allowedTypes:["image"],render:function(e){var t=e.open;return React.createElement(Xe,{icon:"wordpress",isSecondary:!0,size:"24",className:"no-custom-image",onClick:t})}})),at(e,"custom_img.mediaId")&&React.createElement(Xe,{icon:"trash",className:"clear-custom-image",iconSize:"24",label:"Delete",onClick:function(){return function(e){if(at(m[e],"custom_img")){var t=He(m);delete t[e].custom_img,y({products:t})}}(t)}})),h&&React.createElement("div",{style:{clear:"both",marginTop:"0",backgroundColor:g,color:d,textAlign:"center"}},React.createElement(tt,{onChange:function(e){return y({text:e})},tagName:"p",value:f,style:{margin:0,fontSize:p+"px",lineHeight:2*p+"px"}})))})))))},save:function(e){var t=e.attributes,r=t.block_id,n=t.width,a=t.useLink,i=t.alt_text,l=t.text,c=t.bgColor,u=t.color,m=t.fontSize,f=t.useBorder,d=t.products,g=t.textOnTop,p=t.showText,h=t.borderColor;return d&&d.length>0&&React.createElement(s,{isLink:a,elm:"div",id:"tf-block-image-".concat(r),className:"tf-block-".concat(r," tf-amz-image-block-wrapper"),href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer",style:{width:n.size+n.unit}},React.createElement("div",{className:(f?"has-border ":"")+"tf-amz-image-wrapper",style:{flexDirection:g?"column-reverse":"column",borderColor:h}},React.createElement("div",{className:"tf-featured-media"},1==d.length&&!at(d[0],"custom_img.mediaId")&&React.createElement("img",{src:o(d[0].image.URL,"px"==n.unit&&n.size<=d[0].image.Width?n.size:"",d[0].image.EXT),alt:i,height:d[0].image.Height,width:d[0].image.Width}),1==d.length&&at(d[0],"custom_img.mediaId")&&React.createElement("img",{src:d[0].custom_img.mediaUrl,alt:i})),p&&React.createElement("div",{style:{clear:"both",marginTop:"0",backgroundColor:c,textAlign:"center"}},React.createElement("p",{style:{margin:0,fontSize:m+"px",color:u,lineHeight:2*m+"px"}},l))))}});var ct=lodash,st=ct.isArray,ut=ct.map,mt=wp.components,ft=mt.RangeControl,dt=mt.Flex,gt=mt.ButtonGroup,pt=mt.Button,ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:props,t=e.field,r=e.max,n=e.min,a=e.label,i=e.units,o=e.onChange,l=t.val,c=t.unit;return React.createElement(React.Fragment,null,React.createElement(dt,{style:{marginTop:"8px",marginBottom:"8px"}},React.createElement("div",null,a),React.createElement(gt,null,i&&st(i)&&ut(i,(function(e){return React.createElement(pt,{isSmall:!0,isPrimary:c==e,onClick:function(){return o(ot(ot({},t),{},{unit:e}))}},e)})))),React.createElement(ft,{value:l,onChange:function(e){return o(ot(ot({},t),{},{val:e}))},min:n,max:r}))};function bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(r),!0).forEach((function(t){vt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rt(e){return function(e){if(Array.isArray(e))return Et(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Et(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ct=wp.i18n.__,xt=wp.blocks.registerBlockType,wt=(wp.element.createElement,wp.components),St=wt.Button,kt=wt.ButtonGroup,Ot=wt.Dashicon,zt=wt.Flex,_t=wt.FlexItem,Nt=wt.FlexBlock,It=wt.RangeControl,Pt=wt.TextControl,jt=wt.ToggleControl,At=wt.CheckboxControl,Bt=wt.PanelBody,Tt=wp.blockEditor,Lt=Tt.InspectorControls,Ft=Tt.MediaUpload,Ut=Tt.MediaUploadCheck,Dt=Tt.RichText,Ht=Tt.PanelColorSettings,Wt=wp.element.Fragment,Mt=lodash.has;xt("themesfirst/i2-azon-product-box",{title:Ct("Product Box i2AZON","themesfirst"),icon:"embed-photo",category:"themesfirst",keywords:[Ct("Product Box","themesfirst"),Ct("Amazon Product Box","themesfirst"),Ct("i2 azon","themesfirst")],attributes:{item_ids:{type:"array",default:[]},products:{type:"array",default:[]},block_id:{type:"string",default:""},useBorder:{type:"boolean",default:!1},borderColor:{type:"string",default:"#231f20"},paddingSize:{type:"string"},fontSize:{type:"number",default:18},color:{type:"string",default:"#222222"},textColor:{type:"string",default:"#222222"},bgColor:{type:"string",default:"#fff"},useLink:{type:"boolean",default:!0},hideButton:{type:"boolean",default:!1},customLink:{type:"string",default:""},btnText:{type:"string",default:Ct("View On Amazon","themesfirst")},boxBorder:{type:"object",default:{use:!0,color:"#222222",size:{unit:"px",val:1},useRadius:!0,radius:{unit:"px",val:4}}},btnBorder:{type:"object",default:{use:!0,color:"#222222",size:{unit:"px",val:1},useRadius:!0,radius:{unit:"px",val:4}}},icon:{type:"object",default:{cssClass:"icofont-brand-amazon",size:"icofont-md",color:"",bgColor:"transprent"}},imgWrapperWidth:{type:"number",default:25},imgWidth:{type:"number",default:300},width:{type:"object",default:{size:400,unit:"px",full:780}},isHorizontal:{type:"boolean",default:!1}},edit:function(e){e.attributes;var t,r,n,a,i,o=e.clientId,l=e.attributes,c=l.item_ids,s=l.width,u=l.imgWidth,m=l.imgWrapperWidth,f=l.hideButton,g=l.isHorizontal,p=l.btnBorder,h=l.textColor,b=l.boxBorder,y=l.block_id,v=l.icon,R=l.btnText,E=l.useLink,C=l.customLink,x=(l.paddingSize,l.useBorder),w=(l.borderColor,l.products),S=(l.custom_img,l.link,l.text,l.color),k=l.bgColor,O=e.setAttributes;""!=y&&null!=y||O({block_id:o});var z=function(e){if(Mt(e,"item_ids"))O(e);else if(1==e.products.length){var t=JSON.parse(e.products[0].features).map((function(e){return function(e){return e.replace(/\\/g,"")}(e)}));O({products:[{asin:e.products[0].asin,title:e.products[0].title,description:"",features:"<li>"+t.join("</li><li>")+"</li>",dbFeatures:t,image:e.products[0].image}]})}},_=function(e,t){var r=Rt(w);r[e].image=t,O({products:r})},N=function(e,t,r,n){var a=Rt(w);n>=0?a[t][r][n]=e:a[t][r]=e,O({products:a})};return React.createElement(React.Fragment,null,React.createElement(Lt,null,React.createElement(Bt,{title:Ct("Common","themesfirst"),initialOpen:!0},React.createElement(ce,{item_ids:c,products:w,updateValue:z,isSingle:!0}),React.createElement("hr",null),c.length>0&&React.createElement("h4",null,Ct("ASIN","themesfirst")," : ",c[0]," "),w&&w.length>0&&React.createElement(zt,null,React.createElement(Nt,null,"Features"),React.createElement(_t,{style:{alignSelf:"flex-end"}},React.createElement(St,{style:{marginBottom:"12px",height:"30px"},isSecondary:!0,onClick:function(){return function(){if(w&&w.length>0){var e=Rt(w);e[0].features="<li>"+e[0].dbFeatures.join("</li><li>")+"</li>",O({products:e})}}()}}," ",Ct("Reset","themesfirst")+" ("+(null===(t=w[0].dbFeatures)||void 0===t?void 0:t.length)+")"," "))),React.createElement("hr",null),React.createElement(kt,{style:{textAlign:"right",width:"100%",marginBottom:"10px"}},React.createElement(St,{isPrimary:g,isSmall:!0,isSecondary:!g,onClick:function(){return O({isHorizontal:!0})}},React.createElement(Ot,{icon:"menu-alt"})," ",Ct("Horizontal","themesfirst")),React.createElement(St,{isPrimary:!g,isSmall:!0,isSecondary:g,onClick:function(){return O({isHorizontal:!1})}},React.createElement(Ot,{icon:"columns"})," ",Ct("Verticle","themesfirst"))),g&&React.createElement(It,{label:"Image Width ("+u+"px)",withInputField:!0,allowReset:!1,value:u,onChange:function(e){return O({imgWidth:e})},min:100,step:10,max:(null===(r=w[0])||void 0===r||null===(n=r.image)||void 0===n?void 0:n.Width)>200?null===(a=w[0])||void 0===a||null===(i=a.image)||void 0===i?void 0:i.Width:500}),!g&&React.createElement(It,{label:"Image Area ("+m+"%)",withInputField:!0,allowReset:!1,value:m,onChange:function(e){return O({imgWrapperWidth:e})},min:15,step:1,max:50}),React.createElement("hr",null),React.createElement(jt,{label:Ct("Without Links?","themesfirst"),checked:!E,onChange:function(){return O({useLink:!E})}}),E&&React.createElement(Pt,{label:Ct("URL (By default amazon link)","themesfirst"),help:Ct("Optional (custom url should start with http)","themesfirst"),value:C,onChange:function(e){return O({customLink:e})}}),E&&React.createElement(jt,{label:Ct("Hide Button?","themesfirst"),checked:f,onChange:function(){return O({hideButton:!f})}})),React.createElement(Bt,{title:Ct("Border Setting"),initialOpen:!1},React.createElement(At,{label:"Use Box Border?",help:"if you want to use border",checked:b.use,onChange:function(e){return O({boxBorder:yt(yt({},b),{},{use:e})})}}),b.use&&React.createElement(Wt,null,React.createElement(ht,{field:b.size,min:0,max:20,label:"Size",units:["px"],onChange:function(e){return O({boxBorder:yt(yt({},b),{},{size:e})})}}),React.createElement(At,{label:"Use Custom Radius?",help:"if you want to use custom radius",checked:b.useRadius,onChange:function(e){return O({boxBorder:yt(yt({},b),{},{useRadius:e})})}}),b.useRadius&&React.createElement(ht,{field:b.radius,min:0,max:50,label:"Radius",units:["%","px"],onChange:function(e){return O({boxBorder:yt(yt({},b),{},{radius:e})})}}))),React.createElement(Ht,{title:Ct("Color Settings","themesfirst"),initialOpen:!1,colorSettings:b.use?[{value:k,onChange:function(e){return O({bgColor:void 0!==e?e:"#fff"})},label:Ct("Background Color","themesfirst")},{value:S,onChange:function(e){return O({color:void 0!==e?e:"#222222"})},label:Ct("Heading Color","themesfirst")},{value:h,onChange:function(e){return O({textColor:void 0!==e?e:"#222222"})},label:Ct("Text Color","themesfirst")},{value:b.color,onChange:function(e){return O({boxBorder:yt(yt({},b),{},{color:void 0!==e?e:"#222222"})})},label:Ct("Border Color","themesfirst")}]:[{value:k,onChange:function(e){return O({bgColor:void 0!==e?e:"#fff"})},label:Ct("Background Color","themesfirst")},{value:S,onChange:function(e){return O({color:void 0!==e?e:"#222222"})},label:Ct("Heading Color","themesfirst")},{value:h,onChange:function(e){return O({textColor:void 0!==e?e:"#222222"})},label:Ct("Text Color","themesfirst")}]})),React.createElement("figure",{className:"tf-i2"},0==w.length&&React.createElement(ce,{item_ids:c,products:w,updateValue:z,isSingle:!0}),w.map((function(e,t){return React.createElement("div",{className:fe()({"has-border":x},"tf-i2-product",{"tf-i2-horizontal":g}),style:d({border:b,bgColor:k})},React.createElement("div",{className:"tf-i2-image",style:{width:g?"100%":m+"%"}},!Mt(e,"custom_img.mediaId")&&React.createElement(ze,{image:e.image,asin:e.asin,prodPos:t,updateImages:_,size:g?u:"px"!=s.unit?null:s.size}),React.createElement("div",{className:null==e.custom_img||""==e.custom_img?"no-custom-image":"editor-post-featured-image"},null!=e.custom_img&&React.createElement("img",{src:e.custom_img.mediaUrl}),React.createElement(Ut,null,React.createElement(Ft,{onSelect:function(e){return function(e,t){var r=Rt(w);r[e].custom_img=t,O({products:r})}(t,{mediaId:e.id,mediaUrl:e.url})},value:null!=e.custom_img&&""!=e.custom_img?e.custom_img.mediaId:"",allowedTypes:["image"],render:function(e){var t=e.open;return React.createElement(St,{icon:"wordpress",isSecondary:!0,size:"24",className:"no-custom-image",onClick:t})}})),Mt(e,"custom_img.mediaId")&&React.createElement(St,{icon:"trash",className:"clear-custom-image",iconSize:"24",label:"Delete",onClick:function(){return function(e){if(Mt(w[e],"custom_img")){var t=Rt(w);delete t[e].custom_img,O({products:t})}}(t)}}))),React.createElement("div",{className:"tf-i2-content",style:{width:g?"100%":100-m+"%"}},React.createElement(Dt,{onChange:function(e){return N(e,t,"title",-1)},tagName:"h5",className:"tf-i2-title",style:{color:S},value:e.title,formattingControls:["italic"]}),React.createElement(Dt,{onChange:function(e){return N(e,t,"features",-1)},tagName:"ul",multiline:"li",className:"tf-i2-features",value:e.features,style:{margin:0,color:h}}),E&&!f&&React.createElement("span",{className:fe()("tf-btn-wrapper","tf-btn",{"tf-button-has-border":p.use}),style:d({border:p})},React.createElement("i",{className:fe()(null==v?void 0:v.cssClass)}),React.createElement(Dt,{onChange:function(e){return O({btnText:e})},formattingControls:["bold","italic"],tagName:"span",value:R}))))}))))},save:function(e){var t=e.attributes,r=(t.item_ids,t.width),n=t.btnBorder,a=t.boxBorder,i=t.useBorder,l=t.hideButton,c=t.block_id,u=t.icon,m=t.btnText,f=t.imgWrapperWidth,g=t.imgWidth,p=t.useLink,h=t.products,b=t.textColor,y=t.color,v=t.bgColor,R=t.isHorizontal,E=h[0];return E&&React.createElement("div",{className:"tf-i2",id:c},React.createElement("div",{className:fe()({"has-border":i},"tf-i2-product",{"tf-i2-horizontal":R}),style:d({border:a,bgColor:v})},React.createElement("div",{className:"tf-i2-image",style:{width:R?"100%":f+"%",minHeight:R&&E.image.Height>0&&E.image.Width>0?E.image.Height/E.image.Width*g+"px":"auto"}},React.createElement(s,{isLink:p,href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer"},!Mt(E,"custom_img.mediaId")&&React.createElement("img",{src:o(E.image.URL,R?g:"px"==r.unit&&r.size<=E.image.Width?r.size:"",E.image.EXT),alt:E.title,height:E.image.Height,width:E.image.Width}),Mt(E,"custom_img.mediaId")&&React.createElement("img",{src:E.custom_img.mediaUrl,alt:E.title}))),React.createElement("div",{className:"tf-i2-content",style:{width:R?"100%":100-f+"%"}},React.createElement(Dt.Content,{href:"##AFFILIATELINK##",style:{color:y},target:"_blank",className:"tf-i2-title",tagName:p?"a":"span",value:E.title,rel:"nofollow noopener noreferrer"}),React.createElement(Dt.Content,{tagName:"ul",value:E.features,style:{color:b},className:"tf-i2-features"}),p&&!l&&React.createElement("a",{href:"##AFFILIATELINK##",target:"_blank",rel:"nofollow noopener noreferrer",className:fe()("tf-btn-wrapper","tf-btn",{"tf-button-has-border":n.use}),style:d({border:n})},React.createElement("i",{className:fe()(null==u?void 0:u.cssClass)})," ",m))))}})}]); 7 7 //# sourceMappingURL=blocks.js.map -
i2-azon/trunk/dist/js/blocks.js.map
r2460809 r2463755 1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/classnames/index.js","webpack:///./src/component/common.js","webpack:///./src/component/azsearch/data.js","webpack:///./src/component/azsearch/azsearch.js","webpack:///./src/formater/link-formater.js","webpack:///./src/component/data.js","webpack:///./src/component/MdlImagePicker.js","webpack:///./src/component/fields/widthSize.js","webpack:///./src/blocks/image/index.js","webpack:///./src/component/fields/unitSize.js","webpack:///./src/blocks/product-box/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","hasOwn","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","join","default","lodash","isEmpty","some","AmzonImg","props","imageUrl","size","ext","style","className","onClick","src","AmzonImgURL","lsize","tfGlobal","homeUrl","AmazonSelectImg","images","idx","obj","JSON","parse","AmazonSelectExt","MyBlockWrapper","isLink","id","href","children","target","rel","elm","wp","element","createElement","AmazonLink","asin","storeUrl","AmazonAffiliateLink","add_proxy_link","proxy_link_slug","donotAddLink","partnerTagForLink","AmazonSearchLink","keyword","PrepareInlineStyle","color","bgColor","padding","border","backgroundColor","useRadius","radius","val","borderRadius","unit","use","undefined","borderColor","SortFilter","label","has","map","remove","first","difference","dropWhile","includes","isEqual","chunk","RichTextToolbarButton","blockEditor","useState","useEffect","richText","toggleFormat","applyFormat","insert","removeFormat","components","Flex","FlexItem","FlexBlock","ExternalLink","ToggleControl","Notice","SelectControl","RangeControl","TextControl","Button","ButtonGroup","Modal","Spinner","Card","CardBody","CardDivider","CardFooter","CardMedia","CardHeader","apiFetch","__","i18n","MZSearchDialog","item_ids","products","updateValue","formaterProps","isSingle","isFormater","open","setOpen","term","rating","minPrice","maxPrice","minSavingPercent","sortBy","categoryId","searchFilter","setSearchFilter","categories","setCategories","loading","setLoading","fromServer","setFromServer","openNewWindow","setOpenNewWindow","allowLoadFromServer","setAllowLoadFromServer","pageCount","setPageCount","data","setData","page","setPage","error","setError","hasLink","setHasLink","startSearch","updateProducts","getSearchResult","fs","localStorage","getItem","pos","curPage","path","then","bins","forCategory","item","Id","DisplayName","resutlCount","resetPageCount","parseInt","changePage","updateAsin","action","title","start","end","toInsert","text","type","attributes","onChange","removeItem","x","product_asin","product_to_remove","product_to_load","newProds","fetchContent","asins","items","newProd","active_image_Index","image_ids","image","updateServer","setItem","icon","isActive","group","variant","isPrimary","isSecondary","isBusy","disabled","onRequestClose","aria-labelledby","width","maxWidth","minHeight","help","checked","marginLeft","iconPosition","justify","textAlign","status","onRemove","marginTop","marginBottom","options","SearchResult","Items","alignSelf","indexOf","display","BrowseNodeInfo","BrowseNodes","ContextFreeName","registerFormatType","tagName","edit","FontSizeList","slug","MdlImagePickerNew","prodPos","updateImages","setImages","position","aria-label","top","left","URL","EXT","imgs","img","classnames","WidthSize","field","maxVal","minVal","isSmall","withInputField","min","step","max","registerBlockType","blocks","FontSizePicker","PanelBody","InspectorControls","MediaUpload","MediaUploadCheck","RichText","PanelColorSettings","category","keywords","block_id","link","alt_text","showText","textOnTop","useBorder","paddingSize","fontSize","useLink","customLink","full","supports","align","clientId","active_image_index","custom_img","setAttributes"," colorValue","colors","setColors","pop","updateData","lastIndexOf","substring","initialOpen","fontSizes","fallbackFontSize","withSlider","newFontSize","colorSettings","prod","j","flexDirection","mediaUrl","onSelect","updateCustomImage","mediaId","url","allowedTypes","render","iconSize","removeCustomImage","clear","margin","lineHeight","save","Width","alt","height","Height","UnitSize","units","Dashicon","CheckboxControl","Fragment","textColor","hideButton","btnText","boxBorder","btnBorder","cssClass","imgWrapperWidth","imgWidth","isHorizontal","features","replace","CleanText","description","dbFeatures","updateProduct","content","prop","propPos","resetFeatures","allowReset","formattingControls","multiline","Content"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI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AAV,CAAkBlH,QAAQ,KAAKrP,MAAOwT,EAAKkC,SAAUrT,MAAO,CAACqC,MAAOuQ,GAAY3S,UAAU,mBACzF4P,IAAYgD,GAAc,yBAC1B3R,KAAK,oBAAoBE,OAAS,SAASC,IAAM,+BAClDpB,UAAY+N,KAAW,iBAAkB,SAAU,CAAE,uBAAyBgF,EAAUjQ,MACvF/C,MAASoC,EAAmB,CAACI,OAAQwQ,KACjC,yBAAG/S,UAAW+N,KAAWjD,aAAD,EAACA,EAAMkI,YAJT,KAI2BH","file":"js/blocks.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","const {some,isEmpty} = lodash\r\n\r\nexport const AmzonImg = (({imageUrl, size =\"\", ext = \"jpg\", style, className, onClick} = props) =><img className={className} style={style? style: null} onClick={() => (onClick ? onClick() : null)} src={AmzonImgURL(imageUrl, size,ext)}></img>);\r\nexport const AmzonImgURL = (imageUrl, size =\"\", ext = \"jpg\") => {\r\n\tlet lsize =\tsize? '._SL' + size +'_' : '';\r\n\treturn imageUrl != 'NOIMG' && imageUrl != '#' && !isEmpty(imageUrl) ? 'https://m.media-amazon.com/images/I/' + imageUrl + lsize +'.' + (ext? ext : 'jpg'): \r\n\t\t\t\t\t\t\t\t\t\ttfGlobal.homeUrl + '/wp-content/plugins/i2-azone/dist/images/no-image-available.png';\r\n};\r\nexport const AmazonSelectImg = (images, idx = 0)=>{\r\n\tif (images && images != \"#\") {\r\n\t\t// console.log(JSON.parse(images));\r\n\t\tconst obj = JSON.parse(images);\r\n\t\tif (obj && obj.length > idx) {\r\n\t\t\treturn obj[idx]['URL'];\r\n\t\t}\r\n\t\treturn \"NOIMG\";\r\n\t}\r\n}\r\nexport const AmazonSelectExt = (images, idx = 0)=>{\r\n\tif (images && images != \"#\") {\r\n\t\t// console.log(JSON.parse(images));\r\n\t\tconst obj = JSON.parse(images);\r\n\t\tif (obj && obj.length > idx) {\r\n\t\t\treturn obj[idx]['EXT'];\r\n\t\t}\r\n\t\treturn \"jpg\";\r\n\t}\r\n}\r\nexport const MyBlockWrapper = (({isLink, id, href, style, className, onClick, children, target = \"_blank\", rel = \"nofollow noopener noreferrer\", elm = 'span'} = props) =>{\r\nreturn (isLink ? <a id={id} href={href} style={style} className={className} onClick={onClick} target={target} rel={rel}>{children}</a> : \r\n\twp.element.createElement(elm, {id:id, style:style, className:className, onClick:onClick}, children))\r\n})\r\n\r\n//s?k=B00MNV8E0C\r\nexport const AmazonLink = (asin)=> tfGlobal.storeUrl + '/dp/'+ asin;\r\nexport const AmazonAffiliateLink = (asin)=> {\r\n\treturn tfGlobal.add_proxy_link == '1' ? tfGlobal.homeUrl + '/' + tfGlobal.proxy_link_slug + '/' + asin :\r\n\ttfGlobal.storeUrl + '/dp/'+ asin + (tfGlobal.donotAddLink == '1' ? '' : '/?tag=' + tfGlobal.partnerTagForLink +'&linkCode=ogi&th=1&psc=1');\r\n} \r\n\r\nexport const AmazonSearchLink = (keyword)=> tfGlobal.storeUrl + '/s?k='+ keyword;\r\nexport const MySpace = (height = 15)=>{\r\n\t<div style={{height: height + \"px\", width: \"100%\", minWidth: \"100%\"}}></div>\r\n}\r\nexport const ValidateASIN = (asin) => { return /^(B[\\dA-Z]{9}|\\d{9}(X|\\d))$/.test(asin) };\r\n\r\nexport const SetDefaultColorPlate = (PreSetColors, obj)=>{\r\n\tif(obj !== undefined && some(PreSetColors, {color: obj}) !== true){\r\n\t\tlet colors = [...PreSetColors];\r\n\t\tcolors.push({name: 'Custom', color: obj}); \r\n\t\treturn colors; \r\n\t}\r\n\treturn [...PreSetColors]; \r\n }\r\n\r\nexport const Log = (obj, obj2) => {\r\n\tconsole.log(\"======================\");\r\n\tconsole.log(obj);\r\n\tif(typeof obj2 != undefined){\r\n\tconsole.log(obj2);\r\n\t}\r\n\tconsole.log(\"======================\");\r\n}\r\n\r\nexport const PrepareInlineStyle = ({color,bgColor, padding, border} = props)=>{\r\n\tlet obj = {};\r\n\t// obj.fontSize = fontSize + \"px\";\r\n\t// obj.lineHeight = (fontSize * 2 ) + \"px\";\r\n\t// console.log(border);\r\n\t if(!isEmpty(color)){\r\n\t\tobj.color = color;\r\n\t }\r\n\t if(!isEmpty(bgColor)){\r\n\t obj.backgroundColor = bgColor;\r\n\t }\r\n\t if(!isEmpty(padding)){\r\n\t obj.padding = padding;\r\n\t }\r\n\t if(!isEmpty(border)){\r\n\t if(border.useRadius == true && border.radius?.val > 0) {\r\n\t\tobj.borderRadius = border.radius.val + border.radius.unit;\r\n\t }\r\n\t if(border.use == true && border.color != undefined){\r\n\t\t obj.border = border.size.val + border.size.unit + \" solid \" + border.color; \r\n\t } else{\r\n\t\t obj.borderColor = border.color;\r\n\t }\r\n\t}\r\n\t// console.log(obj);\r\n\t return obj;\r\n}\r\n\r\nexport const CleanText = (text) => {\r\n//\tconsole.log(text.replace(/\\\\/g,''))\r\n\treturn text.replace(/\\\\/g,'');\r\n}","export const SortFilter = [\r\n{\r\n\tvalue: \"Featured\",\r\n\tlabel: \"Featured\"\r\n},{\r\n\tvalue: \"AvgCustomerReviews\",\r\n\tlabel: \"Avg Customer Reviews\"\r\n},{\r\n\tvalue: \"NewestArrivals\",\r\n\tlabel: \"Newest Arrivals\"\r\n},{\r\n\tvalue: \"Price:HighToLow\",\r\n\tlabel: \"Price: High To Low\"\r\n},{\r\n\tvalue: \"Price:LowToHigh\",\r\n\tlabel: \"Price: Low To High\"\r\n},{\r\n\tvalue: \"Relevance\",\r\n\tlabel: \"Relevance\"\r\n}]\r\n","// import React, { useEffect, useState } from 'react';\r\nconst {\r\n has,\r\n get,\r\n map,\r\n remove,\r\n first,\r\n difference,\r\n dropWhile,\r\n includes,\r\n isEqual,\r\n chunk,\r\n} = lodash;\r\n// import { plus as linkIcon } from '@wordpress/icons';\r\n// import {smileIcon} from '../../icons/custom'\r\nimport { AmzonImg, AmazonSelectImg, AmazonSelectExt, AmazonLink,AmazonAffiliateLink, AmazonSearchLink } from \"../common\";\r\n//import {Box, Avatar,LinearProgress,Grid, Paper,Divider, List, ListItem , ListItemText,Select,MenuItem,TextField,Slider, FormGroup } from '@material-ui/core'\r\n//import Alert from \"@material-ui/lab/Alert\";\r\nimport { SortFilter } from \"./data\";\r\n//import { VerticalAlignBottom } from '@material-ui/icons';\r\n// import CssBaseline from '@material-ui/core/CssBaseline';\r\n// import {AZCard} from './azcard'\r\n// import {AZDbCard} from './azdbcard'\r\nconst {RichTextToolbarButton } = wp.blockEditor;\r\nconst { useState, useEffect } = wp.element;\r\nconst { toggleFormat,applyFormat,removeFormat,insert,create } = wp.richText;\r\nconst {\r\n Flex,\r\n FlexItem,\r\n FlexBlock,\r\n ExternalLink,\r\n ToggleControl,\r\n Notice,\r\n RangeControl,\r\n SelectControl,\r\n TextControl,\r\n\tButton,\r\n\tButtonGroup,\r\n Modal,\r\n Spinner,\r\n Card,\r\n CardBody,\r\n CardDivider,\r\n CardFooter,\r\n CardHeader,\r\n CardMedia,\r\n} = wp.components;\r\nconst { apiFetch } = wp;\r\nconst { __ } = wp.i18n;\r\n\r\nexport const MZSearchDialog = ({\r\n item_ids,\r\n products,\r\n\tupdateValue,\r\n\tformaterProps,\r\n\tisSingle = false,\r\n\tisFormater = false,\r\n} = props) => {\r\n // const classes = useStyles();\r\n const [open, setOpen] = useState(false);\r\n\r\n const [searchFilter, setSearchFilter] = useState({\r\n term: \"\",\r\n rating: 4,\r\n minPrice: 40,\r\n maxPrice: 0,\r\n minSavingPercent: 0,\r\n sortBy: \"Featured\",\r\n categoryId: \"all\",\r\n });\r\n const [categories, setCategories] = useState([\r\n { value: \"all\", label: \"All Category\" },\r\n ]);\r\n const [categoryId, setCategoryId] = useState(\"all\");\r\n\r\n const [loading, setLoading] = useState(false);\r\n const [fromServer, setFromServer] = useState(true);\r\n const [openNewWindow, setOpenNewWindow] = useState(true);\r\n const [allowLoadFromServer, setAllowLoadFromServer] = useState(false);\r\n\r\n const [pageCount, setPageCount] = useState(0);\r\n const [data, setData] = useState(null);\r\n const [page, setPage] = useState(0);\r\n const [error, setError] = useState(null);\r\n const [hasLink, setHasLink] = useState(null);\r\n \r\n\r\n useEffect(() => {\r\n if (searchFilter.term.length > 0) {\r\n startSearch();\r\n }\r\n }, [categoryId]);\r\n\r\n useEffect(() => {\r\n updateProducts();\r\n }, [item_ids]);\r\n\r\n useEffect(() => {\r\n //console.log(fromServer);\r\n if (allowLoadFromServer && (!fromServer || (fromServer && searchFilter.term.length > 2))) {\r\n getSearchResult(0);\r\n\t\t}\r\n\t\t\r\n }, [fromServer]);\r\n\r\n useEffect(() => {\r\n let fs = localStorage.getItem(\"fromServer\");\r\n setFromServer(fs == \"true\");\r\n setAllowLoadFromServer(true);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if ((searchFilter.term.length > 0 || !fromServer) && page > 0) {\r\n getSearchResult();\r\n }\r\n }, [page, open]);\r\n\r\n const getSearchResult = (pos) => {\r\n if (open && !loading) {\r\n setError(null);\r\n let curPage = pos != 0 ? page : pos;\r\n let term = searchFilter.term.length > 0 ? searchFilter.term : \"NOTERM\";\r\n setLoading(true);\r\n apiFetch({\r\n path:\r\n \"/i2-azon/v1/search/\" +\r\n term +\r\n \"?si=\" +\r\n searchFilter.categoryId +\r\n \"&page=\" +\r\n curPage +\r\n // \"&rating=\" +\r\n // searchFilter.rating +\r\n // \"&minPrice=\" +\r\n // searchFilter.minPrice * 100 +\r\n // \"&maxPrice=\" +\r\n // searchFilter.maxPrice * 100 +\r\n // \"&minSavingPercent=\" +\r\n // searchFilter.minSavingPercent +\r\n \"&sortBy=\" +\r\n searchFilter.sortBy +\r\n \"&sourceRemote=\" +\r\n fromServer,\r\n }).then((data) => {\r\n // console.log(data);\r\n if (has(data, \"Errors\")) {\r\n // console.log(get(data, \"Errors[0].Message\"));\r\n setError(get(data, \"Errors[0].Message\"));\r\n setData(null);\r\n setLoading(false);\r\n } else {\r\n if (categories.length < 2) {\r\n let bins = get(\r\n data,\r\n \"SearchResult.SearchRefinements.SearchIndex.Bins\",\r\n []\r\n );\r\n let forCategory = [{ value: \"all\", label: \"All Category\" }];\r\n if (bins.length > 0) {\r\n bins.map((item) =>\r\n forCategory.push({\r\n value: item.Id,\r\n label: item.DisplayName,\r\n })\r\n );\r\n setCategories(forCategory);\r\n }\r\n }\r\n // console.log('SearchResult.TotalResultCount');\r\n // console.log(get(data,'SearchResult.TotalResultCount', 0));\r\n let resutlCount = get(data, \"SearchResult.TotalResultCount\", 0);\r\n resetPageCount(resutlCount);\r\n setData(data);\r\n // console.log(\"data loaded\");\r\n // console.log(data);\r\n // loading = false\r\n if(resutlCount == 0){\r\n if(!fromServer && searchFilter.term.length > 0){\r\n setError(__('No result found, search on amazon ', 'themesfirst'));\r\n setHasLink(true)\r\n }else{\r\n setError(__('No result found', 'themesfirst'));\r\n }\r\n }\r\n setLoading(false);\r\n }\r\n });\r\n }\r\n };\r\n\r\n const resetPageCount = (val) => {\r\n if (val >= 100) {\r\n setPageCount(10);\r\n } else {\r\n setPageCount(val > 10 ? parseInt(val / 10) + (val % 10 > 0 ? 1 : 0) : 0);\r\n }\r\n };\r\n\r\n const changePage = (val) => {\r\n //\tpage = page + val;\r\n if (page == 1 && val == 1) {\r\n setPage(0);\r\n getSearchResult(0);\r\n } else {\r\n setPage(val - 1);\r\n }\r\n };\r\n const startSearch = () => {\r\n if (page > 0) {\r\n setPage(0);\r\n }\r\n getSearchResult(0);\r\n };\r\n // After Finalize the function\r\n const updateAsin = (action, asin, title = '') => {\r\n\t \r\n\t\tif(isFormater){\r\n\r\n\t\t\tif(formaterProps.value.start == formaterProps.value.end){\r\n\t\t\t\tconst toInsert = applyFormat(\r\n\t\t\t\t\tcreate( { text: title + \" \"} ),\r\n\t\t\t\t\t{ type: \"themesfirst/amazonlinkformat\",\r\n\t\t\t\t\t\t\t\tattributes: { href: AmazonAffiliateLink(asin), target : openNewWindow ? \"_blank\" : \"_self\", rel : \"nofollow noopener noreferrer\" }, \r\n\t\t\t\t\t },\r\n\t\t\t\t\t0,\r\n\t\t\t\t\ttitle.length\r\n\t\t\t\t);\r\n\t\t\t\tformaterProps.onChange( insert( formaterProps.value, toInsert ))\r\n\t\t\t}else{\r\n\t\t\tformaterProps.onChange( \r\n\t\t\t\tapplyFormat(\r\n\t\t\t\t\tformaterProps.value, \r\n\t\t\t\t\t\t\t{ type: \"themesfirst/amazonlinkformat\",\r\n\t\t\t\t\t\t\t\tattributes: { href: AmazonAffiliateLink(asin), target : openNewWindow ? \"_blank\" : \"_self\" , rel : \"nofollow noopener noreferrer\" }, \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\t\tsetOpen(false) \r\n\r\n\t\t}else{\r\n if (action == \"add\") {\r\n if (!isSingle) {\r\n updateValue({ item_ids: [...item_ids, asin] });\r\n } else {\r\n updateValue({ item_ids: [asin] });\r\n }\r\n } else if(action == \"delete\") {\r\n removeItem(asin);\r\n }else {\r\n remove(item_ids, function (x) {\r\n return isEqual(x, asin);\r\n });\r\n updateValue({ item_ids: [...item_ids] });\r\n }\r\n\t\t//console.log(action, asin);\r\n\t\t}\r\n };\r\n // const removeProduct = (asin) => {\r\n // console.log(\"request for remove ... \" + asin);\r\n // const obj = [...products];\r\n // let pIndex = findIndex(obj, { asin: asin });\r\n // if (pIndex > -1) {\r\n // obj.splice(pIndex, 1);\r\n // updateValue({ products: obj });\r\n // }\r\n // };\r\n\r\n // new working changs\r\n // =====================================================================================================//\r\n\r\n const updateProducts = () => {\r\n let product_asin = map(products, \"asin\");\r\n const product_to_remove = difference(product_asin, item_ids);\r\n const product_to_load = difference(item_ids, product_asin);\r\n\r\n if (product_to_remove.length > 0) {\r\n // console.log(\"=============\");\r\n // console.log(\"product to remove : \");\r\n // console.log(product_to_remove);\r\n // console.log(\"=============\");\r\n let newProds = dropWhile(products, function (x) {\r\n return includes(product_to_remove, x.asin);\r\n });\r\n // console.log(newProds);\r\n updateValue({ products: newProds });\r\n }\r\n if (product_to_load.length > 0) {\r\n // console.log(\"=============\");\r\n // console.log(\"goin to fetch : \");\r\n // console.log(product_to_load);\r\n // console.log(\"=============\");\r\n fetchContent(product_to_load.join(\",\"));\r\n }\r\n };\r\n\r\n const fetchContent = (asins) => {\r\n apiFetch({ path: \"/i2-azon/v1/contents/\" + asins }).then((items) => {\r\n if (items != null) {\r\n var newProd = isSingle ? [] : [...products];\r\n\r\n items.map((obj) => {\r\n var item = obj;\r\n item.active_image_Index = 0;\r\n var images = JSON.parse(obj.image_ids);\r\n if (images.length > 0) {\r\n // item.images = images;\r\n delete item.image_ids;\r\n item.image = images[0];\r\n }\r\n newProd.push(item);\r\n });\r\n\r\n // console.log(newProd);\r\n updateValue({ products: newProd });\r\n }\r\n });\r\n };\r\n\r\n const removeItem = (asin) => {\r\n apiFetch({ path: \"/i2-azon/v1/delete/\" + asin }).then((data) => {\r\n // console.log(data);\r\n if(data == 1){\r\n remove(item_ids, function (x) {\r\n return isEqual(x, asin);\r\n });\r\n updateValue({ item_ids: [...item_ids] });\r\n getSearchResult(page);\r\n\r\n }else{\r\n setError(__('Error on removing product, please try again','themefirst'));\r\n }\r\n\r\n // if (items != null) {\r\n // var newProd = isSingle ? [] : [...products];\r\n\r\n // items.map((obj) => {\r\n // var item = obj;\r\n // item.active_image_Index = 0;\r\n // var images = JSON.parse(obj.image_ids);\r\n // if (images.length > 0) {\r\n // item.images = images;\r\n // item.image = images[0];\r\n // }\r\n // newProd.push(item);\r\n // });\r\n\r\n // console.log(newProd);\r\n // updateValue({ products: newProd });\r\n // }\r\n });\r\n };\r\n // end new changes\r\n const updateServer = (val) => {\r\n localStorage.setItem(\"fromServer\", val);\r\n setData(null);\r\n setFromServer(val);\r\n };\r\n\r\n return (\r\n <>\r\n\t\t {isFormater ? \r\n\t\t\t<>\r\n\t\t\t<RichTextToolbarButton \r\n\t\t\t icon= {formaterProps.isActive? 'editor-unlink' : 'admin-links'}\r\n\t\t\t// icon= {smileIcon}\t\t\t \r\n\t\t\t title={__('Amazon link', 'themesfirst')}\r\n onClick={ () => { \r\n\t\t\t\t formaterProps.isActive ? \r\n\t\t\t\t formaterProps.onChange( toggleFormat(\r\n\t\t\t\t\tformaterProps.value,\r\n\t\t\t\t\t{ type: 'themesfirst/amazonlinkformat' } ))\r\n\t\t\t\t : \r\n\t\t\t\t\t\tsetOpen(true) } \r\n\t\t\t\t\t}\r\n\t\t\t\tgroup=\"primary\"\r\n isActive={ formaterProps.isActive }\r\n /> </> : \r\n <Flex>\r\n <span> \r\n <Button variant=\"outlined\" isPrimary onClick={(obj) => setOpen(true)}>\r\n {__(\"Search Products\", \"themesfirst\")}\r\n </Button>\r\n </span>\r\n\t\t\t\t{item_ids.length > 0 &&\r\n <Button\r\n icon=\"image-rotate\"\r\n isSecondary\r\n size=\"24\"\r\n\t\t\t\t\tisBusy={loading}\t\t\t\t\t\r\n variant=\"outlined\"\r\n onClick={updateProducts}\r\n disabled={difference(item_ids, map(products, \"asin\")).length == 0}\r\n ></Button>}\r\n </Flex> }\r\n {open && (\r\n <Modal\r\n open={open}\r\n title={__(\"Search Products\", \"themesfirst\")}\r\n onRequestClose={() => setOpen(false)}\r\n aria-labelledby=\"form-dialog-title\"\r\n style={{width: '90%', maxWidth: '1080px'}}\r\n >\r\n <figure style={{ minHeight: \"400px\" }}>\r\n <Flex className=\"tf-top-pagination-wrapper\">\r\n <FlexItem>\r\n <Flex>\r\n <FlexItem>\r\n <ToggleControl\r\n label=\"Use API?\"\r\n help={fromServer ? __('Active Server Amazon API', 'themesfirst') : __('Active Server Local DB', 'themesfirst')}\r\n checked={fromServer}\r\n onChange={() => updateServer(!fromServer)}\r\n />\r\n </FlexItem>\r\n {isFormater && <FlexItem>\r\n <ToggleControl\r\n label=\"Open link in new tab?\"\r\n help={openNewWindow ? __('link will open in new tab', 'themesfirst') : __('link will open in same tab', 'themesfirst')}\r\n checked={openNewWindow}\r\n onChange={() => setOpenNewWindow(!openNewWindow)}\r\n />\r\n </FlexItem>}\r\n </Flex>\r\n \r\n \r\n </FlexItem> \r\n\t\t\t\t\t\t\t{pageCount > 1 &&\t<ButtonGroup style={{marginLeft:\"auto\"}}>\r\n\t\t\t\t\t\t\t {page > 0 &&\t<Button onClick={()=> changePage(page)} icon=\"arrow-left-alt2\">{__('Prev', 'themesfirst')}</Button>}\r\n\t\t\t\t\t\t\t\t<Button isPrimary disabled={true} icon=\"editor-kitchensink\" > {page + 1} {__('of', 'themesfirst')} {pageCount}</Button>\r\n\t\t\t\t\t\t\t {page < pageCount - 1 &&\t<Button onClick={()=> changePage(page + 2)} icon=\"arrow-right-alt2\" iconPosition=\"right\">{__('Next', 'themesfirst')}</Button>}\r\n\t\t\t\t\t\t\t</ButtonGroup>}\r\n {/* <FlexBlock style={{ marginLeft: \"auto\" }}>\r\n\r\n {pageCount > 1 && (\r\n <Pagination\r\n count={pageCount}\r\n className={\"MuiPagination-ul\"}\r\n disabled={loading}\r\n color=\"primary\"\r\n page={page + 1}\r\n onChange={(obj, pos) => changePage(pos)}\r\n />\r\n )}\r\n </FlexBlock> */}\r\n </Flex>\r\n {loading && (\r\n <Flex justify=\"center\">\r\n <FlexBlock style={{ minHeight: \"50px\", textAlign: \"center\" }}>\r\n <Spinner />\r\n </FlexBlock>\r\n </Flex>\r\n )}\r\n {error && (\r\n <Notice status=\"error\" onRemove={() => {setError(null), setHasLink(null)}}>\r\n {error} {hasLink && <ExternalLink href={AmazonSearchLink(searchFilter.term)}>{searchFilter.term}</ExternalLink>}\r\n </Notice>\r\n )}\r\n\r\n <div style={{ marginTop: \"15px\", marginBottom: \"15px\" }}>\r\n {/* <div className=\"tf-sub-title\">\r\n <h4>{__('Search the product which you want to publish on the website', 'themesfirst')}</h4>\r\n </div> */}\r\n <Flex className=\"tf-flex-sf-container\">\r\n <FlexItem>\r\n <TextControl\r\n label={__(\"Search Terms\", \"themesfirst\")}\r\n value={searchFilter.term}\r\n onChange={(obj) =>\r\n setSearchFilter({ ...searchFilter, term: obj })\r\n }\r\n />\r\n </FlexItem>\r\n <FlexItem>\r\n {fromServer && (\r\n <SelectControl\r\n label={__(\"Sort By\", \"themesfirst\")}\r\n value={searchFilter.sortBy}\r\n onChange={(obj) => {\r\n setSearchFilter({ ...searchFilter, sortBy: obj });\r\n }}\r\n options={SortFilter}\r\n />\r\n )}\r\n </FlexItem>\r\n <FlexItem>\r\n <Button\r\n icon=\"search\"\r\n isBusy={loading}\r\n className=\"tf-full-button\"\r\n style={{ marginBottom: \"8px\" }}\r\n disabled={fromServer && searchFilter.term.length < 3}\r\n isPrimary\r\n onClick={() => startSearch()}\r\n >\r\n {__(\"Search\", \"themesfirst\")}\r\n </Button>\r\n </FlexItem>\r\n </Flex>\r\n </div>\r\n\r\n {data &&\r\n data.SearchResult.Items.length > 0 &&\r\n chunk(data.SearchResult.Items, 3).map((items) => {\r\n return (\r\n <Flex justify=\"center\" style={{ marginBottom: \"10px\" }}>\r\n {items.map((item) => (\r\n <FlexItem\r\n style={{ maxWidth: \"33%\", alignSelf: \"flex-start\" }}\r\n >\r\n {fromServer ? (\r\n <Card className=\"tf-card\">\r\n {item_ids.indexOf(get(item, \"ASIN\")) == -1 ? (\r\n <Button\r\n icon=\"plus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"add\", get(item, \"ASIN\"), get(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ItemInfo.Title.DisplayValue\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"No Title\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t))\r\n }\r\n className=\"tf-card-button tf-button-add\"\r\n ></Button>\r\n ) : (\r\n <Button\r\n icon=\"minus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"remove\", get(item, \"ASIN\"))\r\n }\r\n className=\"tf-card-button tf-button-minus\"\r\n ></Button>\r\n )}\r\n <CardMedia className=\"tf-card-image\">\r\n <img\r\n src={get(item, \"Images.Primary.Large.URL\", \"#\")}\r\n />\r\n </CardMedia>\r\n <CardBody size=\"small\">\r\n <strong style={{marginTop:0, display: 'block'}}>ASIN : \r\n {\r\n get(item, 'ASIN', 'no asin')\r\n }</strong>\r\n {get(\r\n item,\r\n \"ItemInfo.Title.DisplayValue\",\r\n \"No Title\"\r\n )}\r\n <CardDivider className=\"tf-card-devider\" />\r\n {\r\n first(item.BrowseNodeInfo.BrowseNodes)\r\n .ContextFreeName\r\n }\r\n </CardBody>\r\n <CardFooter size=\"small\">\r\n <FlexItem>\r\n {has(\r\n item,\r\n \"Offers.Listings[0].SavingBasis.DisplayAmount\"\r\n ) ? (\r\n <span>\r\n <s>\r\n {get(\r\n item,\r\n \"Offers.Listings[0].SavingBasis.DisplayAmount\"\r\n )}\r\n </s>{\" \"}\r\n {\" \"}\r\n </span>\r\n ) : (\r\n \"\"\r\n )}\r\n <b>\r\n {get(\r\n item,\r\n \"Offers.Listings[0].Price.DisplayAmount\",\r\n \"No Price\"\r\n )}\r\n </b>\r\n </FlexItem>\r\n <FlexItem style={{ marginLeft: \"auto\" }}>\r\n <ExternalLink\r\n href={get(item, \"DetailPageURL\")}\r\n ></ExternalLink>\r\n </FlexItem>\r\n </CardFooter>\r\n </Card>\r\n ) : (\r\n <Card className=\"tf-card\">\r\n {item_ids.indexOf(get(item, \"asin\")) == -1 ? (\r\n <Button\r\n icon=\"plus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"add\", get(item, \"asin\"), get(item, \"title\", ''))\r\n }\r\n className=\"tf-card-button tf-button-add\"\r\n ></Button>\r\n ) : (\r\n <Button\r\n icon=\"minus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"remove\", get(item, \"asin\"))\r\n }\r\n className=\"tf-card-button tf-button-minus\"\r\n ></Button>\r\n )}\r\n <Button\r\n icon=\"trash\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"delete\", get(item, \"asin\"))\r\n }\r\n className=\"tf-card-button tf-button-minus tf-button-trash\"\r\n ></Button>\r\n <CardMedia className=\"tf-card-image\">\r\n <AmzonImg\r\n imageUrl={AmazonSelectImg(\r\n get(item, \"image_ids\", \"#\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\text={AmazonSelectExt(\r\n get(item, \"image_ids\", \"#\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n ></AmzonImg>\r\n </CardMedia>\r\n <CardBody size=\"small\">\r\n <strong style={{marginTop:0, display: 'block'}}>ASIN : \r\n {\r\n get(item, 'asin', 'no asin')\r\n }</strong>\r\n {get(item, \"title\", \"No Title\")}\r\n </CardBody>\r\n <CardFooter size=\"small\">\r\n <FlexItem>\r\n {has(item, \"saving\") ? \r\n <span>\r\n <s>{get(item, \"saving\")}</s> {\" \"}\r\n </span>\r\n : \"\"\r\n }\r\n <b>{get(item, \"display_price\", __('No Price', 'themesfirst'))}</b>\r\n </FlexItem>\r\n <FlexItem style={{ marginLeft: \"auto\" }}>\r\n <ExternalLink\r\n href={AmazonLink(get(item, \"asin\"))}\r\n ></ExternalLink>\r\n </FlexItem>\r\n </CardFooter>\r\n </Card>\r\n )}\r\n </FlexItem>\r\n ))}\r\n </Flex>\r\n );\r\n })}\r\n </figure>\r\n </Modal>\r\n )}\r\n </>\r\n );\r\n};\r\n","import {MZSearchDialog} from '../component/azsearch/azsearch' \r\nconst { registerFormatType } = wp.richText;\r\nconst { __ } = wp.i18n;\r\n \r\nconst AmzLinkButton = ( props ) => {\r\n // console.log(props);\r\n return <MZSearchDialog isFormater={true} formaterProps={props} item_ids={[]} />\r\n};\r\n \r\nregisterFormatType(\r\n 'themesfirst/amazonlinkformat', {\r\n title: __('Amazon link (i2-azon)', 'themesfirst'),\r\n tagName: 'a',\r\n className: 'i2-azon-amazon-link',\r\n edit: AmzLinkButton,\r\n }\r\n);","import { ExitToAppOutlined } from \"@material-ui/icons\";\r\n\r\nconst { __ } = wp.i18n;\r\nexport const SLTypeOfInput = [\r\n { label: __('Text'), value: 'SLN' },\r\n // { label: __('Multi line'), value: 'MLN' },\r\n { label: __('Number'), value: 'NBR' },\r\n // { label: __('Link'), value: 'LNK' },\r\n { label: __('Button'), value: 'BTN' },\r\n { label: __('Yes/No'), value: 'YRN' },\r\n { label: __('Image'), value: 'IMG' },\r\n { label: __('Rating'), value: 'RTG' },\r\n // { label: __('Block'), value: 'BLK' }\r\n]\r\nexport const SLDefaultClasses = [\r\n { label: __('Link'), value: 'tftxtlink' },\r\n { label: __('Flat'), value: 'tfflatlink' },\r\n { label: __('3D'), value: 'tf3dlink' },\r\n { label: __('Amazon'), value: 'tfamazonlink' },\r\n { label: __('Custom'), value: '' }\r\n]\r\n\r\nexport const PreSetColors = [\r\n\t{ name: 'Red', color: '#d9534f' },\r\n\t{ name: 'Green', color: '#27ae60' },\r\n\t{ name: 'Blue', color: '#256aaf' },\r\n\t{ name: 'Brown', color: '#e47911' },\r\n\t{ name: 'Black', color: '#231f20'},\r\n];\r\n\r\nexport const FeaturesDefaults = [\r\n\t{ id: 'productHighlighter', visiable: false, show_label: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'images', visiable: true, show_label: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'title', visiable: true, show_label: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'asin', visiable: false, show_label: true, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'rating', visiable: true, show_label: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'reviews', visiable: true, show_label: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'manufacturer', visiable: true, show_label: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'brand', visiable: true, show_label: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'model', visiable: false, show_label: true, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'product_group', visiable: false, show_label: true, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'is_amazon_fulfilled', visiable: false, show_label: true, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'is_prime_eligible', visiable: true, show_label: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'display_price', visiable: true, show_label: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'saving_amount', visiable: false,show_label: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'button', visiable: true, show_label: true, label: __('Button', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" }\r\n]\r\n\r\nexport const FeaturesHorizontalDefaults = [\r\n\t{ id: 'productHighlighter', visiable: false, show_label: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, width: '0%', use_class:\"\" },\r\n\t{ id: 'images', visiable: true, show_label: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, width: '20%', use_class:\"\" },\r\n\t{ id: 'title', visiable: true, show_label: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, width: 'auto', use_class:\"\" },\r\n\t{ id: 'asin', visiable: false, show_label: true, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'display_price', visiable: true, show_label: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'saving_amount', visiable: false, show_label: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'button', visiable: true, show_label: true, label: __('Button', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, width: '15%', use_class:\"tf-amazon-link\" }\r\n]\r\n\r\nexport const ImageSizePx = [\r\n//\t{ value: 0, label: '0px'},\r\n\t{ value: 75, label: 'S'},\r\n\t{ value: 160, label: 'M'},\r\n\t{ value: 500, label: 'L'},\r\n//\t{ value: 1920, label: '1920px'}\r\n]\r\nexport const ImageSizePercent = [\r\n\t{ value: 0, label: '0%'},\r\n\t{ value: 25, label: '25%'},\r\n\t{ value: 50, label: '50%'},\r\n\t{ value: 75, label: '75%'},\r\n\t{ value: 100, label: '100%'}\r\n]\r\n\r\nexport const SLButtonStyle = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-btn-amazon', label : __('Amazon', 'themes-first')},\r\n\t{value : 'tf-btn-rounded', label : __('Rounded', 'themes-first')},\r\n\t{value : 'tf-btn-3d', label : __('3D', 'themes-first')},\r\n\t{value : 'tf-btn-link', label : __('Link', 'themes-first')},\r\n]\r\n\r\nexport const SLSize = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-size-small', label : __('Small', 'themes-first')},\r\n\t{value : 'tf-size-medium', label : __('Medium', 'themes-first')},\r\n\t{value : 'tf-size-big', label : __('Big', 'themes-first')},\r\n\t{value : 'tf-size-larg', label : __('Larg', 'themes-first')}, \r\n]\r\nexport const SLAlignment = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-al-middle', label : __('Middle', 'themes-first')}, \r\n\t{value : 'tf-al-top', label : __('Top', 'themes-first')}, \r\n\t{value : 'tf-al-bottom', label : __('Bottom', 'themes-first')}, \r\n\t{value : 'tf-al-right', label : __('Right', 'themes-first')}, \r\n\t{value : 'tf-al-left', label : __('Left', 'themes-first')}, \r\n]\r\nexport const SLIconFonts = [\r\n\t'icofont-amazon', 'icofont-amazon-alt', 'icofont-brand-amazon', 'icofont-opencart',\r\n\t'icofont-shopping-cart','icofont-cart','icofont-cart-alt','icofont-ui-cart',\r\n\t'icofont-brand-ebay','icofont-google-wallet','icofont-google-wallet-alt-3','icofont-virtuemart',\r\n\t'icofont-brand-walmart'\r\n]\r\n\r\nexport const InnerBlockList = {\r\n\tAZIMG \t: 'themesfirst/ib-i2-azone-image',\r\n\tSLN\t\t: 'themesfirst/ib-i2-azone-text',\r\n\tAZRTG \t: 'themesfirst/ib-i2-azone-rating',\r\n\tAZBTN \t: 'themesfirst/ib-i2-azone-button',\r\n\tYRN \t: 'themesfirst/ib-i2-azone-yesno',\r\n\tAZPRC\t: 'themesfirst/ib-i2-azone-text',\r\n};\r\n\r\nexport const FontSizeList = [\r\n\t{\r\n\t\tname: __( 'Small' ),\r\n\t\tslug: 'small',\r\n\t\tsize: 12,\r\n\t},\r\n\t{\r\n\t\tname: __( 'Medium' ),\r\n\t\tslug: 'medium',\r\n\t\tsize: 18,\r\n\t}, \r\n\t{\r\n\t\tname: __( 'Larg' ),\r\n\t\tslug: 'larg',\r\n\t\tsize: 24,\r\n\t}, \r\n\t{\r\n\t\tname: __( 'Extra' ),\r\n\t\tslug: 'extra',\r\n\t\tsize: 36,\r\n\t}\r\n];\r\n\r\n\r\n// export const FeaturesHorizontalDefaults = {\r\n// \t'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '0%' },\r\n// \t'image' : { visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: '20%' },\r\n// \t'title' : { visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: 'auto' },\r\n// \t'display_price' : { visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '15%' },\r\n// \t'saving_amount' : { visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '15%' },\r\n// \t'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: '15%' }\r\n// }\r\n\r\n// export const FeaturesDefaults = {\r\n// \t'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'image': {visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'title' : {visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'asin' : {visiable: false, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'rating' : {visiable: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: ''},\r\n// \t'reviews' : {visiable: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'manufacturer' : {visiable: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'brand' : {visiable: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'model' : {visiable: false, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'product_group' : {visiable: false, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'is_amazon_fulfilled' : {visiable: false, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'is_prime_eligible' : {visiable: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'display_price' : {visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'saving_amount' : {visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }\r\n// }\r\n\r\n\r\n// var users = [\r\n// \t{'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'image': {visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'title' : {visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'asin' : {visiable: false, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'rating' : {visiable: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: ''}},\r\n// \t{'reviews' : {visiable: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'manufacturer' : {visiable: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'brand' : {visiable: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'model' : {visiable: false, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'product_group' : {visiable: false, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'is_amazon_fulfilled' : {visiable: false, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'is_prime_eligible' : {visiable: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'display_price' : {visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'saving_amount' : {visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }}\r\n// ]\r\n","import { AmzonImg } from './common'\r\nimport classnames from 'classnames';\r\n\r\nconst { chunk } = lodash;\r\nconst { Flex, FlexItem,FlexBlock, Button, Modal, Spinner } = wp.components;\r\nconst { useState, useEffect } = wp.element;\r\nconst { __ } = wp.i18n;\r\nconst { apiFetch } = wp;\r\n\r\nexport const MdlImagePickerNew = ({ image, prodPos, updateImages, asin, size} = props) => {\r\n const [open, setOpen] = useState(false);\r\n const [loading, setLoading] = useState(false);\r\n const [images, setImages] = useState([]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n setLoading(true);\r\n apiFetch({ path: \"/i2-azon/v1/images/\" + asin })\r\n .then((data) => {\r\n setImages(JSON.parse(data));\r\n setLoading(false);\r\n });\r\n }\r\n }, [open]);\r\n\r\n return (<figure>\r\n <figure style={{ position: \"relative\" }} >\r\n <Button icon=\"images-alt2\" isPrimary size=\"24\" aria-label=\"remove\" onClick={() => setOpen(true)} style={{ position: \"absolute\", top: '15px', left: '15px' }}></Button>\r\n {image && <AmzonImg imageUrl={image.URL} ext={image.EXT? image.EXT : \"jpg\"} size={size}></AmzonImg>}\r\n </figure>\r\n { open ?\r\n <Modal open={open} title={__(\"Select Image\", 'themesfirst')} onRequestClose={obj => setOpen(false)} aria-labelledby=\"form-dialog-title\">\r\n <div style={{ minHeight: '400px' }}>\r\n {loading && <Flex justify=\"center\"><FlexBlock style={{minHeight:'100px', textAlign:'center'}}><Spinner /></FlexBlock></Flex>}\r\n {images.length > 0 && chunk(images, 3).map((imgs) => {\r\n return <Flex justify=\"center\">\r\n {imgs.map((img) => <FlexItem style={{ maxWidth: '33%' }}>\r\n <AmzonImg\r\n onClick={() => updateImages(prodPos, img)}\r\n className={ classnames('tf-mdl-image', {'tf-mdl-image-active': image && img.URL == image.URL })}\r\n imageUrl={img.URL} size=\"400\" \r\n\t\t\t\t\t\t\t\t\text={img.EXT? img.EXT : \"jpg\"}/>\r\n </FlexItem>\r\n )}\r\n </Flex>\r\n }\r\n )}\r\n\r\n </div>\r\n </Modal> : null}\r\n </figure>)\r\n}\r\n","const { Flex, FlexItem, FlexBlock, RangeControl, Button, ButtonGroup} = wp.components;\r\nconst { __ } = wp.i18n;\r\n\r\nexport const WidthSize = ({field, onChange} = props)=>{\r\n \r\n const {size, unit} = field;\r\n const maxVal = () =>{\r\n return unit == \"%\" ? 100 : 500;\r\n\t\t }\r\n\t\t const minVal = () =>{\r\n\t\t\treturn unit == \"%\" ? 5 : 50;\r\n\t }\r\n return (\r\n <>\r\n <Flex>\r\n\t\t\t\t\t<FlexItem>{__('Width', 'themesfirst')}</FlexItem>\r\n\t\t\t\t\t<FlexBlock className=\"tf-text-align-end\">\r\n\t\t\t\t\t<ButtonGroup size=\"small\" aria-label=\"small outlined button group\" style={{marginLeft:\"auto\"}}>\r\n\t\t\t\t\t\t<Button onClick={()=> onChange({...field, unit : '%', size : 60 })} isPrimary={unit == \"%\"} isSmall>%</Button>\r\n\t\t\t\t\t\t<Button onClick={()=> onChange({...field, unit : 'px', size: 300})} isPrimary={unit != \"%\"} isSmall>px</Button>\r\n\t\t\t\t\t</ButtonGroup>\r\n\t\t\t\t\t</FlexBlock>\r\n </Flex> \r\n\t\t\t\t<Flex>\r\n\t\t\t\t\t<FlexBlock>\r\n\t\t\t\t\t\t<RangeControl\r\n\t\t\t\t\t\tlabel={ size + unit} \r\n\t\t\t\t\t\twithInputField = {true}\r\n\t\t\t\t\t\tvalue={ size }\r\n\t\t\t\t\t\tonChange={ ( obj ) => onChange({...field, size : obj})}\r\n\t\t\t\t\t\tmin={ minVal() }\t\r\n\t\t\t\t\t\tstep ={1}\t\t\t\r\n\t\t\t\t\t\tmax={maxVal()} \r\n\t\t\t\t\t/>\r\n\t\t</FlexBlock>\r\n\t\t\t\t</Flex>\r\n </>\r\n );\r\n\r\n}","import { AmzonImgURL, MyBlockWrapper } from '../../component/common'\r\nimport { MZSearchDialog } from '../../component/azsearch/azsearch'\r\nimport {FontSizeList } from '../../component/data'\r\nimport { MdlImagePickerNew } from '../../component/MdlImagePicker'\r\nimport { WidthSize } from '../../component/fields/widthSize'\r\n\r\n\r\nconst { __ } = wp.i18n;\r\nconst { registerBlockType } = wp.blocks;\r\nconst { Button, FontSizePicker, TextControl, ToggleControl, PanelBody } = wp.components;\r\nconst { InspectorControls, MediaUpload, MediaUploadCheck, RichText, PanelColorSettings } = wp.blockEditor;\r\nconst { useEffect, useState } = wp.element\r\nconst { has} = lodash\r\n\r\nregisterBlockType('themesfirst/i2-azon-image', {\r\n title: __('Image i2AZON', 'themesfirst'),\r\n icon: 'format-image',\r\n category: 'themesfirst',\r\n keywords: [\r\n __('Image', 'themesfirst'),\r\n __('Amazon Image', 'themesfirst'),\r\n __('i2 azon', 'themesfirst'),\r\n ],\r\n attributes: {\r\n item_ids: {\r\n type: 'array',\r\n default: []\r\n },\r\n products: {\r\n type: 'array',\r\n default: []\r\n },\r\n block_id: {\r\n type: 'string',\r\n default: ''\r\n },\r\n link: {\r\n type: 'string',\r\n default: ''\r\n },\r\n alt_text: {\r\n type: 'string',\r\n default: ''\r\n },\r\n text: {\r\n type: 'string',\r\n default: __('CLICK HERE', 'themesfirst')\r\n },\r\n showText: {\r\n type: 'boolean',\r\n default: true\r\n },\r\n textOnTop: {\r\n type: 'boolean',\r\n default: false\r\n },\r\n useBorder: {\r\n type: 'boolean',\r\n default: false\r\n },\r\n borderColor: {\r\n default: '#231f20'\r\n },\r\n paddingSize: {\r\n type: 'string',\r\n },\r\n fontSize: {\r\n type: 'number',\r\n default: 18\r\n },\r\n color: {\r\n default: '#ffffff'\r\n },\r\n bgColor: {\r\n default: '#231f20'\r\n },\r\n useLink: {\r\n type: 'boolean',\r\n default: true\r\n },\r\n customLink: {\r\n type: 'string',\r\n default: ''\r\n },\r\n width: {\r\n type: 'object',\r\n default: {\r\n size: 400,\r\n unit: 'px',\r\n full: 780\r\n }\r\n },\r\n },\r\n supports: {\r\n align: true\r\n },\r\n edit: (props) => {\r\n // console.log(\"==================================\");\r\n //console.log(props);\r\n\r\n const { attributes, clientId, attributes: { item_ids, width, block_id, useLink, customLink,alt_text, paddingSize, useBorder, borderColor, active_image_index, products, custom_img, link, text, color, bgColor, fontSize, showText, textOnTop }, setAttributes } = props;\r\n\r\n if (block_id == '' || block_id == undefined) {\r\n setAttributes({ block_id: clientId });\r\n }\r\n\r\n const [colors, setColors] = useState([\r\n {\r\n value: bgColor,\r\n onChange: (colorValue) => setAttributes({ bgColor: colorValue }),\r\n label: __('Background Color', 'themesfirst'),\r\n },\r\n {\r\n value: color,\r\n onChange: (colorValue) => setAttributes({ color: colorValue }),\r\n label: __('Text Color', 'themesfirst'),\r\n }\r\n ]);\r\n\r\n useEffect(() => {\r\n\r\n if (!useBorder && colors.length > 2) {\r\n\r\n colors.pop();\r\n setColors([...colors]);\r\n\r\n } else if (useBorder && colors.length == 2) {\r\n\r\n colors.push(\r\n {\r\n value: borderColor,\r\n onChange: (colorValue) => setAttributes({ borderColor: colorValue }),\r\n label: __('Border Color', 'themesfirst')\r\n }\r\n );\r\n setColors([...colors]);\r\n }\r\n }\r\n , [useBorder]);\r\n\r\n const updateData = (obj) => {\r\n if (has(obj, 'item_ids')) {\r\n setAttributes(obj)\r\n } else {\r\n if (obj.products.length == 1) {\r\n setAttributes({ products: [{ asin: obj.products[0].asin, title:obj.products[0].title, image: obj.products[0].image }] });\r\n if(alt_text == ''){\r\n let text = obj.products[0].title;\r\n if(text.length > 70){\r\n let i = text.lastIndexOf(' ',70);\r\n text = text.substring(0, i);\r\n }\r\n setAttributes({alt_text : text}); \r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n const updateImages = (prodPos, image) => {\r\n\r\n const obj = [...products];\r\n obj[prodPos]['image'] = image;\r\n setAttributes({ products: obj })\r\n\r\n }\r\n const updateCustomImage = (pos, val) => {\r\n // console.log(pos)\r\n // console.log(val)\r\n const obj = [...products];\r\n //console.log(obj[pos]);\r\n //\tobj[pos]['mytest'] = val;\r\n\r\n obj[pos]['custom_img'] = val;\r\n //\tconsole.log(obj[pos]);\r\n // obj[pos]['customImg'][\"mediaUrl\"] = val.mediaUrl;\r\n setAttributes({ products: obj })\r\n }\r\n const removeCustomImage = (pos) => {\r\n // console.log(\"inside custom\");\r\n if (has(products[pos], 'custom_img')) {\r\n const obj = [...products];\r\n delete obj[pos]['custom_img'];\r\n setAttributes({ products: obj });\r\n }\r\n }\r\n const logAttr = () => {\r\n // const allImages = wp.apiFetch({ path: \"/i2-azon/v1/search/my keyworeds\" })\r\n // .then((data)=>log(data));\r\n //log(features.filter(x=>x.visiable).map(x=> x.id));\r\n console.log(attributes);\r\n }\r\n\r\n const updateValue = (obj) => {\r\n setAttributes(obj);\r\n }\r\n\r\n return (<>\r\n <InspectorControls>\r\n <PanelBody title={__(\"Common\", 'themesfirst')}\r\n initialOpen={true} >\r\n {/* <Button onClick={logAttr} > Log Attr </Button> */}\r\n <MZSearchDialog item_ids={item_ids} products={products} updateValue={updateData} isSingle={true} />\r\n <hr />\r\n {item_ids.length > 0 && <h4>{__('ASIN', 'themesfirst')} : {item_ids[0]} </h4>}\r\n <WidthSize field={width} onChange={obj => setAttributes({ width: obj })} />\r\n <hr />\r\n <ToggleControl label={__(\"Use Link?\", 'themesfirst')}\r\n checked={useLink}\r\n onChange={() => setAttributes({ useLink: !useLink })}\r\n />\r\n {useLink && <> <TextControl\r\n label={__(\"Alt Text\", 'themesfirst')}\r\n help={__(\"Image alt text\", 'themesfirst')}\r\n value={alt_text}\r\n onChange={(val) => setAttributes({ alt_text: val })}\r\n />\r\n <TextControl\r\n label={__(\"URL (By default amazon link)\", 'themesfirst')}\r\n help={__(\"Optional (custom url should start with http)\", 'themesfirst')}\r\n value={customLink}\r\n onChange={(val) => setAttributes({ customLink: val })}\r\n />\r\n </>\r\n }\r\n <ToggleControl\r\n label=\"Show Text?\"\r\n checked={showText}\r\n onChange={() => setAttributes({ showText: !showText })}\r\n />\r\n {showText && <ToggleControl\r\n label=\"Text On Top?\"\r\n help={textOnTop ? 'Text on top.' : 'Text on bottom'}\r\n checked={textOnTop}\r\n onChange={() => setAttributes({ textOnTop: !textOnTop })}\r\n />}\r\n <ToggleControl label={__(\"Use Border?\", 'themesfirst')}\r\n checked={useBorder}\r\n onChange={() => setAttributes({ useBorder: !useBorder })}\r\n />\r\n </PanelBody>\r\n <PanelBody title={__(\"Font Size\", 'themesfirst')}\r\n initialOpen={false} >\r\n <FontSizePicker\r\n fontSizes={FontSizeList}\r\n value={fontSize}\r\n fallbackFontSize={18}\r\n withSlider={true}\r\n onChange={(newFontSize) => {\r\n setAttributes({ fontSize: newFontSize ? newFontSize : 18 });\r\n }}\r\n />\r\n </PanelBody>\r\n <PanelColorSettings\r\n title={__('Color Settings', 'themesfirst')}\r\n initialOpen={false}\r\n colorSettings={useBorder ? [\r\n {\r\n value: bgColor,\r\n onChange: (colorValue) => setAttributes({ bgColor: colorValue }),\r\n label: __('Background Color', 'themesfirst'),\r\n },\r\n {\r\n value: color,\r\n onChange: (colorValue) => setAttributes({ color: colorValue }),\r\n label: __('Text Color', 'themesfirst'),\r\n },\r\n {\r\n value: borderColor,\r\n onChange: (colorValue) => setAttributes({ borderColor: colorValue }),\r\n label: __('Border Color', 'themesfirst')\r\n }\r\n ] : [\r\n {\r\n value: bgColor,\r\n onChange: (colorValue) => setAttributes({ bgColor: colorValue }),\r\n label: __('Background Color', 'themesfirst'),\r\n },\r\n {\r\n value: color,\r\n onChange: (colorValue) => setAttributes({ color: colorValue }),\r\n label: __('Text Color', 'themesfirst'),\r\n }\r\n ]}\r\n >\r\n </PanelColorSettings>\r\n </InspectorControls>\r\n\r\n <figure className=\"tf-i2 tf-i2-azon-image mywp-block-image\" style={{ position: \"relative\", width: width.unit == '%a' ? \"100%\" : width.size + width.unit }}>\r\n <div className=\"components-resizable-box__container has-show-handle\" style={{ \"position\": \"relative\", \"boxSizing\": \"border-box\", \"width\": \"100%\" }}>\r\n {products.length == 0 && <MZSearchDialog item_ids={item_ids} products={products} updateValue={updateData} isSingle={true} />}\r\n {products.map((prod, j) => {\r\n return (<div className={(useBorder ? \"has-border \" : \"\") + \"tf-amz-image-wrapper\"} style={{ flexDirection: textOnTop ? \"column-reverse\" : \"column\", borderColor: borderColor }}>\r\n {!has(prod, 'custom_img.mediaId') && (\r\n <MdlImagePickerNew image={prod['image']} asin={prod['asin']} prodPos={j} updateImages={updateImages} size={width.unit != 'px' ? null : width.size} />)}\r\n <div className={prod['custom_img'] == undefined || prod['custom_img'] == \"\" ? \"no-custom-image\" : \"editor-post-featured-image\"}>\r\n {prod['custom_img'] != undefined && <img src={prod['custom_img'].mediaUrl} />}\r\n <MediaUploadCheck>\r\n <MediaUpload onSelect={obj => updateCustomImage(j, { mediaId: obj.id, mediaUrl: obj.url })}\r\n value={prod['custom_img'] != undefined && prod['custom_img'] != \"\" ? prod['custom_img'].mediaId : \"\"}\r\n allowedTypes={['image']}\r\n render={({ open }) => (\r\n <Button icon=\"wordpress\" isSecondary size=\"24\" className=\"no-custom-image\" onClick={open}>\r\n </Button>\r\n )}\r\n />\r\n </MediaUploadCheck>\r\n {has(prod, 'custom_img.mediaId') && <Button icon=\"trash\" className=\"clear-custom-image\" iconSize=\"24\" label=\"Delete\" onClick={() => removeCustomImage(j)}></Button>}\r\n </div>\r\n {showText && <div style={{ clear: 'both', marginTop: '0', backgroundColor: bgColor, color: color, textAlign: 'center' }}>\r\n <RichText onChange={obj => setAttributes({ text: obj })}\r\n tagName=\"p\"\r\n value={text}\r\n style={{ margin: 0, fontSize: fontSize + \"px\", lineHeight: (fontSize * 2) + \"px\" }}\r\n />\r\n </div>}\r\n </div>)\r\n })}\r\n </div>\r\n </figure>\r\n </>\r\n )\r\n },\r\n save: (props) => {\r\n const { attributes: { block_id, width, useLink,alt_text, text, bgColor, color, fontSize, useBorder, products, textOnTop, showText, borderColor }} = props;\r\n // console.log(props);\r\n return (products && products.length > 0 && <MyBlockWrapper isLink={useLink} elm=\"div\" id={`tf-block-image-${block_id}`} className={`tf-block-${block_id} tf-amz-image-block-wrapper`} href=\"##AFFILIATELINK##\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" style={{ width: width.size + width.unit}}>\r\n <div className={(useBorder ? \"has-border \" : \"\") + \"tf-amz-image-wrapper\"} style={{ flexDirection: textOnTop ? \"column-reverse\" : \"column\", borderColor: borderColor }}>\r\n <div className=\"tf-featured-media\">\r\n {products.length == 1 && !has(products[0], 'custom_img.mediaId') && <img src={AmzonImgURL(products[0]['image'].URL, width.unit == \"px\" && width.size <= products[0]['image'].Width ? width.size : \"\", products[0]['image'].EXT)} alt={alt_text} height={products[0]['image'].Height} width={products[0]['image'].Width} />}{products.length == 1 && has(products[0], 'custom_img.mediaId') && <img src={products[0]['custom_img']['mediaUrl']} alt={alt_text} />}</div>\r\n {showText && <div style={{ clear: 'both', marginTop: '0', backgroundColor: bgColor, textAlign: 'center' }}>\r\n <p style={{ margin: 0, fontSize: fontSize + \"px\", color: color, lineHeight: (fontSize * 2) + \"px\" }}>{text}</p>\r\n </div>}\r\n </div>\r\n </MyBlockWrapper>)\r\n }\r\n});\r\n","const {isArray, map} = lodash\r\nconst {RangeControl,Flex,ButtonGroup,Button} = wp.components;\r\n\r\nexport const UnitSize = ({field, max, min, label, units, onChange} = props)=>{\r\n \r\n const {val, unit} = field;\r\n // const maxVal = () =>{\r\n // return unit == \"%\" ? 100 : 500;\r\n // }\r\n // const valuetext = (value) => {\r\n // return `${value}` + unit;\r\n // }\r\n return (\r\n <>\r\n\r\n <Flex style={{marginTop: '8px', marginBottom: '8px'}}> \r\n <div>{label}</div>\r\n <ButtonGroup>\r\n {units && isArray(units) && map(units, function(item){\r\n return <Button isSmall isPrimary={unit == item} onClick={()=> onChange({...field, unit : item })}>{item}</Button>\r\n }) }\r\n </ButtonGroup> \r\n </Flex>\r\n <RangeControl \r\n // label=\"Radious\"\r\n value={ val }\r\n onChange={ ( val ) => onChange({...field, val : val}) }\r\n min={ min }\r\n max={ max }\r\n /> \r\n </>\r\n );\r\n\r\n}","import { AmzonImgURL,PrepareInlineStyle,CleanText,MyBlockWrapper } from '../../component/common'\r\nimport {MZSearchDialog} from '../../component/azsearch/azsearch'\r\nimport{UnitSize} from '../../component/fields/unitSize'\r\nimport {MdlImagePickerNew} from '../../component/MdlImagePicker'\r\nimport classnames from 'classnames';\r\n\r\n\r\nconst { __ } = wp.i18n;\r\nconst { registerBlockType } = wp.blocks;\r\nvar el = wp.element.createElement;\r\nconst {Button,ButtonGroup,Dashicon, Flex, FlexItem, FlexBlock,RangeControl , TextControl, ToggleControl, CheckboxControl, PanelBody } = wp.components;\r\nconst { InspectorControls, MediaUpload, MediaUploadCheck, RichText,PanelColorSettings } = wp.blockEditor;\r\nconst {Fragment} = wp.element\r\nconst { has} = lodash\r\n\r\nregisterBlockType('themesfirst/i2-azon-product-box', {\r\n title: __('Product Box i2AZON', 'themesfirst'),\r\n icon: 'embed-photo',\r\n category: 'themesfirst',\r\n keywords: [\r\n __('Product Box', 'themesfirst'),\r\n __('Amazon Product Box', 'themesfirst'),\r\n __('i2 azon', 'themesfirst'),\r\n ],\r\n attributes: {\r\n item_ids: {\r\n type: 'array',\r\n default: []\r\n },\r\n products: {\r\n type: 'array',\r\n default: []\r\n },\r\n block_id:{\r\n type: 'string',\r\n default: ''\r\n },\r\n useBorder : { \r\n type : 'boolean',\r\n default: false\r\n },\r\n borderColor : {\r\n type: 'string',\r\n default: '#231f20'\r\n },\r\n paddingSize: {\r\n type: 'string',\r\n },\r\n fontSize:{\r\n type: 'number',\r\n default: 18\r\n },\r\n color : {\r\n type: 'string',\r\n default: '#222222'\r\n\t\t\t\t},\r\n\t\t\t\ttextColor : {\r\n\t\t\t\t\ttype: 'string',\r\n\t\t\t\t\tdefault: '#222222'\r\n\t\t\t\t},\r\n bgColor : {\r\n type: 'string',\r\n default: '#fff'\r\n },\r\n useLink:{\r\n type: 'boolean',\r\n default: true\r\n\t\t\t\t},\r\n\t\t\t\thideButton:{\r\n\t\t\t\t\ttype: 'boolean',\r\n\t\t\t\t\tdefault: false\r\n\t\t\t},\r\n customLink:{\r\n type: 'string',\r\n default: ''\r\n },\r\n btnText: {\r\n type: 'string',\r\n default : __('View On Amazon', 'themesfirst'),\r\n },\r\n \r\n boxBorder : { \r\n type : 'object',\r\n default: {\r\n use : true,\r\n color: '#222222',\r\n size: { \r\n unit: 'px',\r\n val : 1\r\n },\r\n useRadius : true,\r\n radius: {\r\n unit: 'px',\r\n val : 4\r\n }\r\n }\r\n }, \r\n btnBorder : { \r\n type : 'object',\r\n default: {\r\n use : true,\r\n color: '#222222',\r\n size: { \r\n unit: 'px',\r\n val : 1\r\n },\r\n useRadius : true,\r\n radius: {\r\n unit: 'px',\r\n val : 4\r\n }\r\n }\r\n }, \r\n icon :{\r\n type : 'object',\r\n default: {\r\n cssClass : 'icofont-brand-amazon',\r\n size: 'icofont-md',\r\n color: '',\r\n bgColor: 'transprent'\r\n }\r\n },\r\n imgWrapperWidth: {\r\n type: 'number',\r\n default: 25\r\n },\r\n imgWidth: {\r\n type: 'number',\r\n default: 300\r\n },\r\n width:{\r\n type : 'object',\r\n default :{\r\n size: 400,\r\n unit: 'px',\r\n full : 780\r\n }\r\n },\r\n isHorizontal: {\r\n type: 'boolean',\r\n default: false\r\n }, \r\n },\r\n edit: (props) => {\r\n // console.log(\"==================================\");\r\n // console.log(props);\r\n\r\n const { attributes,clientId, attributes: {item_ids,width,imgWidth,imgWrapperWidth,hideButton,isHorizontal,btnBorder,textColor, boxBorder, block_id,icon,btnText, useLink,customLink, paddingSize,useBorder,borderColor, products,custom_img, link, text, color, bgColor}, setAttributes } = props;\r\n\r\n if(block_id == '' || block_id == undefined){\r\n\t\t\t\t\tsetAttributes({block_id : clientId});\r\n }\r\n\t\t\t\t\r\n const updateData = (obj) => {\r\n // console.log(obj);\r\n if(has(obj, 'item_ids')){\r\n\t\t\t\tsetAttributes(obj)\r\n }else{\r\n\r\n if(obj.products.length == 1){\r\n // const features = JSON.parse(obj.products[0].features).map(x => '<li>' + CleanText(x) +'</li>' );\r\n const features = JSON.parse(obj.products[0].features).map(x => CleanText(x));\r\n // const feature = JSON.parse(obj.products[0].features).join(\"</li><li>\");\r\n // console.log('=========================');\r\n // console.log(features);\r\n // console.log('=========================');\r\n setAttributes({products : [\r\n {\r\n asin : obj.products[0].asin,\r\n title : obj.products[0].title, \r\n description : '',\r\n features : '<li>' + features.join(\"</li><li>\") + '</li>', \r\n // features : features, \r\n //dbFeatures : JSON.parse(obj.products[0].features),\r\n dbFeatures : features,\r\n image : obj.products[0].image\r\n }]});\r\n }\r\n }\r\n\t\t}\r\n\t\t\t\t\r\n\r\n\t\tconst updateImages = (prodPos, image) => {\r\n\r\n const obj = [... products];\r\n\t\t\tobj[prodPos]['image'] = image;\r\n\t\t\tsetAttributes({ products: obj })\r\n\r\n\t\t}\r\n\t\tconst updateCustomImage = (pos, val) => {\r\n\t\t\t// console.log(pos)\r\n\t\t\t// console.log(val)\r\n\t\t\tconst obj = [... products];\r\n\t\t//console.log(obj[pos]);\r\n\t//\tobj[pos]['mytest'] = val;\r\n\r\n\t\tobj[pos]['custom_img']= val;\r\n\t//\tconsole.log(obj[pos]);\r\n\t\t// obj[pos]['customImg'][\"mediaUrl\"] = val.mediaUrl;\r\n\t\tsetAttributes({ products: obj })\r\n\t}\r\n\tconst removeCustomImage = (pos)=> {\r\n // console.log(\"inside custom\");\r\n\t\tif(has( products[pos], 'custom_img')){\r\n\t\t\tconst obj = [... products];\r\n\t\t\tdelete obj[pos]['custom_img'];\r\n\t\t\tsetAttributes({ products: obj });\r\n\t\t}\r\n\t}\r\n\t\tconst logAttr = () => {\r\n\t\t\t// const allImages = wp.apiFetch({ path: \"/i2-azon/v1/search/my keyworeds\" })\r\n\t\t\t// .then((data)=>log(data));\r\n\t\t\t//log(features.filter(x=>x.visiable).map(x=> x.id));\r\n\t\t\tconsole.log(attributes);\r\n }\r\n\t\t\t\t\r\n\t\t\t\tconst updateValue = (obj) => {\r\n\t\t\t\t\tsetAttributes(obj);\r\n }\r\n\t\t\t\t\t\t\r\n const updateProduct = (content, pos, prop, propPos) => {\r\n const obj = [... products];\r\n if(propPos >= 0){\r\n // console.log('inside featues', propPos );\r\n obj[pos][prop][propPos]= content; \r\n }else{\r\n // console.log('inside nor', propPos );\r\n obj[pos][prop]= content; \r\n }\r\n setAttributes({ products: obj });\r\n }\r\n\r\n // const updateFeatureCount = (val) => {\r\n // console.log(val);\r\n // if(products && products.length > 0){\r\n // const obj = [... products];\r\n // if(obj[0].features?.length < val){\r\n // for(var i = obj[0].features.length; i < val; i++){\r\n // obj[0].features[i] = obj[0].dbFeatures?.length >= i ? obj[0].dbFeatures[i] : ''; \r\n // }\r\n // }else if(obj[0].features?.length > val){\r\n // obj[0].features = obj[0].features.slice(0, val);\r\n // }\r\n // setAttributes({ products: obj });\r\n // }\r\n // }\r\n\r\n const resetFeatures=() =>{\r\n if(products && products.length > 0){\r\n const obj = [... products];\r\n // const features = obj[0].dbFeatures.map(x => CleanText(x) );\r\n // const feature = obj[0].dbFeatures.map(x => '<li>' + x +'</li>' );\r\n // obj[0]['features'] = [... obj[0].dbFeatures];\r\n // obj[0]['features'] = '<li>' + feature +'</li>';\r\n obj[0]['features'] = '<li>' + obj[0].dbFeatures.join(\"</li><li>\") + '</li>';\r\n\r\n // console.log(obj);\r\n\r\n setAttributes({ products: obj });\r\n }\r\n }\r\n\r\n \t\treturn (<>\r\n <InspectorControls>\r\n <PanelBody title = { __(\"Common\", 'themesfirst') }\r\n initialOpen = { true } >\r\n {/* <Button onClick = { logAttr } > Log Attr </Button> */}\r\n <MZSearchDialog item_ids = {item_ids} products = {products} updateValue ={updateData} isSingle={true} />\r\n\t\t\t<hr /> \r\n\t\t\t{item_ids.length > 0 &&\t<h4>{__('ASIN', 'themesfirst')} : {item_ids[0]} </h4>}\r\n {products && products.length > 0 && \r\n \t\t\t\t<Flex>\r\n <FlexBlock>Features\r\n \t\t</FlexBlock>\r\n <FlexItem style={{alignSelf: 'flex-end'}}>\r\n <Button style={{marginBottom: '12px', height: '30px' }} isSecondary onClick = {()=> resetFeatures()} > {__('Reset', 'themesfirst') + ' (' + products[0].dbFeatures?.length + ')'} </Button> \r\n </FlexItem>\r\n\t\t\t\t</Flex>\r\n }\r\n <hr /> \r\n <ButtonGroup style={{textAlign:'right', width: '100%', marginBottom: '10px'}}>\r\n <Button isPrimary={isHorizontal} isSmall isSecondary={!isHorizontal} onClick={()=>setAttributes({isHorizontal : true})}><Dashicon icon=\"menu-alt\" /> {__('Horizontal', 'themesfirst')}</Button>\r\n <Button isPrimary={!isHorizontal} isSmall isSecondary={isHorizontal} onClick={()=>setAttributes({isHorizontal : false})}><Dashicon icon=\"columns\" /> {__('Verticle', 'themesfirst')}</Button>\r\n </ButtonGroup>\r\n {isHorizontal && <RangeControl\r\n\t\t\t\t\t\tlabel={ 'Image Width (' + imgWidth + 'px)' } \r\n withInputField = {true}\r\n allowReset = {false}\r\n\t\t\t\t\t\tvalue={ imgWidth }\r\n\t\t\t\t\t\tonChange={ ( obj ) => setAttributes( { imgWidth: obj})}\r\n\t\t\t\t\t\tmin={100}\t\r\n\t\t\t\t\t\tstep ={10}\t\t\t\r\n\t\t\t\t\t\tmax={products[0]?.image?.Width > 200? products[0]?.image?.Width : 500} \r\n\t\t\t\t\t/>}\r\n {!isHorizontal && <RangeControl\r\n\t\t\t\t\t\tlabel={ 'Image Area (' + imgWrapperWidth + '%)' } \r\n withInputField = {true}\r\n allowReset = {false}\r\n\t\t\t\t\t\tvalue={ imgWrapperWidth }\r\n\t\t\t\t\t\tonChange={ ( obj ) => setAttributes( { imgWrapperWidth: obj})}\r\n\t\t\t\t\t\tmin={15}\t\r\n\t\t\t\t\t\tstep ={1}\t\t\t\r\n\t\t\t\t\t\tmax={50} \r\n\t\t\t\t\t/>}\r\n \r\n <hr /> \r\n <ToggleControl label= {__(\"Without Links?\", 'themesfirst')}\r\n checked={ !useLink }\r\n onChange={ () => setAttributes({ useLink: ! useLink } )}\r\n /> \r\n {useLink && <TextControl\r\n label={__(\"URL (By default amazon link)\", 'themesfirst')}\r\n help ={__(\"Optional (custom url should start with http)\", 'themesfirst')}\r\n value={ customLink }\r\n onChange={ (val) => setAttributes( { customLink: val})}\r\n />} \r\n\t\t\t\t\t\t{useLink && <ToggleControl label= {__(\"Hide Button?\", 'themesfirst')}\r\n checked={ hideButton }\r\n onChange={ () => setAttributes({ hideButton: ! hideButton } )}\r\n />} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n </PanelBody>\r\n\t\t\t\t\t\t<PanelBody title = { __(\"Border Setting\") } initialOpen = { false } >\r\n\t\t\t\t\t\t\t\t\t<CheckboxControl\r\n label=\"Use Box Border?\"\r\n help=\"if you want to use border\"\r\n checked={ boxBorder.use }\r\n onChange={ (val) => setAttributes( {boxBorder : { ...boxBorder, use: val}})}\r\n />\r\n {boxBorder.use && <Fragment> \r\n\t\t\t\t\t\t\t\t\t\t<UnitSize field={boxBorder.size} min={0} max={20} label=\"Size\" units={['px']} onChange={(val)=>setAttributes({boxBorder : { ...boxBorder, size: val}})} /> \r\n <CheckboxControl\r\n label=\"Use Custom Radius?\"\r\n help=\"if you want to use custom radius\"\r\n checked={ boxBorder.useRadius }\r\n onChange={ (val) => setAttributes( {boxBorder : { ...boxBorder, useRadius : val}})}\r\n /> \r\n {boxBorder.useRadius && <UnitSize field={boxBorder.radius} min={0} max={50} label=\"Radius\" units={['%', 'px']} onChange={(val)=>setAttributes({boxBorder : { ...boxBorder, radius: val}})} />} \r\n </Fragment>}\r\n </PanelBody> \r\n\r\n {/* <PanelBody title = { __(\"Font Size\", 'themesfirst') }\r\n initialOpen = { false } >\r\n <FontSizePicker\r\n fontSizes={ FontSizeList }\r\n value={ fontSize }\r\n fallbackFontSize={ 18 }\r\n withSlider = {true}\r\n onChange={ ( newFontSize ) => {\r\n setAttributes( { fontSize: newFontSize? newFontSize : 18 } );\r\n } }\r\n />\r\n </PanelBody> */}\r\n <PanelColorSettings\r\n title={ __( 'Color Settings' , 'themesfirst') }\r\n initialOpen = { false }\r\n\t\t\t\t\t\t\t\t\t // colorSettings={colors}\r\n\t\t\t\t\t\t\t\t\t colorSettings = { boxBorder.use? [\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: bgColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { bgColor: colorValue } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Background Color' ,'themesfirst'),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: color,\r\n\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { color: colorValue } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Heading Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: textColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { textColor: colorValue } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Text Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t,\r\n\t\t\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: boxBorder.color,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { boxBorder : { ...boxBorder, color: colorValue}} ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Border Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t] : [\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: bgColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { bgColor: colorValue } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Background Color' ,'themesfirst'),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: color,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { color: colorValue } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Heading Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: textColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { textColor: colorValue} ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Text Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t]}\r\n >\r\n </PanelColorSettings>\r\n </InspectorControls>\r\n\r\n <figure className=\"tf-i2\">\r\n {products.length == 0 && <MZSearchDialog item_ids = {item_ids} products = {products} updateValue ={updateData} isSingle={true} />}\r\n {products.map((prod, j) => {return(\r\n\t\t\t\t <div className={classnames({\"has-border\" : useBorder}, \"tf-i2-product\", {\"tf-i2-horizontal\" : isHorizontal})} style = {PrepareInlineStyle({border: boxBorder, bgColor : bgColor})}>\r\n\t\t\t\t\t<div className={\"tf-i2-image\"} style={{width: isHorizontal? '100%' : imgWrapperWidth + \"%\"}}>\r\n {!has(prod, 'custom_img.mediaId') && (\r\n\t\t\t\t\t <MdlImagePickerNew image={prod['image']} asin={prod['asin']} prodPos={j} updateImages = { updateImages } size={isHorizontal? imgWidth : width.unit != 'px' ? null : width.size} />)}\r\n <div className={prod['custom_img'] == undefined || prod['custom_img'] == \"\"? \"no-custom-image\" : \"editor-post-featured-image\"}>\r\n {prod['custom_img'] != undefined && <img src={prod['custom_img'].mediaUrl} />} \r\n <MediaUploadCheck>\r\n <MediaUpload onSelect={obj=> updateCustomImage(j, {mediaId : obj.id, mediaUrl : obj.url})}\r\n value={prod['custom_img'] != undefined && prod['custom_img'] != \"\"? prod['custom_img'].mediaId : \"\"}\r\n allowedTypes={ ['image'] }\r\n render={({open}) => (\r\n <Button icon=\"wordpress\" isSecondary size=\"24\" className=\"no-custom-image\" onClick={open}> \r\n </Button>\r\n )}\r\n />\r\n </MediaUploadCheck>\r\n {has(prod, 'custom_img.mediaId') && <Button icon=\"trash\" className=\"clear-custom-image\" iconSize=\"24\" label =\"Delete\" onClick = {() => removeCustomImage(j)}></Button>}\r\n </div>\r\n\t\t\t\t</div>\r\n \t<div className=\"tf-i2-content\" style={{width: isHorizontal? '100%' : (100 - imgWrapperWidth) + \"%\"}}>\r\n\t\t\t\t\t <RichText onChange={obj=>updateProduct(obj,j, 'title', -1)}\r\n tagName=\"h5\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"tf-i2-title\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{color: color}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={prod.title}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tformattingControls={['italic']}\r\n />\r\n <RichText onChange={obj=>updateProduct(obj, j , 'features', -1)}\r\n tagName=\"ul\"\r\n multiline= 'li'\r\n className=\"tf-i2-features\"\r\n value={prod.features}\r\n style={{margin: 0, color: textColor}}\r\n />\r\n {useLink && !hideButton && <span className={ classnames('tf-btn-wrapper', 'tf-btn', { \"tf-button-has-border\" : btnBorder.use})} style = {PrepareInlineStyle({border: btnBorder})}><i className={classnames(icon?.cssClass)}></i> \r\n <RichText onChange={obj=>setAttributes({btnText:obj})}\r\n formattingControls={ [ 'bold', 'italic' ] }\r\n tagName=\"span\"\r\n value={btnText}\r\n />\r\n </span>}\r\n\t\t\t\t\t</div>\r\n\r\n </div> \r\n )})} \r\n </figure>\r\n </>\r\n )\r\n },\r\n save: (props) => {\r\n const { attributes: {item_ids,width,btnBorder,boxBorder,useBorder,hideButton, block_id,icon,btnText,imgWrapperWidth,imgWidth, useLink, products,textColor, color, bgColor, isHorizontal}} = props;\r\n const prod = products[0];\r\n\t\t\t\treturn (prod &&\r\n <div className=\"tf-i2\" id={block_id}>\r\n\t\t\t\t\t\t\t\r\n <div className={classnames({\"has-border\" : useBorder}, \"tf-i2-product\", {\"tf-i2-horizontal\" : isHorizontal})} style={PrepareInlineStyle({border:boxBorder, bgColor: bgColor })}>\r\n <div className={\"tf-i2-image\"} style={{width: isHorizontal? '100%' : imgWrapperWidth + \"%\", minHeight: isHorizontal && prod['image'].Height > 0 && prod['image'].Width > 0 ? ( prod['image'].Height / prod['image'].Width * imgWidth) + \"px\" : 'auto' }}>\r\n\t\t\t\t\t\t\t\t<MyBlockWrapper isLink={useLink} href=\"##AFFILIATELINK##\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\r\n\t\t\t\t\t\t\t\t{!has(prod, 'custom_img.mediaId') &&\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<img src={AmzonImgURL(prod['image'].URL, (isHorizontal? imgWidth : width.unit == \"px\" && width.size <= prod['image'].Width? width.size : \"\"), prod['image'].EXT)} alt={prod.title} height={prod['image'].Height} width={prod['image'].Width} />\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t{has(prod, 'custom_img.mediaId') &&<img src={prod['custom_img']['mediaUrl']} alt={prod.title}/>}\r\n\t\t\t\t\t\t\t\t</MyBlockWrapper>\r\n </div>\r\n <div className=\"tf-i2-content\" style={{width: isHorizontal? '100%' : (100 - imgWrapperWidth) + \"%\"}}>\t\t\t\t\t\t\t\t\r\n <RichText.Content href=\"##AFFILIATELINK##\" style={{color:color}} target = \"_blank\" className=\"tf-i2-title\" tagName={useLink ? \"a\" : \"span\"} value={prod.title} rel = \"nofollow noopener noreferrer\" />\r\n <RichText.Content tagName=\"ul\" value={prod.features} style={{color: textColor}} className=\"tf-i2-features\" />\r\n {useLink && !hideButton && <a \r\n href=\"##AFFILIATELINK##\" target = \"_blank\" rel = \"nofollow noopener noreferrer\"\r\n className={ classnames('tf-btn-wrapper', 'tf-btn', { \"tf-button-has-border\" : btnBorder.use})} \r\n style = {PrepareInlineStyle({border: btnBorder})}>\r\n <i className={classnames(icon?.cssClass)}></i> {btnText} \r\n </a>}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n});\r\n"],"sourceRoot":""}1 {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/classnames/index.js","webpack:///./src/component/common.js","webpack:///./src/component/azsearch/data.js","webpack:///./src/component/azsearch/azsearch.js","webpack:///./src/formater/link-formater.js","webpack:///./src/component/data.js","webpack:///./src/component/MdlImagePicker.js","webpack:///./src/component/fields/widthSize.js","webpack:///./src/blocks/image/index.js","webpack:///./src/component/fields/unitSize.js","webpack:///./src/blocks/product-box/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","hasOwn","classNames","classes","arguments","length","arg","argType","push","Array","isArray","inner","apply","join","default","lodash","isEmpty","some","AmzonImg","props","imageUrl","size","ext","style","className","onClick","src","AmzonImgURL","lsize","tfGlobal","homeUrl","AmazonSelectImg","images","idx","obj","JSON","parse","AmazonSelectExt","MyBlockWrapper","isLink","id","href","children","target","rel","elm","wp","element","createElement","AmazonLink","asin","storeUrl","AmazonAffiliateLink","add_proxy_link","proxy_link_slug","donotAddLink","partnerTagForLink","AmazonSearchLink","keyword","PrepareInlineStyle","color","bgColor","padding","border","backgroundColor","useRadius","radius","val","borderRadius","unit","use","undefined","borderColor","SortFilter","label","has","map","remove","first","difference","dropWhile","includes","isEqual","chunk","RichTextToolbarButton","blockEditor","useState","useEffect","richText","toggleFormat","applyFormat","insert","removeFormat","components","Flex","FlexItem","FlexBlock","ExternalLink","ToggleControl","Notice","SelectControl","RangeControl","TextControl","Button","ButtonGroup","Modal","Spinner","Card","CardBody","CardDivider","CardFooter","CardMedia","CardHeader","apiFetch","__","i18n","MZSearchDialog","item_ids","products","updateValue","formaterProps","isSingle","isFormater","open","setOpen","term","rating","minPrice","maxPrice","minSavingPercent","sortBy","categoryId","searchFilter","setSearchFilter","categories","setCategories","loading","setLoading","fromServer","setFromServer","openNewWindow","setOpenNewWindow","allowLoadFromServer","setAllowLoadFromServer","pageCount","setPageCount","data","setData","page","setPage","error","setError","hasLink","setHasLink","startSearch","updateProducts","getSearchResult","fs","localStorage","getItem","pos","curPage","path","then","bins","forCategory","item","Id","DisplayName","resutlCount","resetPageCount","parseInt","changePage","updateAsin","action","title","start","end","toInsert","text","type","attributes","onChange","removeItem","x","product_asin","product_to_remove","product_to_load","newProds","fetchContent","asins","items","newProd","active_image_Index","image_ids","image","updateServer","setItem","icon","isActive","group","variant","isPrimary","isSecondary","isBusy","disabled","onRequestClose","aria-labelledby","width","maxWidth","minHeight","help","checked","marginLeft","iconPosition","justify","textAlign","status","onRemove","marginTop","marginBottom","options","SearchResult","Items","alignSelf","indexOf","display","BrowseNodeInfo","BrowseNodes","ContextFreeName","registerFormatType","tagName","edit","FontSizeList","slug","MdlImagePickerNew","prodPos","updateImages","setImages","position","aria-label","top","left","URL","EXT","imgs","img","classnames","WidthSize","field","maxVal","minVal","isSmall","withInputField","min","step","max","registerBlockType","blocks","FontSizePicker","PanelBody","InspectorControls","MediaUpload","MediaUploadCheck","RichText","PanelColorSettings","category","keywords","block_id","link","alt_text","showText","textOnTop","useBorder","paddingSize","fontSize","useLink","customLink","full","supports","align","clientId","active_image_index","custom_img","setAttributes","updateData","lastIndexOf","substring","initialOpen","fontSizes","fallbackFontSize","withSlider","newFontSize","colorSettings","colorValue","prod","j","flexDirection","mediaUrl","onSelect","updateCustomImage","mediaId","url","allowedTypes","render","iconSize","removeCustomImage","clear","margin","lineHeight","save","Width","alt","height","Height","UnitSize","units","Dashicon","CheckboxControl","Fragment","textColor","hideButton","btnText","boxBorder","btnBorder","cssClass","imgWrapperWidth","imgWidth","isHorizontal","features","replace","CleanText","description","dbFeatures","updateProduct","content","prop","propPos","resetFeatures","allowReset","formattingControls","multiline","Content"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,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AAI,MAAUgB,MAAQgB,EAAY,KAAS,SACzP,oBAACjS,EAAD,CAAgBC,OAAQ6O,EAAS3O,KAAK,oBAAoBE,OAAO,SAASC,IAAI,iCAC5E+B,GAAI4N,EAAM,uBACZ,2BAAK7Q,IAAKC,EAAY4Q,EAAI,MAAUpD,IAAMqF,EAAcD,EAAyB,MAAdvH,EAAM3I,MAAgB2I,EAAM3L,MAAQkR,EAAI,MAAUgB,MAAOvG,EAAM3L,KAAO,GAAMkR,EAAI,MAAUnD,KAAMoE,IAAKjB,EAAKxH,MAAO0I,OAAQlB,EAAI,MAAUmB,OAAQ1G,MAAOuF,EAAI,MAAUgB,QAEtO5O,GAAI4N,EAAM,uBAAwB,2BAAK7Q,IAAK6Q,EAAI,WAAJ,SAAiCiB,IAAKjB,EAAKxH,UAGhF,2BAAKvJ,UAAU,gBAAgBD,MAAO,CAACyL,MAAOwH,EAAc,OAAU,IAAMF,EAAmB,MAC3F,oBAAC,GAASgB,QAAV,CAAkB7S,KAAK,oBAAoBlB,MAAO,CAACqC,MAAMA,GAAQjB,OAAS,SAASnB,UAAU,cAAc+M,QAAS6C,EAAU,IAAM,OAAQlS,MAAOqT,EAAKxH,MAAOnI,IAAM,iCACrK,oBAAC,GAAS0S,QAAV,CAAkB/G,QAAQ,KAAKrP,MAAOqT,EAAKkC,SAAUlT,MAAO,CAACqC,MAAOoQ,GAAYxS,UAAU,mBACzF4P,IAAY6C,GAAc,yBAC1BxR,KAAK,oBAAoBE,OAAS,SAASC,IAAM,+BAClDpB,UAAY+N,KAAW,iBAAkB,SAAU,CAAE,uBAAyB6E,EAAU9P,MACvF/C,MAASoC,EAAmB,CAACI,OAAQqQ,KACjC,yBAAG5S,UAAW+N,KAAWjD,aAAD,EAACA,EAAM+H,YAJT,KAI2BH","file":"js/blocks.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","const {some,isEmpty} = lodash\r\n\r\nexport const AmzonImg = (({imageUrl, size =\"\", ext = \"jpg\", style, className, onClick} = props) =><img className={className} style={style? style: null} onClick={() => (onClick ? onClick() : null)} src={AmzonImgURL(imageUrl, size,ext)}></img>);\r\nexport const AmzonImgURL = (imageUrl, size =\"\", ext = \"jpg\") => {\r\n\tlet lsize =\tsize? '._SL' + size +'_' : '';\r\n\treturn imageUrl != 'NOIMG' && imageUrl != '#' && !isEmpty(imageUrl) ? 'https://m.media-amazon.com/images/I/' + imageUrl + lsize +'.' + (ext? ext : 'jpg'): \r\n\t\t\t\t\t\t\t\t\t\ttfGlobal.homeUrl + '/wp-content/plugins/i2-azone/dist/images/no-image-available.png';\r\n};\r\nexport const AmazonSelectImg = (images, idx = 0)=>{\r\n\tif (images && images != \"#\") {\r\n\t\t// console.log(JSON.parse(images));\r\n\t\tconst obj = JSON.parse(images);\r\n\t\tif (obj && obj.length > idx) {\r\n\t\t\treturn obj[idx]['URL'];\r\n\t\t}\r\n\t\treturn \"NOIMG\";\r\n\t}\r\n}\r\nexport const AmazonSelectExt = (images, idx = 0)=>{\r\n\tif (images && images != \"#\") {\r\n\t\t// console.log(JSON.parse(images));\r\n\t\tconst obj = JSON.parse(images);\r\n\t\tif (obj && obj.length > idx) {\r\n\t\t\treturn obj[idx]['EXT'];\r\n\t\t}\r\n\t\treturn \"jpg\";\r\n\t}\r\n}\r\nexport const MyBlockWrapper = (({isLink, id, href, style, className, onClick, children, target = \"_blank\", rel = \"nofollow noopener noreferrer\", elm = 'span'} = props) =>{\r\nreturn (isLink ? <a id={id} href={href} style={style} className={className} onClick={onClick} target={target} rel={rel}>{children}</a> : \r\n\twp.element.createElement(elm, {id:id, style:style, className:className, onClick:onClick}, children))\r\n})\r\n\r\n//s?k=B00MNV8E0C\r\nexport const AmazonLink = (asin)=> tfGlobal.storeUrl + '/dp/'+ asin;\r\nexport const AmazonAffiliateLink = (asin)=> {\r\n\treturn tfGlobal.add_proxy_link == '1' ? tfGlobal.homeUrl + '/' + tfGlobal.proxy_link_slug + '/' + asin :\r\n\ttfGlobal.storeUrl + '/dp/'+ asin + (tfGlobal.donotAddLink == '1' ? '' : '/?tag=' + tfGlobal.partnerTagForLink +'&linkCode=ogi&th=1&psc=1');\r\n} \r\n\r\nexport const AmazonSearchLink = (keyword)=> tfGlobal.storeUrl + '/s?k='+ keyword;\r\nexport const MySpace = (height = 15)=>{\r\n\t<div style={{height: height + \"px\", width: \"100%\", minWidth: \"100%\"}}></div>\r\n}\r\nexport const ValidateASIN = (asin) => { return /^(B[\\dA-Z]{9}|\\d{9}(X|\\d))$/.test(asin) };\r\n\r\nexport const SetDefaultColorPlate = (PreSetColors, obj)=>{\r\n\tif(obj !== undefined && some(PreSetColors, {color: obj}) !== true){\r\n\t\tlet colors = [...PreSetColors];\r\n\t\tcolors.push({name: 'Custom', color: obj}); \r\n\t\treturn colors; \r\n\t}\r\n\treturn [...PreSetColors]; \r\n }\r\n\r\nexport const Log = (obj, obj2) => {\r\n\tconsole.log(\"======================\");\r\n\tconsole.log(obj);\r\n\tif(typeof obj2 != undefined){\r\n\tconsole.log(obj2);\r\n\t}\r\n\tconsole.log(\"======================\");\r\n}\r\n\r\nexport const PrepareInlineStyle = ({color,bgColor, padding, border} = props)=>{\r\n\tlet obj = {};\r\n\t// obj.fontSize = fontSize + \"px\";\r\n\t// obj.lineHeight = (fontSize * 2 ) + \"px\";\r\n\t// console.log(border);\r\n\t if(!isEmpty(color)){\r\n\t\tobj.color = color;\r\n\t }\r\n\t if(!isEmpty(bgColor)){\r\n\t obj.backgroundColor = bgColor;\r\n\t }\r\n\t if(!isEmpty(padding)){\r\n\t obj.padding = padding;\r\n\t }\r\n\t if(!isEmpty(border)){\r\n\t if(border.useRadius == true && border.radius?.val > 0) {\r\n\t\tobj.borderRadius = border.radius.val + border.radius.unit;\r\n\t }\r\n\t if(border.use == true && border.color != undefined){\r\n\t\t obj.border = border.size.val + border.size.unit + \" solid \" + border.color; \r\n\t } else{\r\n\t\t obj.borderColor = border.color;\r\n\t }\r\n\t}\r\n\t// console.log(obj);\r\n\t return obj;\r\n}\r\n\r\nexport const CleanText = (text) => {\r\n//\tconsole.log(text.replace(/\\\\/g,''))\r\n\treturn text.replace(/\\\\/g,'');\r\n}","export const SortFilter = [\r\n{\r\n\tvalue: \"Featured\",\r\n\tlabel: \"Featured\"\r\n},{\r\n\tvalue: \"AvgCustomerReviews\",\r\n\tlabel: \"Avg Customer Reviews\"\r\n},{\r\n\tvalue: \"NewestArrivals\",\r\n\tlabel: \"Newest Arrivals\"\r\n},{\r\n\tvalue: \"Price:HighToLow\",\r\n\tlabel: \"Price: High To Low\"\r\n},{\r\n\tvalue: \"Price:LowToHigh\",\r\n\tlabel: \"Price: Low To High\"\r\n},{\r\n\tvalue: \"Relevance\",\r\n\tlabel: \"Relevance\"\r\n}]\r\n","// import React, { useEffect, useState } from 'react';\r\nconst {\r\n has,\r\n get,\r\n map,\r\n remove,\r\n first,\r\n difference,\r\n dropWhile,\r\n includes,\r\n isEqual,\r\n chunk,\r\n} = lodash;\r\n// import { plus as linkIcon } from '@wordpress/icons';\r\n// import {smileIcon} from '../../icons/custom'\r\nimport { AmzonImg, AmazonSelectImg, AmazonSelectExt, AmazonLink,AmazonAffiliateLink, AmazonSearchLink } from \"../common\";\r\n//import {Box, Avatar,LinearProgress,Grid, Paper,Divider, List, ListItem , ListItemText,Select,MenuItem,TextField,Slider, FormGroup } from '@material-ui/core'\r\n//import Alert from \"@material-ui/lab/Alert\";\r\nimport { SortFilter } from \"./data\";\r\n//import { VerticalAlignBottom } from '@material-ui/icons';\r\n// import CssBaseline from '@material-ui/core/CssBaseline';\r\n// import {AZCard} from './azcard'\r\n// import {AZDbCard} from './azdbcard'\r\nconst {RichTextToolbarButton } = wp.blockEditor;\r\nconst { useState, useEffect } = wp.element;\r\nconst { toggleFormat,applyFormat,removeFormat,insert,create } = wp.richText;\r\nconst {\r\n Flex,\r\n FlexItem,\r\n FlexBlock,\r\n ExternalLink,\r\n ToggleControl,\r\n Notice,\r\n RangeControl,\r\n SelectControl,\r\n TextControl,\r\n\tButton,\r\n\tButtonGroup,\r\n Modal,\r\n Spinner,\r\n Card,\r\n CardBody,\r\n CardDivider,\r\n CardFooter,\r\n CardHeader,\r\n CardMedia,\r\n} = wp.components;\r\nconst { apiFetch } = wp;\r\nconst { __ } = wp.i18n;\r\n\r\nexport const MZSearchDialog = ({\r\n item_ids,\r\n products,\r\n\tupdateValue,\r\n\tformaterProps,\r\n\tisSingle = false,\r\n\tisFormater = false,\r\n} = props) => {\r\n // const classes = useStyles();\r\n const [open, setOpen] = useState(false);\r\n\r\n const [searchFilter, setSearchFilter] = useState({\r\n term: \"\",\r\n rating: 4,\r\n minPrice: 40,\r\n maxPrice: 0,\r\n minSavingPercent: 0,\r\n sortBy: \"Featured\",\r\n categoryId: \"all\",\r\n });\r\n const [categories, setCategories] = useState([\r\n { value: \"all\", label: \"All Category\" },\r\n ]);\r\n const [categoryId, setCategoryId] = useState(\"all\");\r\n\r\n const [loading, setLoading] = useState(false);\r\n const [fromServer, setFromServer] = useState(true);\r\n const [openNewWindow, setOpenNewWindow] = useState(true);\r\n const [allowLoadFromServer, setAllowLoadFromServer] = useState(false);\r\n\r\n const [pageCount, setPageCount] = useState(0);\r\n const [data, setData] = useState(null);\r\n const [page, setPage] = useState(0);\r\n const [error, setError] = useState(null);\r\n const [hasLink, setHasLink] = useState(null);\r\n \r\n\r\n useEffect(() => {\r\n if (searchFilter.term.length > 0) {\r\n startSearch();\r\n }\r\n }, [categoryId]);\r\n\r\n useEffect(() => {\r\n updateProducts();\r\n }, [item_ids]);\r\n\r\n useEffect(() => {\r\n //console.log(fromServer);\r\n if (allowLoadFromServer && (!fromServer || (fromServer && searchFilter.term.length > 2))) {\r\n getSearchResult(0);\r\n\t\t}\r\n\t\t\r\n }, [fromServer]);\r\n\r\n useEffect(() => {\r\n let fs = localStorage.getItem(\"fromServer\");\r\n setFromServer(fs == \"true\");\r\n setAllowLoadFromServer(true);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if ((searchFilter.term.length > 0 || !fromServer) && page > 0) {\r\n getSearchResult();\r\n }\r\n }, [page, open]);\r\n\r\n const getSearchResult = (pos) => {\r\n if (open && !loading) {\r\n setError(null);\r\n let curPage = pos != 0 ? page : pos;\r\n let term = searchFilter.term.length > 0 ? searchFilter.term : \"NOTERM\";\r\n setLoading(true);\r\n apiFetch({\r\n path:\r\n \"/i2-azon/v1/search/\" +\r\n term +\r\n \"?si=\" +\r\n searchFilter.categoryId +\r\n \"&page=\" +\r\n curPage +\r\n // \"&rating=\" +\r\n // searchFilter.rating +\r\n // \"&minPrice=\" +\r\n // searchFilter.minPrice * 100 +\r\n // \"&maxPrice=\" +\r\n // searchFilter.maxPrice * 100 +\r\n // \"&minSavingPercent=\" +\r\n // searchFilter.minSavingPercent +\r\n \"&sortBy=\" +\r\n searchFilter.sortBy +\r\n \"&sourceRemote=\" +\r\n fromServer,\r\n }).then((data) => {\r\n // console.log(data);\r\n if (has(data, \"Errors\")) {\r\n // console.log(get(data, \"Errors[0].Message\"));\r\n setError(get(data, \"Errors[0].Message\"));\r\n setData(null);\r\n setLoading(false);\r\n } else {\r\n if (categories.length < 2) {\r\n let bins = get(\r\n data,\r\n \"SearchResult.SearchRefinements.SearchIndex.Bins\",\r\n []\r\n );\r\n let forCategory = [{ value: \"all\", label: \"All Category\" }];\r\n if (bins.length > 0) {\r\n bins.map((item) =>\r\n forCategory.push({\r\n value: item.Id,\r\n label: item.DisplayName,\r\n })\r\n );\r\n setCategories(forCategory);\r\n }\r\n }\r\n // console.log('SearchResult.TotalResultCount');\r\n // console.log(get(data,'SearchResult.TotalResultCount', 0));\r\n let resutlCount = get(data, \"SearchResult.TotalResultCount\", 0);\r\n resetPageCount(resutlCount);\r\n setData(data);\r\n // console.log(\"data loaded\");\r\n // console.log(data);\r\n // loading = false\r\n if(resutlCount == 0){\r\n if(!fromServer && searchFilter.term.length > 0){\r\n setError(__('No result found, search on amazon ', 'themesfirst'));\r\n setHasLink(true)\r\n }else{\r\n setError(__('No result found', 'themesfirst'));\r\n }\r\n }\r\n setLoading(false);\r\n }\r\n });\r\n }\r\n };\r\n\r\n const resetPageCount = (val) => {\r\n if (val >= 100) {\r\n setPageCount(10);\r\n } else {\r\n setPageCount(val > 10 ? parseInt(val / 10) + (val % 10 > 0 ? 1 : 0) : 0);\r\n }\r\n };\r\n\r\n const changePage = (val) => {\r\n //\tpage = page + val;\r\n if (page == 1 && val == 1) {\r\n setPage(0);\r\n getSearchResult(0);\r\n } else {\r\n setPage(val - 1);\r\n }\r\n };\r\n const startSearch = () => {\r\n if (page > 0) {\r\n setPage(0);\r\n }\r\n getSearchResult(0);\r\n };\r\n // After Finalize the function\r\n const updateAsin = (action, asin, title = '') => {\r\n\t \r\n\t\tif(isFormater){\r\n\r\n\t\t\tif(formaterProps.value.start == formaterProps.value.end){\r\n\t\t\t\tconst toInsert = applyFormat(\r\n\t\t\t\t\tcreate( { text: title + \" \"} ),\r\n\t\t\t\t\t{ type: \"themesfirst/amazonlinkformat\",\r\n\t\t\t\t\t\t\t\tattributes: { href: AmazonAffiliateLink(asin), target : openNewWindow ? \"_blank\" : \"_self\", rel : \"nofollow noopener noreferrer\" }, \r\n\t\t\t\t\t },\r\n\t\t\t\t\t0,\r\n\t\t\t\t\ttitle.length\r\n\t\t\t\t);\r\n\t\t\t\tformaterProps.onChange( insert( formaterProps.value, toInsert ))\r\n\t\t\t}else{\r\n\t\t\tformaterProps.onChange( \r\n\t\t\t\tapplyFormat(\r\n\t\t\t\t\tformaterProps.value, \r\n\t\t\t\t\t\t\t{ type: \"themesfirst/amazonlinkformat\",\r\n\t\t\t\t\t\t\t\tattributes: { href: AmazonAffiliateLink(asin), target : openNewWindow ? \"_blank\" : \"_self\" , rel : \"nofollow noopener noreferrer\" }, \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\t\tsetOpen(false) \r\n\r\n\t\t}else{\r\n if (action == \"add\") {\r\n if (!isSingle) {\r\n updateValue({ item_ids: [...item_ids, asin] });\r\n } else {\r\n updateValue({ item_ids: [asin] });\r\n }\r\n } else if(action == \"delete\") {\r\n removeItem(asin);\r\n }else {\r\n remove(item_ids, function (x) {\r\n return isEqual(x, asin);\r\n });\r\n updateValue({ item_ids: [...item_ids] });\r\n }\r\n\t\t//console.log(action, asin);\r\n\t\t}\r\n };\r\n // const removeProduct = (asin) => {\r\n // console.log(\"request for remove ... \" + asin);\r\n // const obj = [...products];\r\n // let pIndex = findIndex(obj, { asin: asin });\r\n // if (pIndex > -1) {\r\n // obj.splice(pIndex, 1);\r\n // updateValue({ products: obj });\r\n // }\r\n // };\r\n\r\n // new working changs\r\n // =====================================================================================================//\r\n\r\n const updateProducts = () => {\r\n let product_asin = map(products, \"asin\");\r\n const product_to_remove = difference(product_asin, item_ids);\r\n const product_to_load = difference(item_ids, product_asin);\r\n\r\n if (product_to_remove.length > 0) {\r\n // console.log(\"=============\");\r\n // console.log(\"product to remove : \");\r\n // console.log(product_to_remove);\r\n // console.log(\"=============\");\r\n let newProds = dropWhile(products, function (x) {\r\n return includes(product_to_remove, x.asin);\r\n });\r\n // console.log(newProds);\r\n updateValue({ products: newProds });\r\n }\r\n if (product_to_load.length > 0) {\r\n // console.log(\"=============\");\r\n // console.log(\"goin to fetch : \");\r\n // console.log(product_to_load);\r\n // console.log(\"=============\");\r\n fetchContent(product_to_load.join(\",\"));\r\n }\r\n };\r\n\r\n const fetchContent = (asins) => {\r\n apiFetch({ path: \"/i2-azon/v1/contents/\" + asins }).then((items) => {\r\n if (items != null) {\r\n var newProd = isSingle ? [] : [...products];\r\n\r\n items.map((obj) => {\r\n var item = obj;\r\n item.active_image_Index = 0;\r\n var images = JSON.parse(obj.image_ids);\r\n if (images.length > 0) {\r\n // item.images = images;\r\n delete item.image_ids;\r\n item.image = images[0];\r\n }\r\n newProd.push(item);\r\n });\r\n\r\n // console.log(newProd);\r\n updateValue({ products: newProd });\r\n }\r\n });\r\n };\r\n\r\n const removeItem = (asin) => {\r\n apiFetch({ path: \"/i2-azon/v1/delete/\" + asin }).then((data) => {\r\n // console.log(data);\r\n if(data == 1){\r\n remove(item_ids, function (x) {\r\n return isEqual(x, asin);\r\n });\r\n updateValue({ item_ids: [...item_ids] });\r\n getSearchResult(page);\r\n\r\n }else{\r\n setError(__('Error on removing product, please try again','themefirst'));\r\n }\r\n\r\n // if (items != null) {\r\n // var newProd = isSingle ? [] : [...products];\r\n\r\n // items.map((obj) => {\r\n // var item = obj;\r\n // item.active_image_Index = 0;\r\n // var images = JSON.parse(obj.image_ids);\r\n // if (images.length > 0) {\r\n // item.images = images;\r\n // item.image = images[0];\r\n // }\r\n // newProd.push(item);\r\n // });\r\n\r\n // console.log(newProd);\r\n // updateValue({ products: newProd });\r\n // }\r\n });\r\n };\r\n // end new changes\r\n const updateServer = (val) => {\r\n localStorage.setItem(\"fromServer\", val);\r\n setData(null);\r\n setFromServer(val);\r\n };\r\n\r\n return (\r\n <>\r\n\t\t {isFormater ? \r\n\t\t\t<>\r\n\t\t\t<RichTextToolbarButton \r\n\t\t\t icon= {formaterProps.isActive? 'editor-unlink' : 'admin-links'}\r\n\t\t\t// icon= {smileIcon}\t\t\t \r\n\t\t\t title={__('Amazon link', 'themesfirst')}\r\n onClick={ () => { \r\n\t\t\t\t formaterProps.isActive ? \r\n\t\t\t\t formaterProps.onChange( toggleFormat(\r\n\t\t\t\t\tformaterProps.value,\r\n\t\t\t\t\t{ type: 'themesfirst/amazonlinkformat' } ))\r\n\t\t\t\t : \r\n\t\t\t\t\t\tsetOpen(true) } \r\n\t\t\t\t\t}\r\n\t\t\t\tgroup=\"primary\"\r\n isActive={ formaterProps.isActive }\r\n /> </> : \r\n <Flex>\r\n <span> \r\n <Button variant=\"outlined\" isPrimary onClick={(obj) => setOpen(true)}>\r\n {__(\"Search Products\", \"themesfirst\")}\r\n </Button>\r\n </span>\r\n\t\t\t\t{item_ids.length > 0 &&\r\n <Button\r\n icon=\"image-rotate\"\r\n isSecondary\r\n size=\"24\"\r\n\t\t\t\t\tisBusy={loading}\t\t\t\t\t\r\n variant=\"outlined\"\r\n onClick={updateProducts}\r\n disabled={difference(item_ids, map(products, \"asin\")).length == 0}\r\n ></Button>}\r\n </Flex> }\r\n {open && (\r\n <Modal\r\n open={open}\r\n title={__(\"Search Products\", \"themesfirst\")}\r\n onRequestClose={() => setOpen(false)}\r\n aria-labelledby=\"form-dialog-title\"\r\n style={{width: '90%', maxWidth: '1080px'}}\r\n >\r\n <figure style={{ minHeight: \"400px\" }}>\r\n <Flex className=\"tf-top-pagination-wrapper\">\r\n <FlexItem>\r\n <Flex>\r\n <FlexItem>\r\n <ToggleControl\r\n label=\"Use API?\"\r\n help={fromServer ? __('Active Server Amazon API', 'themesfirst') : __('Active Server Local DB', 'themesfirst')}\r\n checked={fromServer}\r\n onChange={() => updateServer(!fromServer)}\r\n />\r\n </FlexItem>\r\n {isFormater && <FlexItem>\r\n <ToggleControl\r\n label=\"Open link in new tab?\"\r\n help={openNewWindow ? __('link will open in new tab', 'themesfirst') : __('link will open in same tab', 'themesfirst')}\r\n checked={openNewWindow}\r\n onChange={() => setOpenNewWindow(!openNewWindow)}\r\n />\r\n </FlexItem>}\r\n </Flex>\r\n \r\n \r\n </FlexItem> \r\n\t\t\t\t\t\t\t{pageCount > 1 &&\t<ButtonGroup style={{marginLeft:\"auto\"}}>\r\n\t\t\t\t\t\t\t {page > 0 &&\t<Button onClick={()=> changePage(page)} icon=\"arrow-left-alt2\">{__('Prev', 'themesfirst')}</Button>}\r\n\t\t\t\t\t\t\t\t<Button isPrimary disabled={true} icon=\"editor-kitchensink\" > {page + 1} {__('of', 'themesfirst')} {pageCount}</Button>\r\n\t\t\t\t\t\t\t {page < pageCount - 1 &&\t<Button onClick={()=> changePage(page + 2)} icon=\"arrow-right-alt2\" iconPosition=\"right\">{__('Next', 'themesfirst')}</Button>}\r\n\t\t\t\t\t\t\t</ButtonGroup>}\r\n {/* <FlexBlock style={{ marginLeft: \"auto\" }}>\r\n\r\n {pageCount > 1 && (\r\n <Pagination\r\n count={pageCount}\r\n className={\"MuiPagination-ul\"}\r\n disabled={loading}\r\n color=\"primary\"\r\n page={page + 1}\r\n onChange={(obj, pos) => changePage(pos)}\r\n />\r\n )}\r\n </FlexBlock> */}\r\n </Flex>\r\n {loading && (\r\n <Flex justify=\"center\">\r\n <FlexBlock style={{ minHeight: \"50px\", textAlign: \"center\" }}>\r\n <Spinner />\r\n </FlexBlock>\r\n </Flex>\r\n )}\r\n {error && (\r\n <Notice status=\"error\" onRemove={() => {setError(null), setHasLink(null)}}>\r\n {error} {hasLink && <ExternalLink href={AmazonSearchLink(searchFilter.term)}>{searchFilter.term}</ExternalLink>}\r\n </Notice>\r\n )}\r\n\r\n <div style={{ marginTop: \"15px\", marginBottom: \"15px\" }}>\r\n {/* <div className=\"tf-sub-title\">\r\n <h4>{__('Search the product which you want to publish on the website', 'themesfirst')}</h4>\r\n </div> */}\r\n <Flex className=\"tf-flex-sf-container\">\r\n <FlexItem>\r\n <TextControl\r\n label={__(\"Search Terms\", \"themesfirst\")}\r\n value={searchFilter.term}\r\n onChange={(obj) =>\r\n setSearchFilter({ ...searchFilter, term: obj })\r\n }\r\n />\r\n </FlexItem>\r\n <FlexItem>\r\n {fromServer && (\r\n <SelectControl\r\n label={__(\"Sort By\", \"themesfirst\")}\r\n value={searchFilter.sortBy}\r\n onChange={(obj) => {\r\n setSearchFilter({ ...searchFilter, sortBy: obj });\r\n }}\r\n options={SortFilter}\r\n />\r\n )}\r\n </FlexItem>\r\n <FlexItem>\r\n <Button\r\n icon=\"search\"\r\n isBusy={loading}\r\n className=\"tf-full-button\"\r\n style={{ marginBottom: \"8px\" }}\r\n disabled={fromServer && searchFilter.term.length < 3}\r\n isPrimary\r\n onClick={() => startSearch()}\r\n >\r\n {__(\"Search\", \"themesfirst\")}\r\n </Button>\r\n </FlexItem>\r\n </Flex>\r\n </div>\r\n\r\n {data &&\r\n data.SearchResult.Items.length > 0 &&\r\n chunk(data.SearchResult.Items, 3).map((items) => {\r\n return (\r\n <Flex justify=\"center\" style={{ marginBottom: \"10px\" }}>\r\n {items.map((item) => (\r\n <FlexItem\r\n style={{ maxWidth: \"33%\", alignSelf: \"flex-start\" }}\r\n >\r\n {fromServer ? (\r\n <Card className=\"tf-card\">\r\n {item_ids.indexOf(get(item, \"ASIN\")) == -1 ? (\r\n <Button\r\n icon=\"plus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"add\", get(item, \"ASIN\"), get(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ItemInfo.Title.DisplayValue\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"No Title\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t))\r\n }\r\n className=\"tf-card-button tf-button-add\"\r\n ></Button>\r\n ) : (\r\n <Button\r\n icon=\"minus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"remove\", get(item, \"ASIN\"))\r\n }\r\n className=\"tf-card-button tf-button-minus\"\r\n ></Button>\r\n )}\r\n <CardMedia className=\"tf-card-image\">\r\n <img\r\n src={get(item, \"Images.Primary.Large.URL\", \"#\")}\r\n />\r\n </CardMedia>\r\n <CardBody size=\"small\">\r\n <strong style={{marginTop:0, display: 'block'}}>ASIN : \r\n {\r\n get(item, 'ASIN', 'no asin')\r\n }</strong>\r\n {get(\r\n item,\r\n \"ItemInfo.Title.DisplayValue\",\r\n \"No Title\"\r\n )}\r\n <CardDivider className=\"tf-card-devider\" />\r\n {\r\n first(item.BrowseNodeInfo.BrowseNodes)\r\n .ContextFreeName\r\n }\r\n </CardBody>\r\n <CardFooter size=\"small\">\r\n <FlexItem>\r\n {has(\r\n item,\r\n \"Offers.Listings[0].SavingBasis.DisplayAmount\"\r\n ) ? (\r\n <span>\r\n <s>\r\n {get(\r\n item,\r\n \"Offers.Listings[0].SavingBasis.DisplayAmount\"\r\n )}\r\n </s>{\" \"}\r\n {\" \"}\r\n </span>\r\n ) : (\r\n \"\"\r\n )}\r\n <b>\r\n {get(\r\n item,\r\n \"Offers.Listings[0].Price.DisplayAmount\",\r\n \"No Price\"\r\n )}\r\n </b>\r\n </FlexItem>\r\n <FlexItem style={{ marginLeft: \"auto\" }}>\r\n <ExternalLink\r\n href={get(item, \"DetailPageURL\")}\r\n ></ExternalLink>\r\n </FlexItem>\r\n </CardFooter>\r\n </Card>\r\n ) : (\r\n <Card className=\"tf-card\">\r\n {item_ids.indexOf(get(item, \"asin\")) == -1 ? (\r\n <Button\r\n icon=\"plus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"add\", get(item, \"asin\"), get(item, \"title\", ''))\r\n }\r\n className=\"tf-card-button tf-button-add\"\r\n ></Button>\r\n ) : (\r\n <Button\r\n icon=\"minus\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"remove\", get(item, \"asin\"))\r\n }\r\n className=\"tf-card-button tf-button-minus\"\r\n ></Button>\r\n )}\r\n <Button\r\n icon=\"trash\"\r\n isSecondary\r\n size=\"24\"\r\n onClick={(obj) =>\r\n updateAsin(\"delete\", get(item, \"asin\"))\r\n }\r\n className=\"tf-card-button tf-button-minus tf-button-trash\"\r\n ></Button>\r\n <CardMedia className=\"tf-card-image\">\r\n <AmzonImg\r\n imageUrl={AmazonSelectImg(\r\n get(item, \"image_ids\", \"#\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\text={AmazonSelectExt(\r\n get(item, \"image_ids\", \"#\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n ></AmzonImg>\r\n </CardMedia>\r\n <CardBody size=\"small\">\r\n <strong style={{marginTop:0, display: 'block'}}>ASIN : \r\n {\r\n get(item, 'asin', 'no asin')\r\n }</strong>\r\n {get(item, \"title\", \"No Title\")}\r\n </CardBody>\r\n <CardFooter size=\"small\">\r\n <FlexItem>\r\n {has(item, \"saving\") ? \r\n <span>\r\n <s>{get(item, \"saving\")}</s> {\" \"}\r\n </span>\r\n : \"\"\r\n }\r\n <b>{get(item, \"display_price\", __('No Price', 'themesfirst'))}</b>\r\n </FlexItem>\r\n <FlexItem style={{ marginLeft: \"auto\" }}>\r\n <ExternalLink\r\n href={AmazonLink(get(item, \"asin\"))}\r\n ></ExternalLink>\r\n </FlexItem>\r\n </CardFooter>\r\n </Card>\r\n )}\r\n </FlexItem>\r\n ))}\r\n </Flex>\r\n );\r\n })}\r\n </figure>\r\n </Modal>\r\n )}\r\n </>\r\n );\r\n};\r\n","import {MZSearchDialog} from '../component/azsearch/azsearch' \r\nconst { registerFormatType } = wp.richText;\r\nconst { __ } = wp.i18n;\r\n \r\nconst AmzLinkButton = ( props ) => {\r\n // console.log(props);\r\n return <MZSearchDialog isFormater={true} formaterProps={props} item_ids={[]} />\r\n};\r\n \r\nregisterFormatType(\r\n 'themesfirst/amazonlinkformat', {\r\n title: __('Amazon link (i2-azon)', 'themesfirst'),\r\n tagName: 'a',\r\n className: 'i2-azon-amazon-link',\r\n edit: AmzLinkButton,\r\n }\r\n);","import { ExitToAppOutlined } from \"@material-ui/icons\";\r\n\r\nconst { __ } = wp.i18n;\r\nexport const SLTypeOfInput = [\r\n { label: __('Text'), value: 'SLN' },\r\n // { label: __('Multi line'), value: 'MLN' },\r\n { label: __('Number'), value: 'NBR' },\r\n // { label: __('Link'), value: 'LNK' },\r\n { label: __('Button'), value: 'BTN' },\r\n { label: __('Yes/No'), value: 'YRN' },\r\n { label: __('Image'), value: 'IMG' },\r\n { label: __('Rating'), value: 'RTG' },\r\n // { label: __('Block'), value: 'BLK' }\r\n]\r\nexport const SLDefaultClasses = [\r\n { label: __('Link'), value: 'tftxtlink' },\r\n { label: __('Flat'), value: 'tfflatlink' },\r\n { label: __('3D'), value: 'tf3dlink' },\r\n { label: __('Amazon'), value: 'tfamazonlink' },\r\n { label: __('Custom'), value: '' }\r\n]\r\n\r\nexport const PreSetColors = [\r\n\t{ name: 'Red', color: '#d9534f' },\r\n\t{ name: 'Green', color: '#27ae60' },\r\n\t{ name: 'Blue', color: '#256aaf' },\r\n\t{ name: 'Brown', color: '#e47911' },\r\n\t{ name: 'Black', color: '#231f20'},\r\n];\r\n\r\nexport const FeaturesDefaults = [\r\n\t{ id: 'productHighlighter', visiable: false, show_label: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'images', visiable: true, show_label: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'title', visiable: true, show_label: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'asin', visiable: false, show_label: true, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'rating', visiable: true, show_label: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'reviews', visiable: true, show_label: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'manufacturer', visiable: true, show_label: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'brand', visiable: true, show_label: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'model', visiable: false, show_label: true, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'product_group', visiable: false, show_label: true, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'is_amazon_fulfilled', visiable: false, show_label: true, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'is_prime_eligible', visiable: true, show_label: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'display_price', visiable: true, show_label: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'saving_amount', visiable: false,show_label: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, use_class:\"\" },\r\n\t{ id: 'button', visiable: true, show_label: true, label: __('Button', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, use_class:\"\" }\r\n]\r\n\r\nexport const FeaturesHorizontalDefaults = [\r\n\t{ id: 'productHighlighter', visiable: false, show_label: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, width: '0%', use_class:\"\" },\r\n\t{ id: 'images', visiable: true, show_label: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, width: '20%', use_class:\"\" },\r\n\t{ id: 'title', visiable: true, show_label: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, width: 'auto', use_class:\"\" },\r\n\t{ id: 'asin', visiable: false, show_label: true, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'display_price', visiable: true, show_label: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'saving_amount', visiable: false, show_label: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, width: '15%', use_class:\"\" },\r\n\t{ id: 'button', visiable: true, show_label: true, label: __('Button', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, width: '15%', use_class:\"tf-amazon-link\" }\r\n]\r\n\r\nexport const ImageSizePx = [\r\n//\t{ value: 0, label: '0px'},\r\n\t{ value: 75, label: 'S'},\r\n\t{ value: 160, label: 'M'},\r\n\t{ value: 500, label: 'L'},\r\n//\t{ value: 1920, label: '1920px'}\r\n]\r\nexport const ImageSizePercent = [\r\n\t{ value: 0, label: '0%'},\r\n\t{ value: 25, label: '25%'},\r\n\t{ value: 50, label: '50%'},\r\n\t{ value: 75, label: '75%'},\r\n\t{ value: 100, label: '100%'}\r\n]\r\n\r\nexport const SLButtonStyle = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-btn-amazon', label : __('Amazon', 'themes-first')},\r\n\t{value : 'tf-btn-rounded', label : __('Rounded', 'themes-first')},\r\n\t{value : 'tf-btn-3d', label : __('3D', 'themes-first')},\r\n\t{value : 'tf-btn-link', label : __('Link', 'themes-first')},\r\n]\r\n\r\nexport const SLSize = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-size-small', label : __('Small', 'themes-first')},\r\n\t{value : 'tf-size-medium', label : __('Medium', 'themes-first')},\r\n\t{value : 'tf-size-big', label : __('Big', 'themes-first')},\r\n\t{value : 'tf-size-larg', label : __('Larg', 'themes-first')}, \r\n]\r\nexport const SLAlignment = [\r\n\t{value : '', label : __('Please Select', 'themes-first')},\r\n\t{value : 'tf-al-middle', label : __('Middle', 'themes-first')}, \r\n\t{value : 'tf-al-top', label : __('Top', 'themes-first')}, \r\n\t{value : 'tf-al-bottom', label : __('Bottom', 'themes-first')}, \r\n\t{value : 'tf-al-right', label : __('Right', 'themes-first')}, \r\n\t{value : 'tf-al-left', label : __('Left', 'themes-first')}, \r\n]\r\nexport const SLIconFonts = [\r\n\t'icofont-amazon', 'icofont-amazon-alt', 'icofont-brand-amazon', 'icofont-opencart',\r\n\t'icofont-shopping-cart','icofont-cart','icofont-cart-alt','icofont-ui-cart',\r\n\t'icofont-brand-ebay','icofont-google-wallet','icofont-google-wallet-alt-3','icofont-virtuemart',\r\n\t'icofont-brand-walmart'\r\n]\r\n\r\nexport const InnerBlockList = {\r\n\tAZIMG \t: 'themesfirst/ib-i2-azone-image',\r\n\tSLN\t\t: 'themesfirst/ib-i2-azone-text',\r\n\tAZRTG \t: 'themesfirst/ib-i2-azone-rating',\r\n\tAZBTN \t: 'themesfirst/ib-i2-azone-button',\r\n\tYRN \t: 'themesfirst/ib-i2-azone-yesno',\r\n\tAZPRC\t: 'themesfirst/ib-i2-azone-text',\r\n};\r\n\r\nexport const FontSizeList = [\r\n\t{\r\n\t\tname: __( 'Small' ),\r\n\t\tslug: 'small',\r\n\t\tsize: 12,\r\n\t},\r\n\t{\r\n\t\tname: __( 'Medium' ),\r\n\t\tslug: 'medium',\r\n\t\tsize: 18,\r\n\t}, \r\n\t{\r\n\t\tname: __( 'Larg' ),\r\n\t\tslug: 'larg',\r\n\t\tsize: 24,\r\n\t}, \r\n\t{\r\n\t\tname: __( 'Extra' ),\r\n\t\tslug: 'extra',\r\n\t\tsize: 36,\r\n\t}\r\n];\r\n\r\n\r\n// export const FeaturesHorizontalDefaults = {\r\n// \t'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '0%' },\r\n// \t'image' : { visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: '20%' },\r\n// \t'title' : { visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: 'auto' },\r\n// \t'display_price' : { visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '15%' },\r\n// \t'saving_amount' : { visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: true, width: '15%' },\r\n// \t'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: true, width: '15%' }\r\n// }\r\n\r\n// export const FeaturesDefaults = {\r\n// \t'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'image': {visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'title' : {visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'asin' : {visiable: false, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'rating' : {visiable: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: ''},\r\n// \t'reviews' : {visiable: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'manufacturer' : {visiable: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'brand' : {visiable: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'model' : {visiable: false, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'product_group' : {visiable: false, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'is_amazon_fulfilled' : {visiable: false, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'is_prime_eligible' : {visiable: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'display_price' : {visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'saving_amount' : {visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' },\r\n// \t'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }\r\n// }\r\n\r\n\r\n// var users = [\r\n// \t{'productHighlighter' : { visiable: false, label: __('Highlighter', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"PDH\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'image': {visiable: true, label: __('Thumbnail', 'themes-first'), display_label: __('Thumbnail', 'themes-first'), allowTodelete: false, type: \"AZIMG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'title' : {visiable: true, label: __('Title', 'themes-first'), display_label: __('Product Name', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'asin' : {visiable: false, label: __('ASIN', 'themes-first'), display_label: __('ASIN', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'rating' : {visiable: true, label: __('Rating', 'themes-first'), display_label: __('Rating', 'themes-first'), allowTodelete: false, type: \"AZRTG\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: ''}},\r\n// \t{'reviews' : {visiable: true, label: __('Reviews', 'themes-first'), display_label: __('Reviews', 'themes-first'), allowTodelete: false, type: \"NBR\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'manufacturer' : {visiable: true, label: __('Manufacturer', 'themes-first'), display_label: __('Manufacturer', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'brand' : {visiable: true, label: __('Brand', 'themes-first'), display_label: __('Brand', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'model' : {visiable: false, label: __('Model', 'themes-first'), display_label: __('Model', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'product_group' : {visiable: false, label: __('Product Group', 'themes-first'), display_label: __('Group', 'themes-first'), allowTodelete: false, type: \"SLN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'is_amazon_fulfilled' : {visiable: false, label: __('Amazon Fulfilled', 'themes-first'), display_label: __('Amazon Fulfilled', 'themes-first'), allowTodelete: false, type: \"IAF\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'is_prime_eligible' : {visiable: true, label: __('Prime Benefits', 'themes-first'), display_label: __('Prime Benefits', 'themes-first'), allowTodelete: false, type: \"IPE\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'display_price' : {visiable: true, label: __('Price', 'themes-first'), display_label: __('Price', 'themes-first'), allowTodelete: false, type: \"AZPRC\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'saving_amount' : {visiable: false, label: __('Saving', 'themes-first'), display_label: __('', 'themes-first'), allowTodelete: false, type: \"AZSVN\", preferred_db: false, add_link: false, highlight: false, useWidth: false, width: '' }},\r\n// \t{'button' : { visiable: true, label: __('Link Text', 'themes-first'), display_label: __('View On Amazon', 'themes-first'), allowTodelete: false, type: \"AZBTN\", preferred_db: true, add_link: false, highlight: false, useWidth: false, width: '' }}\r\n// ]\r\n","import { AmzonImg } from './common'\r\nimport classnames from 'classnames';\r\n\r\nconst { chunk } = lodash;\r\nconst { Flex, FlexItem,FlexBlock, Button, Modal, Spinner } = wp.components;\r\nconst { useState, useEffect } = wp.element;\r\nconst { __ } = wp.i18n;\r\nconst { apiFetch } = wp;\r\n\r\nexport const MdlImagePickerNew = ({ image, prodPos, updateImages, asin, size} = props) => {\r\n const [open, setOpen] = useState(false);\r\n const [loading, setLoading] = useState(false);\r\n const [images, setImages] = useState([]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n setLoading(true);\r\n apiFetch({ path: \"/i2-azon/v1/images/\" + asin })\r\n .then((data) => {\r\n setImages(JSON.parse(data));\r\n setLoading(false);\r\n });\r\n }\r\n }, [open]);\r\n\r\n return (<figure>\r\n <figure style={{ position: \"relative\" }} >\r\n <Button icon=\"images-alt2\" isPrimary size=\"24\" aria-label=\"remove\" onClick={() => setOpen(true)} style={{ position: \"absolute\", top: '15px', left: '15px' }}></Button>\r\n {image && <AmzonImg imageUrl={image.URL} ext={image.EXT? image.EXT : \"jpg\"} size={size}></AmzonImg>}\r\n </figure>\r\n { open ?\r\n <Modal open={open} title={__(\"Select Image\", 'themesfirst')} onRequestClose={obj => setOpen(false)} aria-labelledby=\"form-dialog-title\">\r\n <div style={{ minHeight: '400px' }}>\r\n {loading && <Flex justify=\"center\"><FlexBlock style={{minHeight:'100px', textAlign:'center'}}><Spinner /></FlexBlock></Flex>}\r\n {images.length > 0 && chunk(images, 3).map((imgs) => {\r\n return <Flex justify=\"center\">\r\n {imgs.map((img) => <FlexItem style={{ maxWidth: '33%' }}>\r\n <AmzonImg\r\n onClick={() => updateImages(prodPos, img)}\r\n className={ classnames('tf-mdl-image', {'tf-mdl-image-active': image && img.URL == image.URL })}\r\n imageUrl={img.URL} size=\"400\" \r\n\t\t\t\t\t\t\t\t\text={img.EXT? img.EXT : \"jpg\"}/>\r\n </FlexItem>\r\n )}\r\n </Flex>\r\n }\r\n )}\r\n\r\n </div>\r\n </Modal> : null}\r\n </figure>)\r\n}\r\n","const { Flex, FlexItem, FlexBlock, RangeControl, Button, ButtonGroup} = wp.components;\r\nconst { __ } = wp.i18n;\r\n\r\nexport const WidthSize = ({field, onChange} = props)=>{\r\n \r\n const {size, unit} = field;\r\n const maxVal = () =>{\r\n return unit == \"%\" ? 100 : 500;\r\n\t\t }\r\n\t\t const minVal = () =>{\r\n\t\t\treturn unit == \"%\" ? 5 : 50;\r\n\t }\r\n return (\r\n <>\r\n <Flex>\r\n\t\t\t\t\t<FlexItem>{__('Width', 'themesfirst')}</FlexItem>\r\n\t\t\t\t\t<FlexBlock className=\"tf-text-align-end\">\r\n\t\t\t\t\t<ButtonGroup size=\"small\" aria-label=\"small outlined button group\" style={{marginLeft:\"auto\"}}>\r\n\t\t\t\t\t\t<Button onClick={()=> onChange({...field, unit : '%', size : 60 })} isPrimary={unit == \"%\"} isSmall>%</Button>\r\n\t\t\t\t\t\t<Button onClick={()=> onChange({...field, unit : 'px', size: 300})} isPrimary={unit != \"%\"} isSmall>px</Button>\r\n\t\t\t\t\t</ButtonGroup>\r\n\t\t\t\t\t</FlexBlock>\r\n </Flex> \r\n\t\t\t\t<Flex>\r\n\t\t\t\t\t<FlexBlock>\r\n\t\t\t\t\t\t<RangeControl\r\n\t\t\t\t\t\tlabel={ size + unit} \r\n\t\t\t\t\t\twithInputField = {true}\r\n\t\t\t\t\t\tvalue={ size }\r\n\t\t\t\t\t\tonChange={ ( obj ) => onChange({...field, size : obj})}\r\n\t\t\t\t\t\tmin={ minVal() }\t\r\n\t\t\t\t\t\tstep ={1}\t\t\t\r\n\t\t\t\t\t\tmax={maxVal()} \r\n\t\t\t\t\t/>\r\n\t\t</FlexBlock>\r\n\t\t\t\t</Flex>\r\n </>\r\n );\r\n\r\n}","import { AmzonImgURL, MyBlockWrapper } from '../../component/common'\r\nimport { MZSearchDialog } from '../../component/azsearch/azsearch'\r\nimport {FontSizeList } from '../../component/data'\r\nimport { MdlImagePickerNew } from '../../component/MdlImagePicker'\r\nimport { WidthSize } from '../../component/fields/widthSize'\r\n\r\n\r\nconst { __ } = wp.i18n;\r\nconst { registerBlockType } = wp.blocks;\r\nconst { Button, FontSizePicker, TextControl, ToggleControl, PanelBody } = wp.components;\r\nconst { InspectorControls, MediaUpload, MediaUploadCheck, RichText, PanelColorSettings } = wp.blockEditor;\r\nconst { useEffect, useState } = wp.element\r\nconst { has} = lodash\r\n\r\nregisterBlockType('themesfirst/i2-azon-image', {\r\n title: __('Image i2AZON', 'themesfirst'),\r\n icon: 'format-image',\r\n category: 'themesfirst',\r\n keywords: [\r\n __('Image', 'themesfirst'),\r\n __('Amazon Image', 'themesfirst'),\r\n __('i2 azon', 'themesfirst'),\r\n ],\r\n attributes: {\r\n item_ids: {\r\n type: 'array',\r\n default: []\r\n },\r\n products: {\r\n type: 'array',\r\n default: []\r\n },\r\n block_id: {\r\n type: 'string',\r\n default: ''\r\n },\r\n link: {\r\n type: 'string',\r\n default: ''\r\n },\r\n alt_text: {\r\n type: 'string',\r\n default: ''\r\n },\r\n text: {\r\n type: 'string',\r\n default: __('CLICK HERE', 'themesfirst')\r\n },\r\n showText: {\r\n type: 'boolean',\r\n default: true\r\n },\r\n textOnTop: {\r\n type: 'boolean',\r\n default: false\r\n },\r\n useBorder: {\r\n type: 'boolean',\r\n default: false\r\n },\r\n borderColor: {\r\n default: '#231f20'\r\n },\r\n paddingSize: {\r\n type: 'string',\r\n },\r\n fontSize: {\r\n type: 'number',\r\n default: 18\r\n },\r\n color: {\r\n default: '#ffffff'\r\n },\r\n bgColor: {\r\n default: '#231f20'\r\n },\r\n useLink: {\r\n type: 'boolean',\r\n default: true\r\n },\r\n customLink: {\r\n type: 'string',\r\n default: ''\r\n },\r\n width: {\r\n type: 'object',\r\n default: {\r\n size: 400,\r\n unit: 'px',\r\n full: 780\r\n }\r\n },\r\n },\r\n supports: {\r\n align: true\r\n },\r\n edit: (props) => {\r\n // console.log(\"==================================\");\r\n //console.log(props);\r\n\r\n const { attributes, clientId, attributes: { item_ids, width, block_id, useLink, customLink,alt_text, paddingSize, useBorder, borderColor, active_image_index, products, custom_img, link, text, color, bgColor, fontSize, showText, textOnTop }, setAttributes } = props;\r\n\r\n if (block_id == '' || block_id == undefined) {\r\n setAttributes({ block_id: clientId });\r\n }\r\n\r\n // const [colors, setColors] = useState([\r\n // {\r\n // value: bgColor,\r\n // onChange: (colorValue) => setAttributes({ bgColor: colorValue }),\r\n // label: __('Background Color', 'themesfirst'),\r\n // },\r\n // {\r\n // value: color,\r\n // onChange: (colorValue) => setAttributes({ color: colorValue }),\r\n // label: __('Text Color', 'themesfirst'),\r\n // }\r\n // ]);\r\n\r\n // useEffect(() => {\r\n\r\n // if (!useBorder && colors.length > 2) {\r\n\r\n // colors.pop();\r\n // setColors([...colors]);\r\n\r\n // } else if (useBorder && colors.length == 2) {\r\n\r\n // colors.push(\r\n // {\r\n // value: borderColor,\r\n // onChange: (colorValue) => setAttributes({ borderColor: colorValue }),\r\n // label: __('Border Color', 'themesfirst')\r\n // }\r\n // );\r\n // setColors([...colors]);\r\n // }\r\n // }\r\n // , [useBorder]);\r\n\r\n const updateData = (obj) => {\r\n if (has(obj, 'item_ids')) {\r\n setAttributes(obj)\r\n } else {\r\n if (obj.products.length == 1) {\r\n setAttributes({ products: [{ asin: obj.products[0].asin, title:obj.products[0].title, image: obj.products[0].image }] });\r\n if(alt_text == ''){\r\n let text = obj.products[0].title;\r\n if(text.length > 70){\r\n let i = text.lastIndexOf(' ',70);\r\n text = text.substring(0, i);\r\n }\r\n setAttributes({alt_text : text}); \r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n const updateImages = (prodPos, image) => {\r\n\r\n const obj = [...products];\r\n obj[prodPos]['image'] = image;\r\n setAttributes({ products: obj })\r\n\r\n }\r\n const updateCustomImage = (pos, val) => {\r\n // console.log(pos)\r\n // console.log(val)\r\n const obj = [...products];\r\n //console.log(obj[pos]);\r\n //\tobj[pos]['mytest'] = val;\r\n\r\n obj[pos]['custom_img'] = val;\r\n //\tconsole.log(obj[pos]);\r\n // obj[pos]['customImg'][\"mediaUrl\"] = val.mediaUrl;\r\n setAttributes({ products: obj })\r\n }\r\n const removeCustomImage = (pos) => {\r\n // console.log(\"inside custom\");\r\n if (has(products[pos], 'custom_img')) {\r\n const obj = [...products];\r\n delete obj[pos]['custom_img'];\r\n setAttributes({ products: obj });\r\n }\r\n }\r\n const logAttr = () => {\r\n // const allImages = wp.apiFetch({ path: \"/i2-azon/v1/search/my keyworeds\" })\r\n // .then((data)=>log(data));\r\n //log(features.filter(x=>x.visiable).map(x=> x.id));\r\n console.log(attributes);\r\n }\r\n\r\n const updateValue = (obj) => {\r\n setAttributes(obj);\r\n }\r\n\r\n return (<>\r\n <InspectorControls>\r\n <PanelBody title={__(\"Common\", 'themesfirst')}\r\n initialOpen={true} >\r\n {/* <Button onClick={logAttr} > Log Attr </Button> */}\r\n <MZSearchDialog item_ids={item_ids} products={products} updateValue={updateData} isSingle={true} />\r\n <hr />\r\n {item_ids.length > 0 && <h4>{__('ASIN', 'themesfirst')} : {item_ids[0]} </h4>}\r\n <WidthSize field={width} onChange={obj => setAttributes({ width: obj })} />\r\n <hr />\r\n <ToggleControl label={__(\"Use Link?\", 'themesfirst')}\r\n checked={useLink}\r\n onChange={() => setAttributes({ useLink: !useLink })}\r\n />\r\n {useLink && <> <TextControl\r\n label={__(\"Alt Text\", 'themesfirst')}\r\n help={__(\"Image alt text\", 'themesfirst')}\r\n value={alt_text}\r\n onChange={(val) => setAttributes({ alt_text: val })}\r\n />\r\n <TextControl\r\n label={__(\"URL (By default amazon link)\", 'themesfirst')}\r\n help={__(\"Optional (custom url should start with http)\", 'themesfirst')}\r\n value={customLink}\r\n onChange={(val) => setAttributes({ customLink: val })}\r\n />\r\n </>\r\n }\r\n <ToggleControl\r\n label=\"Show Text?\"\r\n checked={showText}\r\n onChange={() => setAttributes({ showText: !showText })}\r\n />\r\n {showText && <ToggleControl\r\n label=\"Text On Top?\"\r\n help={textOnTop ? 'Text on top.' : 'Text on bottom'}\r\n checked={textOnTop}\r\n onChange={() => setAttributes({ textOnTop: !textOnTop })}\r\n />}\r\n <ToggleControl label={__(\"Use Border?\", 'themesfirst')}\r\n checked={useBorder}\r\n onChange={() => setAttributes({ useBorder: !useBorder })}\r\n />\r\n </PanelBody>\r\n <PanelBody title={__(\"Font Size\", 'themesfirst')}\r\n initialOpen={false} >\r\n <FontSizePicker\r\n fontSizes={FontSizeList}\r\n value={fontSize}\r\n fallbackFontSize={18}\r\n withSlider={true}\r\n onChange={(newFontSize) => {\r\n setAttributes({ fontSize: newFontSize ? newFontSize : 18 });\r\n }}\r\n />\r\n </PanelBody>\r\n <PanelColorSettings\r\n title={__('Color Settings', 'themesfirst')}\r\n initialOpen={false}\r\n colorSettings={useBorder ? [\r\n {\r\n value: bgColor,\r\n onChange: (colorValue) => setAttributes({ bgColor: colorValue !== undefined ? colorValue : '#231f20' }),\r\n label: __('Background Color', 'themesfirst'),\r\n },\r\n {\r\n value: color,\r\n onChange: (colorValue) => setAttributes({ color: colorValue !== undefined ? colorValue : '#ffffff' }),\r\n label: __('Text Color', 'themesfirst'),\r\n },\r\n {\r\n value: borderColor,\r\n onChange: (colorValue) => setAttributes({ borderColor: colorValue !== undefined ? colorValue : '#231f20' }),\r\n label: __('Border Color', 'themesfirst')\r\n }\r\n ] : [\r\n {\r\n value: bgColor,\r\n onChange: (colorValue) => setAttributes({ bgColor: colorValue !== undefined ? colorValue : '#231f20' }),\r\n label: __('Background Color', 'themesfirst'),\r\n },\r\n {\r\n value: color,\r\n onChange: (colorValue) => setAttributes({ color: colorValue !== undefined ? colorValue : '#ffffff' }),\r\n label: __('Text Color', 'themesfirst'),\r\n }\r\n ]}\r\n >\r\n </PanelColorSettings>\r\n </InspectorControls>\r\n\r\n <figure className=\"tf-i2 tf-i2-azon-image mywp-block-image\" style={{ position: \"relative\", width: width.unit == '%a' ? \"100%\" : width.size + width.unit }}>\r\n <div className=\"components-resizable-box__container has-show-handle\" style={{ \"position\": \"relative\", \"boxSizing\": \"border-box\", \"width\": \"100%\" }}>\r\n {products.length == 0 && <MZSearchDialog item_ids={item_ids} products={products} updateValue={updateData} isSingle={true} />}\r\n {products.map((prod, j) => {\r\n return (<div className={(useBorder ? \"has-border \" : \"\") + \"tf-amz-image-wrapper\"} style={{ flexDirection: textOnTop ? \"column-reverse\" : \"column\", borderColor: borderColor }}>\r\n {!has(prod, 'custom_img.mediaId') && (\r\n <MdlImagePickerNew image={prod['image']} asin={prod['asin']} prodPos={j} updateImages={updateImages} size={width.unit != 'px' ? null : width.size} />)}\r\n <div className={prod['custom_img'] == undefined || prod['custom_img'] == \"\" ? \"no-custom-image\" : \"editor-post-featured-image\"}>\r\n {prod['custom_img'] != undefined && <img src={prod['custom_img'].mediaUrl} />}\r\n <MediaUploadCheck>\r\n <MediaUpload onSelect={obj => updateCustomImage(j, { mediaId: obj.id, mediaUrl: obj.url })}\r\n value={prod['custom_img'] != undefined && prod['custom_img'] != \"\" ? prod['custom_img'].mediaId : \"\"}\r\n allowedTypes={['image']}\r\n render={({ open }) => (\r\n <Button icon=\"wordpress\" isSecondary size=\"24\" className=\"no-custom-image\" onClick={open}>\r\n </Button>\r\n )}\r\n />\r\n </MediaUploadCheck>\r\n {has(prod, 'custom_img.mediaId') && <Button icon=\"trash\" className=\"clear-custom-image\" iconSize=\"24\" label=\"Delete\" onClick={() => removeCustomImage(j)}></Button>}\r\n </div>\r\n {showText && <div style={{ clear: 'both', marginTop: '0', backgroundColor: bgColor, color: color, textAlign: 'center' }}>\r\n <RichText onChange={obj => setAttributes({ text: obj })}\r\n tagName=\"p\"\r\n value={text}\r\n style={{ margin: 0, fontSize: fontSize + \"px\", lineHeight: (fontSize * 2) + \"px\" }}\r\n />\r\n </div>}\r\n </div>)\r\n })}\r\n </div>\r\n </figure>\r\n </>\r\n )\r\n },\r\n save: (props) => {\r\n const { attributes: { block_id, width, useLink,alt_text, text, bgColor, color, fontSize, useBorder, products, textOnTop, showText, borderColor }} = props;\r\n // console.log(props);\r\n return (products && products.length > 0 && <MyBlockWrapper isLink={useLink} elm=\"div\" id={`tf-block-image-${block_id}`} className={`tf-block-${block_id} tf-amz-image-block-wrapper`} href=\"##AFFILIATELINK##\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" style={{ width: width.size + width.unit}}>\r\n <div className={(useBorder ? \"has-border \" : \"\") + \"tf-amz-image-wrapper\"} style={{ flexDirection: textOnTop ? \"column-reverse\" : \"column\", borderColor: borderColor }}>\r\n <div className=\"tf-featured-media\">\r\n {products.length == 1 && !has(products[0], 'custom_img.mediaId') && <img src={AmzonImgURL(products[0]['image'].URL, width.unit == \"px\" && width.size <= products[0]['image'].Width ? width.size : \"\", products[0]['image'].EXT)} alt={alt_text} height={products[0]['image'].Height} width={products[0]['image'].Width} />}{products.length == 1 && has(products[0], 'custom_img.mediaId') && <img src={products[0]['custom_img']['mediaUrl']} alt={alt_text} />}</div>\r\n {showText && <div style={{ clear: 'both', marginTop: '0', backgroundColor: bgColor, textAlign: 'center' }}>\r\n <p style={{ margin: 0, fontSize: fontSize + \"px\", color: color, lineHeight: (fontSize * 2) + \"px\" }}>{text}</p>\r\n </div>}\r\n </div>\r\n </MyBlockWrapper>)\r\n }\r\n});\r\n","const {isArray, map} = lodash\r\nconst {RangeControl,Flex,ButtonGroup,Button} = wp.components;\r\n\r\nexport const UnitSize = ({field, max, min, label, units, onChange} = props)=>{\r\n \r\n const {val, unit} = field;\r\n // const maxVal = () =>{\r\n // return unit == \"%\" ? 100 : 500;\r\n // }\r\n // const valuetext = (value) => {\r\n // return `${value}` + unit;\r\n // }\r\n return (\r\n <>\r\n\r\n <Flex style={{marginTop: '8px', marginBottom: '8px'}}> \r\n <div>{label}</div>\r\n <ButtonGroup>\r\n {units && isArray(units) && map(units, function(item){\r\n return <Button isSmall isPrimary={unit == item} onClick={()=> onChange({...field, unit : item })}>{item}</Button>\r\n }) }\r\n </ButtonGroup> \r\n </Flex>\r\n <RangeControl \r\n // label=\"Radious\"\r\n value={ val }\r\n onChange={ ( val ) => onChange({...field, val : val}) }\r\n min={ min }\r\n max={ max }\r\n /> \r\n </>\r\n );\r\n\r\n}","import { AmzonImgURL,PrepareInlineStyle,CleanText,MyBlockWrapper } from '../../component/common'\r\nimport {MZSearchDialog} from '../../component/azsearch/azsearch'\r\nimport{UnitSize} from '../../component/fields/unitSize'\r\nimport {MdlImagePickerNew} from '../../component/MdlImagePicker'\r\nimport classnames from 'classnames';\r\n\r\n\r\nconst { __ } = wp.i18n;\r\nconst { registerBlockType } = wp.blocks;\r\nvar el = wp.element.createElement;\r\nconst {Button,ButtonGroup,Dashicon, Flex, FlexItem, FlexBlock,RangeControl , TextControl, ToggleControl, CheckboxControl, PanelBody } = wp.components;\r\nconst { InspectorControls, MediaUpload, MediaUploadCheck, RichText,PanelColorSettings } = wp.blockEditor;\r\nconst {Fragment} = wp.element\r\nconst { has} = lodash\r\n\r\nregisterBlockType('themesfirst/i2-azon-product-box', {\r\n title: __('Product Box i2AZON', 'themesfirst'),\r\n icon: 'embed-photo',\r\n category: 'themesfirst',\r\n keywords: [\r\n __('Product Box', 'themesfirst'),\r\n __('Amazon Product Box', 'themesfirst'),\r\n __('i2 azon', 'themesfirst'),\r\n ],\r\n attributes: {\r\n item_ids: {\r\n type: 'array',\r\n default: []\r\n },\r\n products: {\r\n type: 'array',\r\n default: []\r\n },\r\n block_id:{\r\n type: 'string',\r\n default: ''\r\n },\r\n useBorder : { \r\n type : 'boolean',\r\n default: false\r\n },\r\n borderColor : {\r\n type: 'string',\r\n default: '#231f20'\r\n },\r\n paddingSize: {\r\n type: 'string',\r\n },\r\n fontSize:{\r\n type: 'number',\r\n default: 18\r\n },\r\n color : {\r\n type: 'string',\r\n default: '#222222'\r\n\t\t\t\t},\r\n\t\t\t\ttextColor : {\r\n\t\t\t\t\ttype: 'string',\r\n\t\t\t\t\tdefault: '#222222'\r\n\t\t\t\t},\r\n bgColor : {\r\n type: 'string',\r\n default: '#fff'\r\n },\r\n useLink:{\r\n type: 'boolean',\r\n default: true\r\n\t\t\t\t},\r\n\t\t\t\thideButton:{\r\n\t\t\t\t\ttype: 'boolean',\r\n\t\t\t\t\tdefault: false\r\n\t\t\t},\r\n customLink:{\r\n type: 'string',\r\n default: ''\r\n },\r\n btnText: {\r\n type: 'string',\r\n default : __('View On Amazon', 'themesfirst'),\r\n },\r\n \r\n boxBorder : { \r\n type : 'object',\r\n default: {\r\n use : true,\r\n color: '#222222',\r\n size: { \r\n unit: 'px',\r\n val : 1\r\n },\r\n useRadius : true,\r\n radius: {\r\n unit: 'px',\r\n val : 4\r\n }\r\n }\r\n }, \r\n btnBorder : { \r\n type : 'object',\r\n default: {\r\n use : true,\r\n color: '#222222',\r\n size: { \r\n unit: 'px',\r\n val : 1\r\n },\r\n useRadius : true,\r\n radius: {\r\n unit: 'px',\r\n val : 4\r\n }\r\n }\r\n }, \r\n icon :{\r\n type : 'object',\r\n default: {\r\n cssClass : 'icofont-brand-amazon',\r\n size: 'icofont-md',\r\n color: '',\r\n bgColor: 'transprent'\r\n }\r\n },\r\n imgWrapperWidth: {\r\n type: 'number',\r\n default: 25\r\n },\r\n imgWidth: {\r\n type: 'number',\r\n default: 300\r\n },\r\n width:{\r\n type : 'object',\r\n default :{\r\n size: 400,\r\n unit: 'px',\r\n full : 780\r\n }\r\n },\r\n isHorizontal: {\r\n type: 'boolean',\r\n default: false\r\n }, \r\n },\r\n edit: (props) => {\r\n // console.log(\"==================================\");\r\n // console.log(props);\r\n\r\n const { attributes,clientId, attributes: {item_ids,width,imgWidth,imgWrapperWidth,hideButton,isHorizontal,btnBorder,textColor, boxBorder, block_id,icon,btnText, useLink,customLink, paddingSize,useBorder,borderColor, products,custom_img, link, text, color, bgColor}, setAttributes } = props;\r\n\r\n if(block_id == '' || block_id == undefined){\r\n\t\t\t\t\tsetAttributes({block_id : clientId});\r\n }\r\n\t\t\t\t\r\n const updateData = (obj) => {\r\n // console.log(obj);\r\n if(has(obj, 'item_ids')){\r\n\t\t\t\tsetAttributes(obj)\r\n }else{\r\n\r\n if(obj.products.length == 1){\r\n // const features = JSON.parse(obj.products[0].features).map(x => '<li>' + CleanText(x) +'</li>' );\r\n const features = JSON.parse(obj.products[0].features).map(x => CleanText(x));\r\n // const feature = JSON.parse(obj.products[0].features).join(\"</li><li>\");\r\n // console.log('=========================');\r\n // console.log(features);\r\n // console.log('=========================');\r\n setAttributes({products : [\r\n {\r\n asin : obj.products[0].asin,\r\n title : obj.products[0].title, \r\n description : '',\r\n features : '<li>' + features.join(\"</li><li>\") + '</li>', \r\n // features : features, \r\n //dbFeatures : JSON.parse(obj.products[0].features),\r\n dbFeatures : features,\r\n image : obj.products[0].image\r\n }]});\r\n }\r\n }\r\n\t\t}\r\n\t\t\t\t\r\n\r\n\t\tconst updateImages = (prodPos, image) => {\r\n\r\n const obj = [... products];\r\n\t\t\tobj[prodPos]['image'] = image;\r\n\t\t\tsetAttributes({ products: obj })\r\n\r\n\t\t}\r\n\t\tconst updateCustomImage = (pos, val) => {\r\n\t\t\t// console.log(pos)\r\n\t\t\t// console.log(val)\r\n\t\t\tconst obj = [... products];\r\n\t\t//console.log(obj[pos]);\r\n\t//\tobj[pos]['mytest'] = val;\r\n\r\n\t\tobj[pos]['custom_img']= val;\r\n\t//\tconsole.log(obj[pos]);\r\n\t\t// obj[pos]['customImg'][\"mediaUrl\"] = val.mediaUrl;\r\n\t\tsetAttributes({ products: obj })\r\n\t}\r\n\tconst removeCustomImage = (pos)=> {\r\n // console.log(\"inside custom\");\r\n\t\tif(has( products[pos], 'custom_img')){\r\n\t\t\tconst obj = [... products];\r\n\t\t\tdelete obj[pos]['custom_img'];\r\n\t\t\tsetAttributes({ products: obj });\r\n\t\t}\r\n\t}\r\n\t\tconst logAttr = () => {\r\n\t\t\t// const allImages = wp.apiFetch({ path: \"/i2-azon/v1/search/my keyworeds\" })\r\n\t\t\t// .then((data)=>log(data));\r\n\t\t\t//log(features.filter(x=>x.visiable).map(x=> x.id));\r\n\t\t\tconsole.log(attributes);\r\n }\r\n\t\t\t\t\r\n\t\t\t\tconst updateValue = (obj) => {\r\n\t\t\t\t\tsetAttributes(obj);\r\n }\r\n\t\t\t\t\t\t\r\n const updateProduct = (content, pos, prop, propPos) => {\r\n const obj = [... products];\r\n if(propPos >= 0){\r\n // console.log('inside featues', propPos );\r\n obj[pos][prop][propPos]= content; \r\n }else{\r\n // console.log('inside nor', propPos );\r\n obj[pos][prop]= content; \r\n }\r\n setAttributes({ products: obj });\r\n }\r\n\r\n // const updateFeatureCount = (val) => {\r\n // console.log(val);\r\n // if(products && products.length > 0){\r\n // const obj = [... products];\r\n // if(obj[0].features?.length < val){\r\n // for(var i = obj[0].features.length; i < val; i++){\r\n // obj[0].features[i] = obj[0].dbFeatures?.length >= i ? obj[0].dbFeatures[i] : ''; \r\n // }\r\n // }else if(obj[0].features?.length > val){\r\n // obj[0].features = obj[0].features.slice(0, val);\r\n // }\r\n // setAttributes({ products: obj });\r\n // }\r\n // }\r\n\r\n const resetFeatures=() =>{\r\n if(products && products.length > 0){\r\n const obj = [... products];\r\n // const features = obj[0].dbFeatures.map(x => CleanText(x) );\r\n // const feature = obj[0].dbFeatures.map(x => '<li>' + x +'</li>' );\r\n // obj[0]['features'] = [... obj[0].dbFeatures];\r\n // obj[0]['features'] = '<li>' + feature +'</li>';\r\n obj[0]['features'] = '<li>' + obj[0].dbFeatures.join(\"</li><li>\") + '</li>';\r\n\r\n // console.log(obj);\r\n\r\n setAttributes({ products: obj });\r\n }\r\n }\r\n\r\n \t\treturn (<>\r\n <InspectorControls>\r\n <PanelBody title = { __(\"Common\", 'themesfirst') }\r\n initialOpen = { true } >\r\n {/* <Button onClick = { logAttr } > Log Attr </Button> */}\r\n <MZSearchDialog item_ids = {item_ids} products = {products} updateValue ={updateData} isSingle={true} />\r\n\t\t\t<hr /> \r\n\t\t\t{item_ids.length > 0 &&\t<h4>{__('ASIN', 'themesfirst')} : {item_ids[0]} </h4>}\r\n {products && products.length > 0 && \r\n \t\t\t\t<Flex>\r\n <FlexBlock>Features\r\n \t\t</FlexBlock>\r\n <FlexItem style={{alignSelf: 'flex-end'}}>\r\n <Button style={{marginBottom: '12px', height: '30px' }} isSecondary onClick = {()=> resetFeatures()} > {__('Reset', 'themesfirst') + ' (' + products[0].dbFeatures?.length + ')'} </Button> \r\n </FlexItem>\r\n\t\t\t\t</Flex>\r\n }\r\n <hr /> \r\n <ButtonGroup style={{textAlign:'right', width: '100%', marginBottom: '10px'}}>\r\n <Button isPrimary={isHorizontal} isSmall isSecondary={!isHorizontal} onClick={()=>setAttributes({isHorizontal : true})}><Dashicon icon=\"menu-alt\" /> {__('Horizontal', 'themesfirst')}</Button>\r\n <Button isPrimary={!isHorizontal} isSmall isSecondary={isHorizontal} onClick={()=>setAttributes({isHorizontal : false})}><Dashicon icon=\"columns\" /> {__('Verticle', 'themesfirst')}</Button>\r\n </ButtonGroup>\r\n {isHorizontal && <RangeControl\r\n\t\t\t\t\t\tlabel={ 'Image Width (' + imgWidth + 'px)' } \r\n withInputField = {true}\r\n allowReset = {false}\r\n\t\t\t\t\t\tvalue={ imgWidth }\r\n\t\t\t\t\t\tonChange={ ( obj ) => setAttributes( { imgWidth: obj})}\r\n\t\t\t\t\t\tmin={100}\t\r\n\t\t\t\t\t\tstep ={10}\t\t\t\r\n\t\t\t\t\t\tmax={products[0]?.image?.Width > 200? products[0]?.image?.Width : 500} \r\n\t\t\t\t\t/>}\r\n {!isHorizontal && <RangeControl\r\n\t\t\t\t\t\tlabel={ 'Image Area (' + imgWrapperWidth + '%)' } \r\n withInputField = {true}\r\n allowReset = {false}\r\n\t\t\t\t\t\tvalue={ imgWrapperWidth }\r\n\t\t\t\t\t\tonChange={ ( obj ) => setAttributes( { imgWrapperWidth: obj})}\r\n\t\t\t\t\t\tmin={15}\t\r\n\t\t\t\t\t\tstep ={1}\t\t\t\r\n\t\t\t\t\t\tmax={50} \r\n\t\t\t\t\t/>}\r\n \r\n <hr /> \r\n <ToggleControl label= {__(\"Without Links?\", 'themesfirst')}\r\n checked={ !useLink }\r\n onChange={ () => setAttributes({ useLink: ! useLink } )}\r\n /> \r\n {useLink && <TextControl\r\n label={__(\"URL (By default amazon link)\", 'themesfirst')}\r\n help ={__(\"Optional (custom url should start with http)\", 'themesfirst')}\r\n value={ customLink }\r\n onChange={ (val) => setAttributes( { customLink: val})}\r\n />} \r\n\t\t\t\t\t\t{useLink && <ToggleControl label= {__(\"Hide Button?\", 'themesfirst')}\r\n checked={ hideButton }\r\n onChange={ () => setAttributes({ hideButton: ! hideButton } )}\r\n />} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n </PanelBody>\r\n\t\t\t\t\t\t<PanelBody title = { __(\"Border Setting\") } initialOpen = { false } >\r\n\t\t\t\t\t\t\t\t\t<CheckboxControl\r\n label=\"Use Box Border?\"\r\n help=\"if you want to use border\"\r\n checked={ boxBorder.use }\r\n onChange={ (val) => setAttributes( {boxBorder : { ...boxBorder, use: val}})}\r\n />\r\n {boxBorder.use && <Fragment> \r\n\t\t\t\t\t\t\t\t\t\t<UnitSize field={boxBorder.size} min={0} max={20} label=\"Size\" units={['px']} onChange={(val)=>setAttributes({boxBorder : { ...boxBorder, size: val}})} /> \r\n <CheckboxControl\r\n label=\"Use Custom Radius?\"\r\n help=\"if you want to use custom radius\"\r\n checked={ boxBorder.useRadius }\r\n onChange={ (val) => setAttributes( {boxBorder : { ...boxBorder, useRadius : val}})}\r\n /> \r\n {boxBorder.useRadius && <UnitSize field={boxBorder.radius} min={0} max={50} label=\"Radius\" units={['%', 'px']} onChange={(val)=>setAttributes({boxBorder : { ...boxBorder, radius: val}})} />} \r\n </Fragment>}\r\n </PanelBody> \r\n\r\n {/* <PanelBody title = { __(\"Font Size\", 'themesfirst') }\r\n initialOpen = { false } >\r\n <FontSizePicker\r\n fontSizes={ FontSizeList }\r\n value={ fontSize }\r\n fallbackFontSize={ 18 }\r\n withSlider = {true}\r\n onChange={ ( newFontSize ) => {\r\n setAttributes( { fontSize: newFontSize? newFontSize : 18 } );\r\n } }\r\n />\r\n </PanelBody> */}\r\n <PanelColorSettings\r\n title={ __( 'Color Settings' , 'themesfirst') }\r\n initialOpen = { false }\r\n\t\t\t\t\t\t\t\t\t // colorSettings={colors}\r\n\t\t\t\t\t\t\t\t\t colorSettings = { boxBorder.use? [\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: bgColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { bgColor: colorValue !== undefined ? colorValue : '#fff' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Background Color' ,'themesfirst'),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: color,\r\n\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { color: colorValue !== undefined ? colorValue : '#222222' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Heading Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: textColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { textColor: colorValue !== undefined ? colorValue : '#222222' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Text Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t,\r\n\t\t\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: boxBorder.color,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { boxBorder : { ...boxBorder, color: colorValue !== undefined ? colorValue : '#222222'}} ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Border Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t] : [\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: bgColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { bgColor: colorValue !== undefined ? colorValue : '#fff' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Background Color' ,'themesfirst'),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: color,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { color: colorValue !== undefined ? colorValue : '#222222' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Heading Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t},\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: textColor,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange: ( colorValue ) => setAttributes( { textColor: colorValue !== undefined ? colorValue : '#222222' } ),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Text Color','themesfirst' ),\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t]}\r\n >\r\n </PanelColorSettings>\r\n </InspectorControls>\r\n\r\n <figure className=\"tf-i2\">\r\n {products.length == 0 && <MZSearchDialog item_ids = {item_ids} products = {products} updateValue ={updateData} isSingle={true} />}\r\n {products.map((prod, j) => {return(\r\n\t\t\t\t <div className={classnames({\"has-border\" : useBorder}, \"tf-i2-product\", {\"tf-i2-horizontal\" : isHorizontal})} style = {PrepareInlineStyle({border: boxBorder, bgColor : bgColor})}>\r\n\t\t\t\t\t<div className={\"tf-i2-image\"} style={{width: isHorizontal? '100%' : imgWrapperWidth + \"%\"}}>\r\n {!has(prod, 'custom_img.mediaId') && (\r\n\t\t\t\t\t <MdlImagePickerNew image={prod['image']} asin={prod['asin']} prodPos={j} updateImages = { updateImages } size={isHorizontal? imgWidth : width.unit != 'px' ? null : width.size} />)}\r\n <div className={prod['custom_img'] == undefined || prod['custom_img'] == \"\"? \"no-custom-image\" : \"editor-post-featured-image\"}>\r\n {prod['custom_img'] != undefined && <img src={prod['custom_img'].mediaUrl} />} \r\n <MediaUploadCheck>\r\n <MediaUpload onSelect={obj=> updateCustomImage(j, {mediaId : obj.id, mediaUrl : obj.url})}\r\n value={prod['custom_img'] != undefined && prod['custom_img'] != \"\"? prod['custom_img'].mediaId : \"\"}\r\n allowedTypes={ ['image'] }\r\n render={({open}) => (\r\n <Button icon=\"wordpress\" isSecondary size=\"24\" className=\"no-custom-image\" onClick={open}> \r\n </Button>\r\n )}\r\n />\r\n </MediaUploadCheck>\r\n {has(prod, 'custom_img.mediaId') && <Button icon=\"trash\" className=\"clear-custom-image\" iconSize=\"24\" label =\"Delete\" onClick = {() => removeCustomImage(j)}></Button>}\r\n </div>\r\n\t\t\t\t</div>\r\n \t<div className=\"tf-i2-content\" style={{width: isHorizontal? '100%' : (100 - imgWrapperWidth) + \"%\"}}>\r\n\t\t\t\t\t <RichText onChange={obj=>updateProduct(obj,j, 'title', -1)}\r\n tagName=\"h5\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"tf-i2-title\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{color: color}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={prod.title}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tformattingControls={['italic']}\r\n />\r\n <RichText onChange={obj=>updateProduct(obj, j , 'features', -1)}\r\n tagName=\"ul\"\r\n multiline= 'li'\r\n className=\"tf-i2-features\"\r\n value={prod.features}\r\n style={{margin: 0, color: textColor}}\r\n />\r\n {useLink && !hideButton && <span className={ classnames('tf-btn-wrapper', 'tf-btn', { \"tf-button-has-border\" : btnBorder.use})} style = {PrepareInlineStyle({border: btnBorder})}><i className={classnames(icon?.cssClass)}></i> \r\n <RichText onChange={obj=>setAttributes({btnText:obj})}\r\n formattingControls={ [ 'bold', 'italic' ] }\r\n tagName=\"span\"\r\n value={btnText}\r\n />\r\n </span>}\r\n\t\t\t\t\t</div>\r\n\r\n </div> \r\n )})} \r\n </figure>\r\n </>\r\n )\r\n },\r\n save: (props) => {\r\n const { attributes: {item_ids,width,btnBorder,boxBorder,useBorder,hideButton, block_id,icon,btnText,imgWrapperWidth,imgWidth, useLink, products,textColor, color, bgColor, isHorizontal}} = props;\r\n const prod = products[0];\r\n\t\t\t\treturn (prod &&\r\n <div className=\"tf-i2\" id={block_id}>\r\n\t\t\t\t\t\t\t\r\n <div className={classnames({\"has-border\" : useBorder}, \"tf-i2-product\", {\"tf-i2-horizontal\" : isHorizontal})} style={PrepareInlineStyle({border:boxBorder, bgColor: bgColor })}>\r\n <div className={\"tf-i2-image\"} style={{width: isHorizontal? '100%' : imgWrapperWidth + \"%\", minHeight: isHorizontal && prod['image'].Height > 0 && prod['image'].Width > 0 ? ( prod['image'].Height / prod['image'].Width * imgWidth) + \"px\" : 'auto' }}>\r\n\t\t\t\t\t\t\t\t<MyBlockWrapper isLink={useLink} href=\"##AFFILIATELINK##\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\r\n\t\t\t\t\t\t\t\t{!has(prod, 'custom_img.mediaId') &&\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<img src={AmzonImgURL(prod['image'].URL, (isHorizontal? imgWidth : width.unit == \"px\" && width.size <= prod['image'].Width? width.size : \"\"), prod['image'].EXT)} alt={prod.title} height={prod['image'].Height} width={prod['image'].Width} />\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t{has(prod, 'custom_img.mediaId') &&<img src={prod['custom_img']['mediaUrl']} alt={prod.title}/>}\r\n\t\t\t\t\t\t\t\t</MyBlockWrapper>\r\n </div>\r\n <div className=\"tf-i2-content\" style={{width: isHorizontal? '100%' : (100 - imgWrapperWidth) + \"%\"}}>\t\t\t\t\t\t\t\t\r\n <RichText.Content href=\"##AFFILIATELINK##\" style={{color:color}} target = \"_blank\" className=\"tf-i2-title\" tagName={useLink ? \"a\" : \"span\"} value={prod.title} rel = \"nofollow noopener noreferrer\" />\r\n <RichText.Content tagName=\"ul\" value={prod.features} style={{color: textColor}} className=\"tf-i2-features\" />\r\n {useLink && !hideButton && <a \r\n href=\"##AFFILIATELINK##\" target = \"_blank\" rel = \"nofollow noopener noreferrer\"\r\n className={ classnames('tf-btn-wrapper', 'tf-btn', { \"tf-button-has-border\" : btnBorder.use})} \r\n style = {PrepareInlineStyle({border: btnBorder})}>\r\n <i className={classnames(icon?.cssClass)}></i> {btnText} \r\n </a>}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n});\r\n"],"sourceRoot":""} -
i2-azon/trunk/i2-azon.php
r2460951 r2463755 6 6 * Author: imibrar 7 7 * Author URI: https://themesfirst.com/ 8 * Version: 0.2. 38 * Version: 0.2.4 9 9 * License: GPL2+ 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt … … 29 29 30 30 define('I2_AZON_PLUGIN_NAME', 'i2 AZON' ); 31 define('I2_AZON_VER', '0. 1.1' );31 define('I2_AZON_VER', '0.2.4' ); 32 32 define('I2_AZON_DEBUG', false ); 33 33 define('I2_AZON_BASE_FILE', __FILE__ ); -
i2-azon/trunk/readme.txt
r2460951 r2463755 1 1 === i2 AZON === 2 2 Contributors: imibrar 3 Tags: Amazon Affilate, Amazon Associate, amazon, amazon Images, Product Box3 Tags: amazon affiliate, amazon associates, image, product, affiliate, amazon, gutenberg 4 4 Requires at least: 5.0 5 5 Tested up to: 5.6 6 Stable tag: 0.2. 36 Stable tag: 0.2.4 7 7 Requires PHP: 5.6 8 8 License: GPLv2 … … 26 26 27 27 == Changelog == 28 v2.4 fixed color clear undefined issue 28 29 v2.3 image alignment fixed in small screen 29 30 v2.2 link formater bug fixed
Note: See TracChangeset
for help on using the changeset viewer.