PageSourceSearch

https://premiumtea.mn/_next/static/chunks/pages/campaign/[id]-7d6914a829c15cc1.js

js premiumtea.mn collected 2026-10-03 18:50:29 UTC 6,092 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4324],{44110:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/campaign/[id]",function(){return a(9289)}])},95348:function(e,t,a){"use strict";var n=a(85893),s=a(11752),r=a.n(s);let{publicRuntimeConfig:{FACEBOOK_APP_ID:c}}=r()();t.Z=function(e){let{url:t}=e;return(0,n.jsx)("div",{className:"grid place-items-center bg-[#2e69e5] w-8 h-8 rounded-md",children:(0,n.jsx)("a",{target:"_blank",className:"",href:"https://www.facebook.com/dialog/share?app_id=".concat(c,"&display=popup&href=").concat(encodeURIComponent(t)),onClick:e=>{e.preventDefault(),window.open("https://www.facebook.com/dialog/share?app_id=".concat(c,"&display=popup&href=").concat(encodeURIComponent(t)),"_blank","location=yes,height=760,width=600,scrollbars=yes,status=yes")},children:(0,n.jsx)("div",{className:"flex place-items-center p-2 gap-1",children:(0,n.jsx)("img",{className:"white__image",src:"/static/images/share.png",width:18,height:18})})})})}},11156:function(e,t,a){"use strict";var n=a(85893),s=a(83481),r=a(179),c=a(30381),i=a.n(c),o=a(67294),l=a(51655);let d=o.memo(e=>{let{value:t,unit:a}=e;return(0,n.jsxs)("div",{className:"flex flex-col items-center text-center font-medium",children:[(0,n.jsx)("span",{className:"text-gray-900 text-lg",children:t}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:a})]})});t.Z=(0,s.Z)(function(e){let{product:t,currentShop:a}=e,[s,c]=(0,o.useState)(),[m,p]=(0,o.useState)({days:"00",hours:"00",minutes:"00",seconds:"00"}),u=(0,o.useCallback)(async()=>{try{let e=await (0,r.U)("/storefront/sales/current-campaign-by-shop/".concat(a.id),!1,!1);c(e.data)}catch(e){console.error("Failed to fetch campaign:",e)}},[a.id]);(0,o.useEffect)(()=>{u()},[u]);let g=(0,o.useMemo)(()=>s?i()(s.expire_at).valueOf():null,[s]);return((0,o.useEffect)(()=>{if(!g)return;let e=()=>{let e=Date.now(),t=g-e;if(t<=0){p({days:"00",hours:"00",minutes:"00",seconds:"00"});return}let a=Math.floor(t/864e5).toString().padStart(2,"0"),n=Math.floor(t%864e5/36e5).toString().padStart(2,"0"),s=Math.floor(t%36e5/6e4).toString().padStart(2,"0"),r=Math.floor(t%6e4/1e3).toString().padStart(2,"0");p({days:a,hours:n,minutes:s,seconds:r})};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[g]),(0,o.useMemo)(()=>{if(!s)return 0;let e=Date.now(),t=i()(s.created_at).valueOf(),a=i()(s.expire_at).valueOf();return Math.min(100,Math.max(0,(e-t)/(a-t)*100))},[s]),void 0===s)?(0,n.jsx)(l.ZP,{}):(0,n.jsx)("div",{className:"w-full",children:(0,n.jsxs)("div",{className:"flex gap-x-2 flex-wrap items-center justify-between rounded-md bg-gray-100 px-4 py-4",children:[(0,n.jsx)("span",{className:"font-medium",children:"Хямдралын аян дуусахад"}),(0,n.jsxs)("div",{className:"flex items-center gap-x-2",children:[Number(m.days)>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d,{value:m.days,unit:"өдөр"}),(0,n.jsx)("span",{className:"font-semibold text-gray-500 mb-4 text-base",children:":"})]}),(0,n.jsx)(d,{value:m.hours,unit:"цаг"}),(0,n.jsx)("span",{className:"font-semibold text-gray-500 mb-4 text-base",children:":"}),(0,n.jsx)(d,{value:m.minutes,unit:"мин"}),(0,n.jsx)("span",{className:"font-semibold text-gray-500 mb-4 text-base",children:":"}),(0,n.jsx)(d,{value:m.seconds,unit:"сек"})]})]})})})},9289:function(e,t,a){"use strict";a.r(t);var n=a(85893),s=a(43421),r=a(95348),c=a(83481),i=a(31489),o=a(11156),l=a(179),d=a(30381),m=a.n(d),p=a(11752),u=a.n(p),g=a(9008),x=a.n(g),f=a(11163),h=a(67294),j=a(78186);let{publicRuntimeConfig:{FACEBOOK_APP_ID:_}}=u()(),y=(0,c.Z)(function(e){let{campaign:t,currentShop:a,products:c,page:l,totalCount:d}=e,[p,u]=(0,h.useState)(0),[g,y]=(0,h.useState)("00"),[b,w]=(0,h.useState)("00"),[v,N]=(0,h.useState)("00"),[S,k]=(0,h.useState)("00");(0,h.useEffect)(()=>{let e;let a=m()(t.expire_at).format("x"),n=m()(),s=a-n;return y(Math.floor(s/864e5)),w(Math.floor(s%864e5/36e5)),N(Math.floor(s%36e5/6e4)),k(Math.floor(s%6e4/1e3)),s>0&&(e=setTimeout(()=>{u(p+1)},1e3)),()=>{if(e)return clearTimeout(e)}},[p]),m()(t.expire_at).format("x"),m()(t.created_at).format("x"),new Date().getTime();let M=t.image&&t.image.replace("t500","t1500"),C=(0,f.useRouter)(),Z=C.query;return(0,n.jsxs)("div",{children:[(0,n.jsxs)(x(),{children:[(0,n.jsx)("title",{children:a.current_sale_campaign_name}),(0,n.jsx)("meta",{property:"og:type",content:"campaign"}),(0,n.jsx)("meta",{property:"og:title",content:a.current_sale_campaign_name}),(0,n.jsx)("meta",{property:"fb:app_id",content:_}),(0,n.jsx)("meta",{property:"og:site_name",content:a.name}),(0,n.jsx)("meta",{property:"og:url",content:"".concat((0,i.getShopUrl)(a),"/campaign/").concat(t.id)}),(0,n.jsx)("meta",{property:"og:image",content:t.image})]}),t.image&&(0,n.jsx)("img",{className:"w-full",src:M,alt:""}),(0,n.jsxs)("div",{className:"px-4 md:container",children:[(0,n.jsxs)("div",{className:"dark__mode__background flex flex-wrap items-center justify-between py-5 text-2xl font-semibold text-center text-dark",children:[t.name,(0,n.jsx)(r.Z,{url:"".concat((0,i.getShopUrl)(a),"/campaign/").concat(t.id)})]}),(0,n.jsx)(o.Z,{}),(0,n.jsxs)("div",{className:"my-5",children:[(0,n.jsx)("div",{className:"grid grid-cols-2 gap-5 lg:grid-cols-4 ",children:null==c?void 0:c.map((e,t)=>(0,n.jsx)(j.Z,{product:e,currentShop:a},e.id))}),(0,n.jsx)(s.Z,{page:l,totalCount:d,linkTo:"/campaign/".concat(t.id,"?sale_campaign_id=").concat(Z.id),linkAs:"/campaign/".concat(t.id)})]})]})]})});y.getInitialProps=async e=>{let{reduxStore:t,query:a}=e,n=(0,i.getShopFromState)(t.getState()),s="/storefront/sales/current-campaign-by-shop/".concat(n.id),r="/storefront/products/by-shop/".concat(n.id,"?sale_campaign_id=").concat(a.id,"&page=").concat(a.page||1);try{let{data:e}
1=await (0,l.U)(s,!1,!0),{data:t,total:c}=await (0,l.U)(r,!1);return{campaign:e||{},currentShop:n,products:t,totalCount:c,page:parseInt(a.page||1)}}catch(e){console.error(e)}return{campaign:{},currentShop:n,page:1,products:[],totalCount:0}},t.default=y}},function(e){e.O(0,[4885,1655,4090,9774,2888,179],function(){return e(e.s=44110)}),_N_E=e.O()}]);

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.