PageSourceSearch

https://www.bannerbuzz.com/_next/static/chunks/65864.20260925.13ce937c9b059e2e.js

js bannerbuzz.com collected 2026-09-25 14:07:31 UTC 42,181 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65864],{65864:function(e,t,l){var a=l(85893),i=l(67294),n=l(45697),o=l.n(n),r=l(87060),d=l(2664),s=l(14890),u=l(36409),p=l(11752),c=l.n(p),m=l(31298),v=l(15396),g=l(63750),h=l(94074),f=l(17185),T=l(70267),b=l(95460),_=l(7306),D=l(17944),I=l(45248),y=l(92068),C=l(79619),j=l(341),w=l(42397),S=l(66431),P=l(71969),x=l(29414),N=l(61733),L=l(58923),k=l(21969),O=l(31480),F=l(63834),A=l(28326),B=l(56052),E=l(93802),G=l(40746),M=l(45771),z=l(95114),R=l(47037),U=l(70075),W=l(59480),Y=l(17679),J=l(84281),q=l(40235),H=l(51863),Z=l(70312);let{publicRuntimeConfig:K}=c()(),X="".concat(K.CDN_FOR_STATIC_DATA,"/static/images/pdp-cro/blankCTABIconMobile.svg");function V(e){return!!e&&"object"==typeof e&&(!1===e.status||!1===e.success)}function $(e){let t=e&&"object"==typeof e?e:{},l={...t.data&&"object"==typeof t.data?t.data:{},...t};return{...l,template_json:l.template_json||l.templateJson||'{"version":"5.3.0","objects":[]}',template_width:null!=l.template_width?l.template_width:3,template_height:null!=l.template_height?l.template_height:2,template_size_unit:l.template_size_unit||"ft"}}function Q(e){if(null==e||""===e)return"";if("string"==typeof e)return e.trim();try{return JSON.stringify(e)}catch(e){return""}}function ee(e){var t,l,a,i,n,o;let r=e&&"object"==typeof e?e:{},d={...r.data&&"object"==typeof r.data?r.data:{},...r},s=d.designData&&"object"==typeof d.designData?d.designData:null;return{front:Q(null!==(a=null!==(l=null!==(t=d.canvas_json_data)&&void 0!==t?t:d.canvasJson)&&void 0!==l?l:null==s?void 0:s.canvas_json_data)&&void 0!==a?a:null==s?void 0:s.canvasJson),back:Q(null!==(o=null!==(n=null!==(i=d.canvas_json_data2)&&void 0!==i?i:d.canvasJson2)&&void 0!==n?n:null==s?void 0:s.canvas_json_data2)&&void 0!==o?o:null==s?void 0:s.canvasJson2)}}function et(e){let t=e&&String(e).trim();if(!t)return!1;try{let e=JSON.parse(t);return Array.isArray(e.objects)&&e.objects.length>0}catch(e){return t.length>120}}function el(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[...new Map(e.map(e=>[e.template_id,e])).values()]}function ea(e){var t,l,n;let{actions:o,dispatch:r,productData:d,breadcrumbsData:s,storedata:p,selectedTemplate:c,getTemplateData:v,onTemplateClickAdb:Q,setimageView:ea,onRef:ei,customerGroupId:en,customerId:eo,customerEmail:er,isLogin:ed,cookies:es,reviewId:eu,reviewDetail:ep,storedOption:ec,cartData:em,getUpdateOptionData:ev,pdpDesignToolSizes:eg,pdpDesigntoolObject:eh,pdpStoreTemplateRatio:ef,pdpStoreSizesDefaultUnit:eT,pdpStoreProductId:eb,pdpGetDesignLoaded:e_,onPdpTemplateFilterSidebarOpenChange:eD,pdpCanvasData:eI,selectedCartOption:ey=""}=e,[eC,ej]=(0,i.useState)(()=>(function(e){var t,l;let{productData:a}=e;return{templateList:[],isLoaded:!1,templateTagPills:[],selectedTagIds:[],pdpFilterSections:[],pdpCategoriesLoading:!0,hoverTemplate:null==e?void 0:null===(t=e.selectedTemplate)||void 0===t?void 0:t.template_thumb_image,totalPage:0,totalTemplates:0,selectedImageId:Number(null==e?void 0:null===(l=e.selectedTemplate)||void 0===l?void 0:l.template_id)||null,loading:!1,pageNo:1,perPage:50,templateSearch:"",lastList:!1,isShowSearch:!1,prevPage:0,page:0,prevY:0,enableEffectClass:!1,productId:(null==a?void 0:a.assignment)&&(null==a?void 0:a.assignment[0])&&(null==a?void 0:a.assignment[0].graphics_id)?null==a?void 0:a.assignment[0].graphics_id:null==a?void 0:a.entity_id,arrowClick:!1,isPdpDesignTool:!1,mobileMode:"templates",isDtTemplateId:null,isTemplateData:null,pdpDesignBootstrap:null,pdpDesignBootstrapLoading:!0,pdpTemplateRatio:[],pdpTemplateSizesDefaultUnit:""}})(e)),ew=(0,i.useCallback)((e,t,l)=>{"function"==typeof ea&&ea(e,t,l)},[ea]),[eS,eP]=(0,i.useState)(!1),[ex,eN]=(0,i.useState)(()=>(0,N.wH)([])),[eL,ek]=(0,i.useState)(!1),eO=(0,i.useRef)(ex),eF=(0,i.useRef)([]),eA=(0,i.useRef)(null),eB=(0,i.useRef)(!1),eE=(0,i.useRef)(!1),eG=(0,i.useRef)([]),eM=(0,i.useRef)(null),ez=(0,i.useRef)(null);(0,i.useEffect)(()=>{eO.current=ex},[ex]);let eR=(0,i.useRef)(eD);eR.current=eD,(0,i.useEffect)(()=>{var e;null===(e=eR.current)||void 0===e||e.call(eR,eS)},[eS]);let eU=(0,i.useMemo)(()=>{let e=Number(eb),t=Number(eC.productId);return Number.isFinite(e)&&Number.isFinite(t)&&e===t&&Array.isArray(ef)&&ef.length>0?ef:eC.pdpTemplateRatio},[eb,ef,eC.pdpTemplateRatio,eC.productId]),eW=(0,i.useMemo)(()=>{var e;let t=(0,N.IC)(null==eh?void 0:null===(e=eh.productOptions)||void 0===e?void 0:e.sizes);if(t)return t;let l=Number(eb),a=Number(eC.productId);return Number.isFinite(l)&&Number.isFinite(a)&&l===a&&eT?eT:eC.pdpTemplateSizesDefaultUnit||"ft"},[null==eh?void 0:null===(t=eh.productOptions)||void 0===t?void 0:t.sizes,eb,eT,eC.pdpTemplateSizesDefaultUnit,eC.productId]),eY=null==eh?void 0:null===(l=eh.productOptions)||void 0===l?void 0:l.sizes,eJ=(0,i.useMemo)(()=>(0,F.AG)(eC.pdpFilterSections,eU,eY,eW,{filterSelection:ex}),[ex,eU,eW,eY,eC.pdpFilterSections]),eq=(0,i.useMemo)(()=>(0,F.X1)(ex,eJ,eW||"ft",eY,null),[ex,eJ,eW,eY]),eH=(0,i.useMemo)(()=>[...(0,N.Xs)(ex,eJ,eq||"ft"),...(0,L.cS)(eC.selectedTagIds,eC.templateTagPills)],[ex,eJ,eq,eC.selectedTagIds,eC.templateTagPills]),eZ=(0,i.useMemo)(()=>"DTPDP"===String(new URLSearchParams(window.location.search).get("method")||"").toUpperCase(),[]),eK=(0,i.useMemo)(()=>(0,T.uv)(new URLSearchParams(window.location.search)),[]),eX=(0,i.useRef)(eC);eX.current=eC;let eV=(0,i.useRef)([]),e$=(0,i.useRef)(null),eQ=(0,i.useRef)(null),e0=(0,i.useRef)(null),e1=(0,i.useRef)(null),e4=(0,i.useRef)(e);e4.current=e;let e6=(0,i.useRef)(null);e6.current||(e6.current={},Object.defineProperty(e6.current,"state",{get:()=>eX.current,enumerable:!0}),Object.defineProperty(e6.current,"props",{get:()=>e4.current,enumerable:!0}));let e7=(0,i.useCallback)((e,t)=>{t&&eV.current.push(t),ej(t=>{let l={...t,...e};return eX.current=l,l})},[]);(0,i.useEffect)(()=>
1{if(0===eV.current.length)return;let e=[...eV.current];eV.current=[],e.forEach(e=>{try{e()}catch(e){}})},[eC]);let e8=(0,i.useCallback)(e=>{eB.current=!1;let t=(eF.current||[]).find(e=>e&&"aspectRatio"===e.filterKind);t&&0===(Array.isArray(e[t.id])?e[t.id]:[]).length&&(eE.current=!0);let l=(0,F.AE)(e);(0,F.ts)(eO.current,l,eF.current)||(eO.current=l,eN(l),e7({pageNo:1},()=>{var e;null===(e=ez.current)||void 0===e||e.call(ez,1,"filter")}))},[eZ,e7,eN]),e2=(0,i.useCallback)(e=>{if((0,L.TQ)(e)){eB.current=!1,e7({selectedTagIds:(eX.current.selectedTagIds||[]).filter(t=>t!==e.value),pageNo:1},()=>{var e;null===(e=ez.current)||void 0===e||e.call(ez,1,"filter")});return}if("myDesigns"===e.sectionId){e8({...eO.current,myDesignsOnly:!1});return}e8({...eO.current,[e.sectionId]:(eO.current[e.sectionId]||[]).filter(t=>t!==e.value)})},[e8,eZ,e7]),e3=(0,i.useCallback)(()=>{(0,F.fW)(eB,eA.current),eE.current=!0;let e=(eF.current||[]).map(e=>e.id),t=(0,N.wH)(e),l=!(eX.current.selectedTagIds||[]).length;(0,F.ts)(eO.current,t,eF.current)&&l||(eO.current=t,eN(t),e7({selectedTagIds:[],pageNo:1},()=>{var e;null===(e=ez.current)||void 0===e||e.call(ez,1,"filter")}))},[e7,eN]),e5=(0,i.useCallback)(e=>{e8(e)},[e8]),e9=(0,i.useCallback)((e,t,l)=>{var a,i;let n=eF.current,o=eO.current,r=(0,F.X1)(o,n,eW||"ft",null==eh?void 0:null===(a=eh.productOptions)||void 0===a?void 0:a.sizes,eZ?eA.current:null);return(0,N.PU)(n,o,e,t,l,null==eh?void 0:null===(i=eh.productOptions)||void 0===i?void 0:i.sizes,r)},[eZ,null==eh?void 0:null===(n=eh.productOptions)||void 0===n?void 0:n.sizes,eW]),te=(0,i.useCallback)(()=>"".concat(window.location.protocol,"//").concat(window.location.host,"/"),[]),tt=(0,i.useCallback)(()=>{var e,t,l,a,i;let n=(null==ep?void 0:ep[eu])||{},o=(null==ec?void 0:ec[eu])||{},r="function"==typeof ev?ev(!0):null,s=(null==em?void 0:em[eu])||{},u=new URLSearchParams(window.location.search),c=u?(0,T.ze)(u):null,m=null!=c,v=(0,M.YP)(o,r,m,e_),g={};g.isBBPrivilage=(0,b.t4)(en),g.authToken=null==p?void 0:p.authToken,g.website_id=null==p?void 0:p.designToolWebsiteID,g.domain=null==p?void 0:p.domain,g.role="tool_designer"==en?1:0,g.customerid=(0,D.Wf)(es,eo),g.customer_email=er||"",g.hostUrl=te(),g.isLoggedIn=ed?1:0,g.deviceType=null===(e=(0,_.dz)())||void 0===e?void 0:e.deviceType,function(e,t){var l,a,i,n;let{urlDesignId:o,cartDataObj:r}=t;if(null!=o){e.eventType=2,e.rToDTJourney=2,e.user_comment=r&&Object.keys(r).length>0&&null!==(l=null==r?void 0:r.userComment)&&void 0!==l?l:"";return}if(r&&Object.keys(r).length>0){e.eventType=null!==(a=null==r?void 0:r.eventType)&&void 0!==a?a:1,e.user_comment=null!==(i=null==r?void 0:r.userComment)&&void 0!==i?i:"",e.rToDTJourney=null!==(n=null==r?void 0:r.eventType)&&void 0!==n?n:4;return}e.eventType=1,e.user_comment="",e.rToDTJourney=4}(g,{urlDesignId:c,cartDataObj:s}),g._cid=(null==n?void 0:n.entity_id)||(null==d?void 0:null===(l=d.assignment)||void 0===l?void 0:null===(t=l[0])||void 0===t?void 0:t.graphics_id)||(null==d?void 0:d.entity_id)||null;let h=(0,I.vb)(null==v?void 0:v.sku,es);h&&(g.cache_params=h),g.category_name=null==n?void 0:n.name,g.ecommerce=(null==n?void 0:n.ecommerce)||(0,y.NX)(d);let{sizes:f,...C}=v||{};Object.assign(g,C);let j=m?(0,M.Lm)(c):null,w=(0,M.hV)(f,j);g.sizes=eg;let S=(0,M.G)(m,w,eg);void 0!==S&&(g.sizes=S);let P=null!==(i=null==eh?void 0:null===(a=eh.productOptions)||void 0===a?void 0:a._designId)&&void 0!==i?i:null==eh?void 0:eh.designId,x=null;if(null!=c)x=c;else if(null!=P&&""!==String(P).trim()){let e=Number.parseInt(String(P),10);Number.isFinite(e)&&e>0&&(x=e)}return null!=x&&(g._designId=x),g.isDtPdpFlow=1,g},[em,es,er,en,eo,te,ev,ed,e_,eh,eg,d,ep,eu,ec,p]),tl=(0,i.useCallback)(async()=>{let e=null,t=[],l="",a=null,i=null,n=(0,T.ze)(new URLSearchParams(window.location.search)),s=!1;null!=n&&(r((0,R.M8)(!0)),o.setDesigntoolObject((0,q.sx)()));try{var u,c,m,v,f,b,_,D,I;let y,C;let j=tt(),w=await (0,E.C)(p,j);w&&(j.sizes=w);let S=null==n,P=null!==(u=null==j?void 0:j.website_id)&&void 0!==u?u:null==p?void 0:p.designToolWebsiteID,x=(0,T.Av)(d);if(S&&P&&null!=x&&""!==String(x).trim()?[C,y]=await Promise.all([o.pdpGetFontData({website_id:P,product_id:x}).catch(()=>null),o.pdpGetDesignData(j)]):(C=await o.pdpGetFontData({website_id:P,product_id:x}),y=await o.pdpGetDesignData(j)),y){let d=null!=n?(0,G.d)(y,j.sizes):y;(0,M.nB)(n,null==d?void 0:null===(c=d.params)||void 0===c?void 0:c.sizes),a=$(d),eM.current=d;let u=null==d?void 0:null===(m=d.params)||void 0===m?void 0:m.sizes;t=(0,N.Kc)(d),eG.current=t,l=(0,h.aM)(d,null,u)||"";let p=null==d?void 0:null===(v=d.params)||void 0===v?void 0:v.product_id;if(null!=p&&""!==String(p).trim()){let t=Number(p);Number.isFinite(t)&&(e=t)}let T=null!==(_=null==d?void 0:null===(f=d.params)||void 0===f?void 0:f.website_id)&&void 0!==_?_:P,w=null==d?void 0:null===(b=d.params)||void 0===b?void 0:b.product_id;S&&!C&&(C=await o.pdpGetFontData({website_id:T,product_id:w}));let x=(0,B.Xf)({...d,designComment:null==j?void 0:j.user_comment,currentDeviceType:null==j?void 0:j.deviceType}),L=function(e){var t,l,a;let i=function(e){var t,l,a;if(!e||"object"!=typeof e)return null;let{front:i,back:n}=ee(e);
1if(!et(i))return null;let o={...e.data&&"object"==typeof e.data?e.data:{},...e},r=o.designData&&"object"==typeof o.designData?o.designData:{},d={template_json:i,templateJson:i,canvas_width_pixel:null!==(t=r.canvas_width_pixel)&&void 0!==t?t:o.canvas_width_pixel,canvas_height_pixel:null!==(l=r.canvas_height_pixel)&&void 0!==l?l:o.canvas_height_pixel,isSavedCanvasJson:!0};et(n)&&(d.back_template_json=n);let s=null!==(a=o.banner_colors)&&void 0!==a?a:o.bannerColors;return null!=s&&(d.banner_colors=s),{original:d,data:{original:d}}}(e);if(i)return i;if(!e||"object"!=typeof e)return null;let n=$(e),o={...e.data&&"object"==typeof e.data?e.data:{},...e},r=o.designData&&"object"==typeof o.designData?o.designData:{},d="string"==typeof n.template_json&&""!==n.template_json.trim()?n.template_json.trim():'{"version":"5.3.0","objects":[]}',s={template_json:d,templateJson:d,canvas_width_pixel:null!==(t=r.canvas_width_pixel)&&void 0!==t?t:o.canvas_width_pixel,canvas_height_pixel:null!==(l=r.canvas_height_pixel)&&void 0!==l?l:o.canvas_height_pixel,isSavedCanvasJson:et(d)},{back:u}=ee(e);et(u)&&(s.back_template_json=u);let p=null!==(a=o.banner_colors)&&void 0!==a?a:o.bannerColors;return null!=p&&(s.banner_colors=p),{original:s,data:{original:s}}}(d);if(i=L,o.setDesigntoolObject({...x,templateRatio:t,pdpGalleryTemplateId:null,templateToLoad:null,templateToLoadNonce:null,pdpTemplateAppliedCanvasId:null,pdpFrontGalleryTemplateId:null,...null!=n?{pdpEditGallerySelectionUnlocked:!1,pdpEditHydrationPending:!0,pdpEditHydrationTemplateNonce:null}:{}}),C&&o.setFontsData(C),null!=n&&await (0,H.T7)(o.pdpGetTemplateById,d,x),L){s=!0;let e=(0,q.Pp)(L);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{o.setDesigntoolObject(e)})})}try{let e=(0,h.au)(d,x);if(null!=e&&""!==String(e).trim()){let t=(0,h.T8)(x.productOptions,e,x),l=(0,h.yZ)(x,t),a=await o.pdpGetPriceDetails(l);(0,g.JQ)(a)&&(0,g.wi)(r,a,{twoSidedOptionCode:null==x?void 0:null===(I=x.matchedTwoSidedList)||void 0===I?void 0:null===(D=I[0])||void 0===D?void 0:D.option_code})}}catch(e){}}}catch(e){}finally{let o={pdpDesignBootstrapLoading:!1,pdpDesignBootstrap:a,pdpTemplateRatio:t,pdpTemplateSizesDefaultUnit:l};null!=a&&(o.isPdpDesignTool=!0,o.mobileMode=null!=n?"personalize":"templates",i&&(o.isTemplateData=i)),null!=e&&(o.productId=e),e7(o),null!=a&&null!=n&&r((0,z.YM)({isCanvasPopupClose:!1})),null==n||s||r((0,R.M8)(!1))}return e},[o,tt,r,e7,d,null==p?void 0:p.designToolWebsiteID]),ta=(0,i.useRef)(0),ti=(0,i.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800;ta.current=Date.now()+e},[]),tn=(0,i.useCallback)(e=>{ti(),requestAnimationFrame(()=>{(0,J.DJ)(e,eQ.current)})},[ti]),to=(0,i.useCallback)(()=>{var e,t;let l=eX.current,a=null!==(e=l.selectedImageId)&&void 0!==e?e:l.isDtTemplateId;if(!a)return{templateName:"",templateID:""};let i=l.templateList.find(e=>Number(e.template_id)===Number(a));return{templateName:(null==i?void 0:i.name)||(null==i?void 0:i.title)||"",templateID:null!==(t=null==i?void 0:i.template_id)&&void 0!==t?t:""}},[]),tr=(0,i.useCallback)(()=>(0,C.W)(e.pdpDesigntoolObject,"function"==typeof ev?ev(!1):null),[ev,e.pdpDesigntoolObject]),td=(0,i.useCallback)(e=>{(0,C.GR)({...d,optionData:tr()},s,(null==e?void 0:e.name)||(null==e?void 0:e.title)||"",null==e?void 0:e.template_id)},[s,tr,d]),ts=(0,i.useCallback)(()=>{let{templateName:e,templateID:t}=to();(0,C.pL)({...d,optionData:tr()},s,e,t)},[s,to,tr,d]),tu=(0,i.useRef)(null),tp=(0,i.useCallback)(()=>{eZ&&(Date.now()<ta.current||(tu.current&&clearTimeout(tu.current),tu.current=setTimeout(()=>{tu.current=null,ts()},400)))},[eZ,ts]),tc=(0,i.useCallback)(()=>{let e=document.querySelector("#templateCategorySlider"),t=document.getElementById("leftDesignArrow"),l=document.getElementById("rightDesignArrow");if(!e||!t||!l)return;let a=Math.max(0,e.scrollWidth-e.clientWidth),i=Math.min(a,Math.max(0,e.scrollLeft));t.disabled=i<=1,l.disabled=a<=10||i>=a-10},[]),tm=(0,i.useCallback)(()=>(0,J.E3)(eQ.current),[]),tv=(0,i.useCallback)(e=>{let t=eX.current.templateList[e];t&&(t.templateIndex=e),(null==t?void 0:t.template_id)!==1?v(t):v({}),e7({selectedIndex:e,selectedImageId:null==t?void 0:t.template_id,selectedTemplate:t},()=>{!1==tm()&&tn("activetemplate")})},[v,tm,e7,tn]),tg=(0,i.useCallback)(e=>{var t,l,a;let i=null==p?void 0:p.designToolWebsiteID,n=null!=e&&Number.isFinite(Number(e))?Number(e):eX.current.productId;if(!i||!n)return e7({pdpCategoriesLoading:!1,templateTagPills:[],pdpFilterSections:[]}),Promise.resolve();e7({pdpCategoriesLoading:!0,loading:!0});let r=new URLSearchParams(window.location.search),d=(0,J.yr)({selectedTemplate:c,perPageDefault:null!==(a=eX.current.perPage)&&void 0!==a?a:50,urlSearch:r}),s=null==eh?void 0:null===(t=eh.productOptions)||void 0===t?void 0:t.sizes,u=(0,h.aM)(eM.current,eh,s)||eX.current.pdpTemplateSizesDefaultUnit||eW||"ft",m=(0,N._b)(eX.current.pdpTemplateRatio,eG.current,eM.current);eZ&&((0,F.PD)(eA,(0,F.jm)({sizesState:s,resData:eM.current,designtoolObject:eh,templateRatio:m})),(0,F.fW)(eB,eA.current));let v=(0,F.AG)([],m,s,u,{preserveRatioLabels:null===(l=eA.current)||void 0===l?void 0:l.aspectRatio});eF.current=v;let g=(0,N.wH)(v.map(e=>e.id));eZ&&eA.current&&!eB.current&&!eE.current&&(g=(0,F.C5)(g,v,eA.current)),eO.current=g,eN(g);let f={website_id:String(i),product_id:n,pageno:1,perpage:d,...(0,N.PU)(v,g,null,"",eX.current.templateTagPills,s,(0,F.X1)(g,v,u,s,eA.current))};return o.pdpGetPDPTemplates(f).then(e=>{if(V(e)||!e){e7({pdpCategoriesLoading:!1,templateTagPills:[],pdpFilterSections:[],loading:!1});return}let t=(0,N.zF)(e).map(N.v_),l=(0,N.Ad)(t),a=(0,N.aj)(e),i=(0,F.AG)(l,m,s,u,{filterSelection:eO.current});eF.current=i;let n=(0,N.wH)(i.map(e=>e.id));eZ&&eA.current&&!eB.current&&!eE.current&&(n=(0,F.C5)(n,i,eA.current)),eO.current=n,eN(n);let o=(0,N.lv)(e),r=[...o.templates];eK||(r=(0,N.C7)(r,X)),e7({pdpCategoriesLoading:!1,pdpFilterSections:l,templateTagPills:a,templateList:el((0,N.vu)(r,n,i)),totalTemplates:o.total_template,isLoaded:!0,loading:!1,totalPage:o.total_page,pageNo:1}
1,()=>{tn("activetemplate"),tc()})}).catch(()=>{e7({pdpCategoriesLoading:!1,templateTagPills:[],pdpFilterSections:[],loading:!1})})},[o,eK,eZ,e7,tn,eh,eW,c,eN,p.designToolWebsiteID]);(0,i.useEffect)(()=>{let e=e1.current;if(null===e){e1.current=ey;return}if(e1.current=ey,eZ){if(e===U.aj&&ey!==U.aj){e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X});return}e!==U.aj&&ey===U.aj&&e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X},()=>{tg(eX.current.productId)})}},[ey,eZ,e7,tg]),(0,i.useEffect)(()=>{var e,t,l;if(!eZ||ey!==U.aj)return;let a=!(null==c?void 0:c.template_id),i=Number(null!==(t=null!==(e=null==eh?void 0:eh.pdpGalleryTemplateId)&&void 0!==e?e:null==eh?void 0:eh.pdpFrontGalleryTemplateId)&&void 0!==t?t:1),n=Number(null!==(l=null==eh?void 0:eh.pdpBackGalleryTemplateId)&&void 0!==l?l:1),{front:o,back:r}=(0,Y.cN)(eh);if(!a||i>1||n>1||o>1||r>1)return;let d=eX.current;1===d.selectedImageId&&null!=eh&&eh.pdpGalleryCyoActiveSide||null==d.selectedImageId&&null==d.isDtTemplateId||e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X})},[eZ,ey,null==c?void 0:c.template_id,null==eh?void 0:eh.pdpGalleryTemplateId,null==eh?void 0:eh.pdpFrontGalleryTemplateId,null==eh?void 0:eh.pdpBackGalleryTemplateId,null==eh?void 0:eh.pdpGalleryCyoActiveSide,null==eh?void 0:eh.templateIds,e7]),(0,i.useEffect)(()=>{if(!eZ)return;let e=()=>{e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X})};return window.addEventListener("bannerbuzz-pdp-gallery-selection-reset",e),()=>window.removeEventListener("bannerbuzz-pdp-gallery-selection-reset",e)},[eZ,e7]),(0,i.useEffect)(()=>{if(!eZ||!(0,Y.Yx)(void 0,eh))return;let e=eX.current;(null!=e.selectedImageId||null!=e.isDtTemplateId)&&e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X})},[eZ,e7,eh,null==eh?void 0:eh.pdpEditGallerySelectionUnlocked]),(0,i.useEffect)(()=>{if(!eZ||!eh||(0,Y.Yx)(void 0,eh))return;let e=eX.current;if((0,Y.o_)(eh,e))return;let t=(0,Y.GF)(eh,e.templateList,e);(t.selectedImageId||0===t.selectedImageId)&&(t.selectedImageId!==e.selectedImageId||t.isDtTemplateId!==e.isDtTemplateId)&&e7(t)},[eZ,e7,eh,null==eh?void 0:eh.pdpEditGallerySelectionUnlocked,null==eh?void 0:eh.pdpActiveTemplateSide,null==eh?void 0:eh.pdpBackGalleryTemplateId,null==eh?void 0:eh.pdpFrontGalleryTemplateId,null==eh?void 0:eh.pdpGalleryCyoActiveSide,null==eh?void 0:eh.pdpUseSameTemplateForBack,null==eh?void 0:eh.templateIds]);let th=(0,i.useCallback)(function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];let{designToolWebsiteID:t}=p,l=eX.current,{perPage:a,productId:i}=l;e7({loading:!0});let n={website_id:String(t),product_id:Number(i),pageno:1,perpage:a,...e9(l.selectedTagIds,e,l.templateTagPills)};o.pdpGetPDPTemplates(n).then(t=>{if(V(t)||null==t){e7({isLoaded:!0,loading:!1});return}let l=(0,N.lv)(t);if(!l.templates){e7({lastList:!0,loading:!1,isLoaded:!0});return}let a=[...l.templates];eK||(a=(0,N.C7)(a,X,{omitWhenSearchActive:!0,searchResult:e}));let i=el((0,N.vu)(a,eO.current,eF.current)),n=(0,Y.Yx)(void 0,eh)?{selectedImageId:null,isDtTemplateId:null}:(0,Y.Lr)(i,eh,eX.current);e7({templateList:i,totalTemplates:l.total_template,isLoaded:!0,loading:!1,totalPage:l.total_page,pageNo:1,...n})})},[o,e9,eK,e7,eh,p]),tf=(0,i.useMemo)(()=>(0,u.Z)(e=>{(e.length>=3||e.length<1)&&th(e)},1e3),[th]),tT=(0,i.useCallback)((e,t)=>{e7({[t]:e}),tf(e)},[tf,e7]),tb=(0,i.useCallback)(e=>{let t=eX.current,l={templateCategory:null==t?void 0:t.selectedCategory,templateSubcategory:(0,L.r_)(null==t?void 0:t.selectedTagIds),searchTerm:e},a=null==ec?void 0:ec[eu],i=null==ep?void 0:ep[eu],n={};(a||i)&&(n={productCategory:(0,j.Z)(null==i?void 0:i.breadcrumbs),productName:null==i?void 0:i.name,productID:null==a?void 0:a.sku}),(0,C.kH)(n,l)},[ep,eu,ec]),t_=(0,i.useMemo)(()=>(0,u.Z)(tb,500),[tb]),tD=(0,i.useRef)(null),tI=(0,i.useCallback)(async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];let t=arguments.length>2?arguments[2]:void 0,l=eX.current;e7({loading:!0});let a=l.templateSearch.length>=3?l.templateList.length:l.templateList.length-1;if(l.totalTemplates===a){e7({loading:!1});return}let i={website_id:String(p.designToolWebsiteID),product_id:Number(l.productId),pageno:e,perpage:l.perPage,...e9(l.selectedTagIds,l.templateSearch,l.templateTagPills)};o.pdpGetPDPTemplates(i).then(l=>{if(V(l)||null==l){let t=eX.current;if(!t.lastList&&t.prevPage!==e){var a;null===(a=tD.current)||void 0===a||a.call(tD,t.pageNo+1)}e7({isLoaded:!0,loading:!1});return}let i=(0,N.lv)(l);if(!i.templates){e7({lastList:!0,loading:!1});return}let n=eX.current,o=[...n.templateList,...i.templates];e7({templateList:el((0,N.vu)(o,eO.current,eF.current)),totalTemplates:i.total_template,pageNo:n.pageNo+1,isLoaded:!0,loading:!1,prevPage:e,totalPage:i.total_page},()=>{t&&tv(t)})})},[o,e9,e7,tv,p.designToolWebsiteID]);tD.current=tI;let ty=(0,i.useCallback)(e=>{let t=eX.current,l=t.pageNo;e.top>=1&&(l+=1)!=t.pageNo&&tI(l)},[tI]),tC=(0,i.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"other",{designToolWebsiteID:l}=p,a=eX.current,{productId:i}=a,{perPage:n}=a;e7({loading:!0});let r=new URLSearchParams(window.location.search),d=(0,J.yr)({selectedTemplate:c,perPageDefault:n,urlSearch:r});d!==n&&(e=1,n=d);let s={website_id:String(l),product_id:Number(i),pageno:e,perpage:n,...e9(a.selectedTagIds,a.templateSearch,a.templateTagPills)};o.pdpGetPDPTemplates(s).then(e=>{if(V(e)||null==e){e7({isLoaded:!0,loading:!1});return}let l=(0,N.lv)(e),a=[...l.templates];eK||(a=(0,N.C7)(a,X));let i=el((0,N.vu)(a,eO.current,eF.current)),n=(0,Y.Yx)(void 0,eh)?{selectedImageId:null,isDtTemplateId:null}:(0,Y.Lr)(i,eh,eX.current);e7({templateList:i,totalTemplates:l.total_template,isLoaded:!0,loading:!1,totalPage:l.total_page,...n},()=>{"selectedCategory"!==t&&"filter"!==t&&tn("activetemplate"),("initial"==t||"selectedCategory"==t||"filter"==t)&&tc()})})},[o,e9,eK,e7,tn,eh,c,tv,p]);(0,i.useEffect)(()=>{ez.current=tC},[tC]),(0,i.useEffect)(()=>{eF.current=eJ||[]},[eJ]),(0,i.useEffect)(()=>{let e=document.querySelector("#templateCategorySlider");if(!e)return;let t=()=>
1{let t=document.getElementById("leftDesignArrow"),l=document.getElementById("rightDesignArrow");if(!t||!l)return;let a=Math.max(0,e.scrollWidth-e.clientWidth),i=Math.min(a,Math.max(0,e.scrollLeft));t.disabled=i<=1,l.disabled=a<=1||i>=a-1};return e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),window.requestAnimationFrame(t),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[eC.templateTagPills.length]),(0,k.r)(eC.templateTagPills.length),(0,i.useEffect)(()=>{let e=(eJ||[]).map(e=>e.id);eN(t=>{let l={...t},a=!1;return e.forEach(e=>{Object.prototype.hasOwnProperty.call(l,e)&&Array.isArray(l[e])||(l[e]=[],a=!0)}),a&&(eO.current=l),a?l:t})},[eJ]);let tj=(0,i.useCallback)(()=>{var e;let t=new URLSearchParams(window.location.search);if(null!=(0,T.ze)(t))return Promise.resolve();let l=t.get("TID"),a=null!==(e=t.get("MID"))&&void 0!==e?e:l,i=Number(l),n=Number(a);return!Number.isFinite(i)||i<=1||Number(null==c?void 0:c.template_id)===i?Promise.resolve():(r((0,R.M8)(!0)),e7({loading:!0,selectedImageId:n}),o.pdpGetTemplateById(String(i)).then(e=>{if(!e){(0,f.OH)(),e7({loading:!1}),r((0,R.M8)(!1));return}let l={template_id:i,selectedTag:(0,L.r_)(eX.current.selectedTagIds),template_thumb_image:(null==e?void 0:e.template_thumb_image)||(null==e?void 0:e.template_image)||""};v(l);let a=(0,Y.F7)(e);o.setDesigntoolObject({templateToLoad:e,templateToLoadNonce:Date.now(),...(0,Y._n)(eh,i,{applyToBothSides:a,userInitiatedSelection:!0})}),e7({isTemplateData:e,isPdpDesignTool:!0,mobileMode:"personalize",isDtTemplateId:n,selectedImageId:n,hoverTemplate:l.template_thumb_image||eX.current.hoverTemplate,loading:!1}),!t.get("MID")&&Number.isFinite(n)&&n>1&&(0,f.qY)("MID",String(n)),r((0,R.M8)(!1))}).catch(()=>{(0,f.OH)(),e7({isPdpDesignTool:!1,isDtTemplateId:null,loading:!1}),r((0,R.M8)(!1))}))},[o,r,v,e7,eh,null==c?void 0:c.template_id]),tw=(0,i.useCallback)(e=>{eB.current=!1;let t=(0,L.jM)(eX.current.selectedTagIds,e);e$.current&&(ti(),e$.current.scrollTo(0,0)),e7({selectedTagIds:t,pageNo:1},()=>{tC(eX.current.pageNo,"selectedCategory")})},[tC,ti,e7]),tS=(0,i.useCallback)(()=>{eX.current.arrowClick||e7({arrowClick:!0},()=>{let e=document.querySelector("#templateCategorySlider");e.scrollLeft-=220,setTimeout(()=>{tc(),e7({arrowClick:!1})},700)})},[e7,tc]),tP=(0,i.useCallback)(()=>{let e=document.querySelector("#templateCategorySlider");eX.current.arrowClick||e7({arrowClick:!0},()=>{e.scrollLeft+=220,setTimeout(()=>{tc(),e7({arrowClick:!1})},700)})},[e7,tc]),tx=(0,i.useCallback)(e=>{var t,l,a,i,n,d,s,u;let p=eX.current,c=p.templateList,m=Number(null!==(l=null!==(t=null==eh?void 0:eh.pdpFrontGalleryTemplateId)&&void 0!==t?t:null==eh?void 0:eh.pdpGalleryTemplateId)&&void 0!==l?l:0),g=Number(null!==(a=null==eh?void 0:eh.pdpBackGalleryTemplateId)&&void 0!==a?a:0),h=Number(null!==(i=p.isDtTemplateId)&&void 0!==i?i:0),T=Math.max(Number.isFinite(m)?m:0,Number.isFinite(g)?g:0,Number.isFinite(h)?h:0),b=Number.isFinite(T)&&T>0,_=Number(eZ?(0,Y.DB)(eh):null!==(s=null!==(d=null!==(n=p.isDtTemplateId)&&void 0!==n?n:null==eh?void 0:eh.pdpGalleryTemplateId)&&void 0!==d?d:null==eh?void 0:eh.pdpFrontGalleryTemplateId)&&void 0!==s?s:T),D=Number(e.template_id)!==_,I=()=>{let t=eX.current;if(eZ&&(0,Y.K_)(e.template_id,eh,t.selectedImageId,D))return;if(D&&r((0,R.M8)(!0)),1===e.template_id){(0,f.OH)(),(0,f.A8)("EID"),(0,f.A8)("itemId"),r((0,z.jY)(null));let l=t.pdpDesignBootstrap;o.setPdpCustomSizeApplyError(null),e7({isTemplateData:l,isDtTemplateId:(null==l?void 0:l.template_id)!=null?l.template_id:0,isPdpDesignTool:!!l,mobileMode:"templates",selectedImageId:1,hoverTemplate:null==e?void 0:e.template_thumb_image}),v({}),null==Q||Q(e),td(e),o.setDesigntoolObject({...(0,Y.BH)(eh,{markCyoSelected:!0}),...(0,W.s4)(eh),resetToBlankCanvasNonce:Date.now()});return}let l=eZ?(0,Y.DB)(eh):(0,Y.rc)(eh);if(Number(e.template_id)===Number(l)){if(eZ&&(0,Y.nd)(eh,e.template_id)){ew(e.template_id,c,"template_id"),e7({selectedImageId:e.template_id,hoverTemplate:null==e?void 0:e.template_thumb_image,mobileMode:"personalize"}),r((0,z.YM)({isCanvasPopupClose:!1}));return}r((0,R.M8)(!0)),ew(e.template_id,c,"template_id"),e.selectedTag=(0,L.r_)(t.selectedTagIds),e.templateIndex=t.templateList.findIndex(t=>t.template_id==e.template_id),v(e),null==Q||Q(e),td(e);let l=(0,Y.F7)(t.isTemplateData),a=t.isTemplateData,i=eZ?(0,H.ih)(eh,e.template_id):e.template_id;o.setDesigntoolObject({...(0,Y._n)(eh,i,{applyToBothSides:l,userInitiatedSelection:!0}
1),...(null==a?void 0:a.template_json)!=null?{templateToLoad:a,templateToLoadNonce:Date.now()}:{}}),e7({selectedImageId:e.template_id,hoverTemplate:null==e?void 0:e.template_thumb_image,mobileMode:"personalize"}),r((0,z.YM)({isCanvasPopupClose:!1}));return}if(eZ&&(0,Y.$J)(eh,e.template_id,t.isTemplateData,t.isDtTemplateId)){let l=t.isTemplateData,a=(0,Y.F7)(l);(0,f.w$)(e.template_id),o.setDesigntoolObject({templateToLoad:l,templateToLoadNonce:Date.now(),...(0,Y._n)(eh,e.template_id,{applyToBothSides:a,userInitiatedSelection:!0})}),e7({isTemplateData:l,isPdpDesignTool:!0,isDtTemplateId:e.template_id,loading:!1,selectedImageId:e.template_id,hoverTemplate:null==e?void 0:e.template_thumb_image,mobileMode:"personalize"}),ew(e.template_id,c,"template_id"),e.selectedTag=(0,L.r_)(t.selectedTagIds),e.templateIndex=t.templateList.findIndex(t=>t.template_id==e.template_id),v(e),null==Q||Q(e),td(e),r((0,z.YM)({isCanvasPopupClose:!1}));return}e7({loading:!0});let a=eZ?(0,H.Oh)(e.template_id,null==eh?void 0:eh.productOptions,eh):e.template_id.toString();o.pdpGetTemplateById(a).then(t=>{let l=t&&null!=t.template_json&&""!==String(t.template_json).trim(),a=(0,Y.F7)(t);if(l){let{idToStore:l,masterIdToStore:i}=(0,H.ig)(e.template_id,t);o.setDesigntoolObject({templateToLoad:t,templateToLoadNonce:Date.now(),...(0,Y._n)(eh,l,{applyToBothSides:a,userInitiatedSelection:!0})}),e7({isTemplateData:t,isPdpDesignTool:!0,mobileMode:"personalize",isDtTemplateId:i,loading:!1,selectedImageId:i,hoverTemplate:null==e?void 0:e.template_thumb_image});let n=eX.current;ew(i,c,"template_id"),e.selectedTag=(0,L.r_)(n.selectedTagIds),e.templateIndex=n.templateList.findIndex(e=>e.template_id==i),v(e),null==Q||Q(e),td(e)}else ek(!0),e7({loading:!1}),r((0,R.M8)(!1));r((0,z.YM)({isCanvasPopupClose:!1}))}).catch(e=>{console.log("error==>",e),ek(!0),e7({loading:!1}),r((0,R.M8)(!1))})};if(b&&D){let e=window.__bannerbuzzPdpConfirmUnsavedChanges||(null===(u=e0.current)||void 0===u?void 0:u.confirmUnsavedChanges);if("function"==typeof e){e("template").then(e=>{"cancel"!==e&&I()});return}I();return}I()},[o,r,td,v,eZ,e7,Q,null==eh?void 0:eh.pdpActiveTemplateSide,null==eh?void 0:eh.pdpBackGalleryTemplateId,null==eh?void 0:eh.pdpFrontGalleryTemplateId,null==eh?void 0:eh.pdpGalleryTemplateId,null==eh?void 0:eh.pdpUseSameTemplateForBack,ew]),tN=(0,i.useCallback)(()=>{var e,t,l,a,i;return Array.isArray(eg)?eg:(null==eg?void 0:null===(i=eg.size)||void 0===i?void 0:null===(a=i.field_values)||void 0===a?void 0:null===(l=a.filter)||void 0===l?void 0:null===(t=l.call(a,e=>(null==e?void 0:e.value)&&(null==e?void 0:e.value)!=="custom"))||void 0===t?void 0:null===(e=t.map)||void 0===e?void 0:e.call(t,e=>({label:(null==e?void 0:e.label)||(null==e?void 0:e.value)||"",value:(null==e?void 0:e.value)||""})))||[]},[eg]);(0,i.useEffect)(()=>{ei&&ei(e6.current)},[ei]),Object.assign(e6.current,{loadTemplate:tC,fetchNextTemplates:tI,searchTemplates:th,restoreTemplateFromQueryParam:tj,fetchInitialPdpDesign:tl,selectMainImage:tx,toggleSelectedTemplateTag:tw,setIndexingLocally:tv,handleScrollFrame:ty,onScrollTo:tn,isInViewport:tm,getMappedPdpDesignToolSizes:tN,normalizeGetDesignResponse:$,getUniqueTemps:el,element:e$,pdpDesigntoolRef:e0}),(0,i.useEffect)(()=>{{let e=new URLSearchParams(window.location.search);e.get("method")?"DTPDP"===String(e.get("method")||"").toUpperCase()&&null!=(0,T.ze)(e)&&e.get("TID")&&(0,f.OH)():((0,f.qY)("newdtpdp","true"),(0,f.qY)("method","DTPDP"))}e7({pdpDesignBootstrapLoading:!0,isLoaded:!1}),tl().then(e=>tj().then(()=>tg(e))).catch(()=>{e7({pdpDesignBootstrapLoading:!1,pdpCategoriesLoading:!1,loading:!1})})},[]),(0,i.useEffect)(()=>{let e=e=>{var t;let l=null==e?void 0:null===(t=e.detail)||void 0===t?void 0:t.mid;if(null==l||""===String(l).trim()){e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X});return}let a=Number.parseInt(String(l),10);if(!Number.isFinite(a)||a<=1){e7({selectedImageId:null,isDtTemplateId:null,hoverTemplate:X});return}e7({selectedImageId:a,isDtTemplateId:a})};return window.addEventListener("bannerbuzz-pdp-mid-url",e),()=>window.removeEventListener("bannerbuzz-pdp-mid-url",e)}
1,[e7]),(0,i.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.getElementById("proPriceBox");e&&(!0===eC.isShowSearch?e.classList.add("PopupIndex"):!1===eC.isShowSearch&&e.classList.remove("PopupIndex"))},[eC.isShowSearch]),(0,i.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.getElementById("popup1"),t=document.getElementById("popup2"),l=["#proPriceBox",".newProductPriceBox",".PopupDesignBox",".UploadPopup"],a=()=>{let a=e&&e.children.length>0||t&&t.children.length>0;l.forEach(e=>{document.querySelectorAll(e).forEach(e=>{a?e.classList.add("popupactive"):e.classList.remove("popupactive")})})};a();let i=new MutationObserver(a);return e&&i.observe(e,{childList:!0}),t&&i.observe(t,{childList:!0}),()=>i.disconnect()},[]),(0,i.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.getElementById("popup1"),t=document.getElementById("popup2"),l=[".newPDPTabBoxAB"],a=()=>{let a=e&&e.children.length>0||t&&t.children.length>0;l.forEach(e=>{document.querySelectorAll(e).forEach(e=>{a?e.classList.add("popupactivemethod"):e.classList.remove("popupactivemethod")})})};a();let i=new MutationObserver(a);return e&&i.observe(e,{childList:!0}),t&&i.observe(t,{childList:!0}),()=>i.disconnect()},[]),(0,i.useEffect)(()=>()=>{tu.current&&clearTimeout(tu.current),tf.cancel(),t_.cancel()},[tf,t_]);let{selectedTagIds:tL,templateTagPills:tk,pdpCategoriesLoading:tO,templateList:tF,loading:tA,selectedImageId:tB,templateSearch:tE,isShowSearch:tG}=eC,tM=(0,i.useMemo)(()=>eK?tF.filter(e=>1!==e.template_id):tF,[eK,tF]),tz=null==eh?void 0:eh.isCanvasPopupClose,tR=eC.isPdpDesignTool&&"personalize"===eC.mobileMode&&!tz,tU=Array.isArray(eI)&&eI.length>0;return(0,a.jsxs)(w.Z,{className:"productTemplateMainBox TemplateBox dtpdpTemplateLayout mobileDesignTemplates\n      ".concat(!1==tz?"canvasPopupOpenAB":""," "),children:[(0,a.jsx)("div",{id:"popup1",children:eL&&(0,a.jsx)(Z.Z,{open:eL,title:"Template data not loaded",subtitle:"The template data is not getting loaded. Please try a different template.",confirmText:"OK",onConfirm:()=>ek(!1),onClose:()=>ek(!1)})}),(0,a.jsx)("div",{id:"popup2"}),(0,a.jsx)("div",{className:"templateWrapper",children:(0,a.jsxs)("div",{className:"templateThumbBox DesigntemplatePopup",children:[eC.isPdpDesignTool?(0,a.jsx)("div",{className:"pdpMobileCanvasWrap ".concat(tR?"templateDesktopLayout hasCanvas":"pdpMobileCanvasHostOffstage"," "),children:(0,a.jsx)("div",{className:"templateRightColumn",children:(0,a.jsx)("div",{className:"pdp-designtool-canvas-wrap",children:(0,a.jsx)(A.default,{activePanel:null,onActivePanelChange:null,hasPdpCanvas:tU,pdpCanvasData:eI,gateEditDetailsByActiveSideTemplate:!0},"pdp-designtool-canvas")})})}):null,!tR&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"tempSearchBox templateSearchBoxMobile",children:!tO&&(0,a.jsxs)("div",{className:"TemplateSliderSearchBox",children:[tG?(0,a.jsx)("div",{className:"TemplateSearchBox",onClick:()=>{e7({isShowSearch:!eC.isShowSearch,templateSearch:""}),tT("","templateSearch")},children:(0,a.jsx)("img",{alt:"Close",src:"".concat(K.CDN_FOR_STATIC_DATA,"/static/images/pdp-cro/icons_close.svg")})}):(0,a.jsx)("div",{className:"TemplateSearchBox",onClick:()=>e7({isShowSearch:!eC.isShowSearch,templateSearch:""}),children:(0,a.jsx)("img",{alt:"Search",className:"",src:"".concat(K.CDN_FOR_STATIC_DATA,"/static/images/pdp-cro/iconSearchDTAB.svg")})}),(0,a.jsx)(O.Z,{templateTagPills:tk,selectedTagIds:tL,onToggleTag:tw,onClickLeft:tS,onClickRight:tP}),tG&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"desktopSearch",children:(0,a.jsx)("input",{className:"SearchTextBox",value:tE,placeholder:"Search Template",onChange:e=>{t_(e.target.value),tT(e.target.value,"templateSearch")},onKeyPress:e=>{"Enter"==e.key&&tE.length>=3&&th(tE)},autoFocus:!0})})})]})}),(0,a.jsxs)(x.y9,{className:"templateFilterToolbar",children:[!eS&&(0,a.jsxs)(x.gd,{type:"button","aria-expanded":eS,"aria-controls":"pdp-template-filter-sidebar",onClick:()=>{eP(!0)},children:[(0,a.jsx)(x.qx,{children:(0,a.jsx)(S.n,{})}),"Filter by"]}),(0,a.jsx)(x.vO,{children:eH.map(e=>(0,a.jsxs)(x.ll,{children:[(0,a.jsx)(x.yt,{children:e.label}),(0,a.jsx)(x.Jb,{type:"button","aria-label":"Remove ".concat(e.label," "),onClick:()=>e2(e),children:(0,a.jsx)("img",{src:"/static/images/pdp-cro/filterremoveIconDT.svg",alt:"remove"})})]},e.id))}),(0,a.jsx)(x.Dd,{type:"button",onClick:e3,disabled:0===eH.length,children:"Clear All"})]}),(0,a.jsx)("div",{className:"templateDesktopLayout",children:(0,a.jsx)("div",{className:"templateLeftColumn templateListingOnly",children:(0,a.jsxs)("div",{className:"templateListFilterBox",children:[eS?(0,a.jsxs)("div",{className:"filtersidebarPopupDTAB",children:[(0,a.jsx)("div",{className:"".concat(eS?"filtersidebarOverlayActiveDTAB":""," "),onClick:()=>eP(!1)}),(0,a.jsx)(S.Z,{className:"templateFilterSidebar",isOpen:eS,sections:eJ,selection:ex,onSelectionChange:e5,onHeaderClick:()=>{eP(!1),r((0,z.YM)({isCanvasPopupClose:!0}))},storedata:p})]}):(0,a.jsx)(a.Fragment,{}),(0,a.jsx)("div",{className:"templateListSelectedFilterToolbar",children:(0,a.jsx)("div",{ref:e$,className:"templateListBox",children:0===tM.length&&(tA||tO)?(0,a.jsx)(P.Z,{itemCount:21,itemParams:"template"}):tM.length>0?(0,a.jsx)("ul",{className:"TemplateListing",children:(0,a.jsx)(m.$B,{ref:eQ,onScrollFrame:ty,onScroll:tp,children:tM.map(e=>{let t=eZ?(0,Y.K7)(e,eh):!!(tB&&e.template_id==tB);return(0,a.jsxs)("li",{onClick:()=>tx(e),className:t?"active activetemplate":"",id:t?"activetemplate":"",children:[1===e.template_id?(0,a.jsxs)("div",{className:"createbyown",children:[(0,a.jsx)("img",{src:e.template_thumb_image?e.template_thumb_image:e.template_image,effect:"blur",alt:e&&e.t
1itle}),(0,a.jsx)("p",{children:"Create Your Own"})]}):(0,a.jsx)("img",{src:e.template_thumb_image?e.template_thumb_image:e.template_image,effect:"blur",alt:e&&e.title}),t?(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("rect",{x:"0.5",y:"0.5",width:"15",height:"15",rx:"1.5",fill:6==p.storeId?"#fb126d":"#FB7B48",stroke:6==p.storeId?"#fb126d":"#FB7B48"}),(0,a.jsx)("path",{d:"M4.11133 7.66667L6.88911 10.4444L12.4447 4.88889",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):""]},null==e?void 0:e.template_id)})})}):!1!==tU||void 0!=eI&&"undefined"!=eI||tA||tO?0===tM.length&&(0,a.jsx)("div",{className:"Notemplate",children:(0,a.jsx)("p",{children:"No templates Found"})}):(0,a.jsx)("div",{className:"Notemplate",children:(0,a.jsx)("p",{children:"No templates Found"})})})})]})})})]})]})}),(0,a.jsx)("div",{className:"clearfix"}),(0,a.jsxs)("div",{className:"Note",children:["*Note:-",(0,a.jsxs)("ul",{children:[(0,a.jsx)("li",{children:"- You will be redirected to design tool where you can explore more design templates"}),(0,a.jsx)("li",{children:"- Our designers may connect with you for any clarification"}),(0,a.jsx)("li",{children:"- Product will be printed after your approval (if opted on cart)"})]})]})]})}function ei(e,t,l){if("function"!=typeof t)throw Error('bindActionCreators: "'.concat(l,'" is undefined.Check imports / exports and restart the dev server(clear.next if needed).'));return(0,s.DE)(t,e)}ea.propTypes={setGalleryHoverImage:o().func,dispatch:o().func.isRequired,actions:o().object,productData:o().object,productId:o().any,storedata:o().object,breadcrumbsData:o().string,setimageView:o().func,onRef:o().any,getTemplateData:o().func,selectedTemplate:o().any,showTemplatesSection:o().func,onTemplateClickAdb:o().func,gallery:o().any,storedOption:o().object,reviewDetail:o().object,reviewId:o().string,selectedPdpSizeValue:o().string,pdpDesignToolSizes:o().oneOfType([o().array,o().object]),isLogin:o().bool,customerId:o().any,customerEmail:o().string,customerGroupId:o().any,cookies:o().object,cartData:o().object,getUpdateOptionData:o().func,pdpDesigntoolObject:o().object,pdpStoreTemplateRatio:o().array,pdpStoreSizesDefaultUnit:o().string,pdpStoreProductId:o().oneOfType([o().number,o().string]),pdpGetDesignLoaded:o().bool,onPdpTemplateFilterSidebarOpenChange:o().func,pdpCanvasData:o().any,selectedCartOption:o().string},t.Z=(0,d.$j)(e=>{var t,l,a,i,n,o,r,d,s,u,p,c,m,v,g,h;let{product:f,app:T,customer:b,pdpDesignTool:_}=e;return{optionData:f.optionData||{},storedOption:f?f.storedOption:{},reviewDetail:f?f.reviewDetail:{},designTool:f?f.designTool:{},storedata:T.storedata,isLogin:(null==b?void 0:b.isLogin)||!1,customerId:(null==b?void 0:null===(l=b.profile)||void 0===l?void 0:null===(t=l.customer_extra_fields)||void 0===t?void 0:t.id)||null,customerEmail:(null==b?void 0:null===(a=b.profile)||void 0===a?void 0:a.email)||"",customerGroupId:(null==b?void 0:null===(n=b.profile)||void 0===n?void 0:null===(i=n.customer_extra_fields)||void 0===i?void 0:i.group_code)||"not_logged_in",cartData:(null==f?void 0:f.cartData)||{},pdpDesigntoolObject:null==_?void 0:null===(o=_.postData)||void 0===o?void 0:o.designtoolObject,pdpStoreTemplateRatio:null==_?void 0:null===(d=_.postData)||void 0===d?void 0:null===(r=d.designtoolObject)||void 0===r?void 0:r.templateRatio,pdpStoreSizesDefaultUnit:(0,N.IC)(null==_?void 0:null===(p=_.postData)||void 0===p?void 0:null===(u=p.designtoolObject)||void 0===u?void 0:null===(s=u.productOptions)||void 0===s?void 0:s.sizes),pdpStoreProductId:null==_?void 0:null===(m=_.postData)||void 0===m?void 0:null===(c=m.designtoolObject)||void 0===c?void 0:c.productId,pdpGetDesignLoaded:null!==(h=null==_?void 0:_.pdpGetDesignLoaded)&&void 0!==h&&h,pdpCanvasData:null==_?void 0:null===(g=_.postData)||void 0===g?void 0:null===(v=g.designtoolObject)||void 0===v?void 0:v.canvas_data}},e=>({dispatch:e,actions:{pdpGetPDPTemplates:ei(e,v.vH,"PDPDesigntoolApi.pdpGetPDPTemplates"),pdpGetDesignData:ei(e,v.qb,"PDPDesigntoolApi.pdpGetDesignData"),pdpGetFontData:ei(e,v.iD,"PDPDesigntoolApi.pdpGetFontData"),pdpGetPriceDetails:ei(e,v.eV,"PDPDesigntoolApi.pdpGetPriceDetails"),pdpGetTemplateById:ei(e,v.Gp,"PDPDesigntoolApi.pdpGetTemplateById"),setDesigntoolObject:ei(e,z.YM,"setDesigntoolObject (pdpDesignToolReducer)"),setFontsData:ei(e,z.eT,"setFontsData (pdpDesignToolReducer)"),setPdpCustomSizeApplyError:ei(e,z.d3,"setPdpCustomSizeApplyError (pdpDesignToolReducer)")}}))((0,r.Z)(ea))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.