1"use strict";(self.webpackChunkagrokumakchi_web=self.webpackChunkagrokumakchi_web||[]).push([[9770],{99770:(e,n,a)=>{a.r(n),a.d(n,{default:()=>ce});var i=a(9950),t=a(28429),l=a(89654),o=a(24669),r=a(52160),s=a(72612),c=a(1203),d=a(87094),u=a(41988),m=a(45784),p=a(75989),v=a(67818),h=a(4159),g=a.n(h),_=a(36150),x=a(61664),b=a(67189),y=a(44414);function j(e){let{value:n,onChange:a,lang:t="ru",apiUrl:l="".concat(b.NT,"/public/exhibitions/calendar")}=e;const[o,r]=(0,i.useState)(!1),[c,d]=(0,i.useState)(""),[u,m]=(0,i.useState)([]),p=Number(n||0);(0,i.useEffect)((()=>{let e=!1;return(async()=>{r(!0),d("");try{var n,i;const o=await fetch(l,{headers:{Accept:"application/json","Accept-Language":t}});if(!o.ok)throw new Error("Calendar HTTP ".concat(o.status));const r=await o.json(),s=Array.isArray(null===r||void 0===r?void 0:r.data)?r.data:[],c=new Map;for(const e of s){const n=Number((null===e||void 0===e?void 0:e.id)||0);n>=1&&n<=12&&c.set(n,e)}const d=Array.from({length:12},((e,n)=>{const a=n+1,i=c.get(a);return{key:a,label:String((null===i||void 0===i?void 0:i.month)||"").trim()||"Month ".concat(a),count:Number((null===i||void 0===i?void 0:i.count)||0)}}));if(e)return;m(d);const u=(null===(n=d.find((e=>e.count>0)))||void 0===n?void 0:n.key)||1,v=d.find((e=>e.key===p)),h=null!==(i=null===v||void 0===v?void 0:v.count)&&void 0!==i?i:0;(!(Number.isFinite(p)&&p>=1&&p<=12)||h<=0)&&(null===a||void 0===a||a(u))}catch(o){e||(d((null===o||void 0===o?void 0:o.message)||"Failed to load calendar"),m([]))}finally{e||r(!1)}})(),()=>{e=!0}}),[l,t,a,p]);const v=(0,i.useMemo)((()=>u.slice(0,8)),[u]),h=(0,i.useMemo)((()=>u.slice(8,12)),[u]),g=(0,i.useCallback)((e=>{e!==p&&(null===a||void 0===a||a(e))}),[a,p]);return(0,y.jsx)("div",{className:"q-months",children:o?(0,y.jsx)("div",{style:{padding:8},children:(0,y.jsx)(s.A,{size:"small"})}):c?(0,y.jsx)("div",{style:{padding:8,color:"crimson"},children:c}):0===u.length?(0,y.jsx)("div",{style:{padding:8,opacity:.8},children:"Calendar empty"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"q-months__row1",children:v.map((e=>(0,y.jsxs)("button",{type:"button",className:"q-months__btn ".concat(Number(n)===e.key?"is-active":""),onClick:()=>g(e.key),title:"".concat(e.label,": ").concat(e.count),children:[e.count>0&&(0,y.jsx)("span",{className:"q-months__badge",children:e.count}),e.label]},e.key)))}),(0,y.jsx)("div",{className:"q-months__row2",children:h.map((e=>(0,y.jsxs)("button",{type:"button",className:"q-months__btn ".concat(Number(n)===e.key?"is-active":""),onClick:()=>g(e.key),title:"".concat(e.label,": ").concat(e.count),children:[e.count>0&&(0,y.jsx)("span",{className:"q-months__badge",children:e.count}),e.label]},e.key)))})]})})}var f=a(69503),A=a(95759),w=a(13239),N=a(78885),S=a(60497),k=(a(99425),a(49071),a(52867));const{Title:q,Paragraph:C,Text:E}=f.A;function z(e){var n,a,t,l,o,r,s,c,d,u;let{item:m,selected:p,onToggle:h,accentColor:g="#5DB075"}=e;const{t:_}=(0,v.Bd)(),x=(0,i.useMemo)((()=>Array.isArray(null===m||void 0===m?void 0:m.images)?m.images.filter(Boolean).slice(0,3):[]),[m]),[b,j]=(0,i.useState)(!1),[f,z]=(0,i.useState)(!1),F=(0,i.useRef)(null),I=(0,i.useCallback)((e=>{var n;null===e||void 0===e||null===(n=e.stopPropagation)||void 0===n||n.call(e),j((e=>!e))}),[]);(0,i.useLayoutEffect)((()=>{const e=F.current;if(!e)return;const n=requestAnimationFrame((()=>{if(b)return z(!1);z(e.scrollHeight>e.clientHeight+1)}));return()=>cancelAnimationFrame(n)}),[null===m||void 0===m?void 0:m.desc,b]);const M=(0,i.useMemo)((()=>{var e,n,a,i;const t=null!==(e=null===m||void 0===m||null===(n=m.raw)||void 0===n||null===(a=n.country)||void 0===a?void 0:a.title)&&void 0!==e?e:"\u2014",l=Array.isArray(null===m||void 0===m||null===(i=m.raw)||void 0===i?void 0:i.cities)?m.raw.cities.map((e=>null===e||void 0===e?void 0:e.title)).filter(Boolean):[];return"".concat(t," \u2022 ").concat(Array.from(new Set(l)).join(", ")||"\u2014")}),[m]),P=(0,i.useCallback)((e=>{var n;const a=e.target;null!==a&&void 0!==a&&null!==(n=a.closest)&&void 0!==n&&n.call(a,".q-card__swiper,.swiper,.swiper-pagination,.q-card__select,.q-card__more,.q-card__descWrap,a")||null===h||void 0===h||h(!p)}),[h,p]),T=(0,i.useCallback)((e=>{e.stopPropagation(),null===h||void 0===h||h(!p)}),[h,p]);return(0,y.jsxs)(A.A,{bordered:!1,bodyStyle:{padding:0},className:"q-card ".concat(p?"is-selected":""," ").concat(b?"is-open":""),style:{"--accent":g},onClick:P,children:[(0,y.jsx)("div",{className:"q-card__media",children:x.length?(0,y.jsx)("div",{className:"q-card__swiper",children:(0,y.jsx)(N.RC,{className:"q-card-swiper",modules:[S.dK,S.Ij],slidesPerView:1,pagination:{clickable:!0},autoplay:{delay:5e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},speed:800,children:x.map(((e,n)=>(0,y.jsx)(N.qr,{children:(0,y.jsx)("img",{src:e,alt:"",className:"q-card__img",draggable:!1})},n)))})}):(0,y.jsx)("div",{className:"q-card__noimg",children:_("no_image")})}),(0,y.jsxs)("div",{className:"q-card__body",children:[(0,y.jsx)(q,{level:5,className:"q-card__title",children:(null===m||void 0===m?void 0:m.title)||"\u2014"}),(0,y.jsxs)("div",{className:"q-card__descWrap ".concat(b?"is-open":""),children:[(0,y.jsx)(C,{ref:F,className:"q-card__desc",children:(null===m||void 0===m?void 0:m.desc)||"\u2014"}),(0,y.jsx)("button",{type:"button",className:"q-card__more ".concat(f||b?"is-visible":""),onClick:f||b?I:e=>e.stopPropagation(),"aria-hidden":!(f||b),children:_(b?"see_short":"see_all")})]}),(0,y.jsxs)(C,{className:"q-card__row",children:[_("venue"),": ",(0,y.jsx)("b",{children:M})]}),(0,y.jsxs)(C,{className:"q-card__row",children:[_("exhibition_date"),":"," ",(0,y.jsxs)("b",{children:[(0,k.IY)(null===m||void 0===m||null===(n=m.raw)||void 0===n?void 0:n.exhibition_date)||"\u2014"," \u2014"," ",(0,k.IY)(null===m||void 0===m||null===(a=m.raw)||void 0===a?void 0:a.end_date)||"\u2014"]})]}),(0,y.jsxs)(C,{className:"q-card__row q-card__row--mt",children:[_("countries_count"),": ",(0,y.jsx)("b",{children:null!==(t=null===m||void 0===m||null===(l=m.raw)||void 0===l?void 0:l.participants_count)&&void 0!==t?t:"\u2014"})]}),(0,y.jsxs)(C,{className:"q-card__row",children:[_("visitors_count"),": ",(0,y.jsx)("b",{children:null!==(o=null===m||void 0===m||null===(r=m.raw)||void 0===r?void 0:r.total_participants_count)&&void 0!==o?o:"\u2014"})]}),(0,y.jsxs)(C,{className:"q-card__website",children:[_("website"),":"," ",null!==m&&void 0!==m&&null!==(s=m.raw)&&void 0!==s&&s.website?(0,y.jsx)("a",{href:null===m||void 0===m||null===(c=m.raw)||void 0===c?void 0:c.website,target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),children:null===m||void 0===m||null===(d=m.raw)||void 0===d?void 0:d.website}):(0,y.jsx)("span",{children:"\u2014"})]}),(0,y.jsxs)("div",{className:"q-card__footer",children:[(0,y.jsx)(E,{type:"secondary",children:(0,k.IY)(null===m||void 0===m||null===(u=m.raw)||void 0===u?void 0:u.created_at)||"\u2014"}),(0,y.jsx)("button",{type:"button",className:"q-card__select ".concat(p?"is-selected":""),onClick:T,children:p?(0,y.jsxs)(y.Fragment,{children:[_("selected")," ",(0,y.jsx)(w.A,{})]}):_("select")})]})]})]})}var F=a(89379),I=a(23561),M=a(5355),P=a(85494),T=a.n(P),B=a(23072),Y=a(46004),D=a(98114),H=a(81052),R=a.n(H),L=a(18795);async function O(e){let{rootEl:n,filename:a="document.pdf",pageBg:i="#EEEEEE",marginX:t=38,marginTop:l=38,marginBottom:o=38,scale:r=2,blockSelector:s=".app-block",beforeCaptureDelay:c=80}=e;if(!n)throw new Error("rootEl is required");var d;await async function(e){const n=Array.from(e.querySelectorAll("img"));await Promise.all(n.map((e=>
1e.complete&&e.naturalWidth>0?Promise.resolve():new Promise((n=>{e.onload=n,e.onerror=n})))))}(n),await(d=c,new Promise((e=>setTimeout(e,d))));const u=Array.from(n.querySelectorAll(s));if(!u.length)throw new Error("No blocks found: ".concat(s));const m=new L.Ay("p","pt","a4"),p=m.internal.pageSize.getWidth(),v=m.internal.pageSize.getHeight(),h=p-2*t,g=v-l-o,_=()=>{m.setFillColor(...V(i)),m.rect(0,0,p,v,"F")};_();let x=l;for(let b=0;b<u.length;b++){const e=u[b],n=await R()(e,{scale:r,useCORS:!0,allowTaint:!0,backgroundColor:null,logging:!1,scrollX:0,scrollY:-window.scrollY}),a=h/n.width,s=h,c=n.height*a;if(x+c>l+g&&(m.addPage(),_(),x=l),c>g){x=await W({pdf:m,canvas:n,pageW:p,pageH:v,contentW:h,contentH:g,marginX:t,marginTop:l,marginBottom:o,pageBg:i});continue}const d=n.toDataURL("image/png",1);m.addImage(d,"PNG",t,x,s,c),x+=c+18}m.save(a)}async function W(e){let{pdf:n,canvas:a,pageW:i,pageH:t,contentW:l,contentH:o,marginX:r,marginTop:s,marginBottom:c,pageBg:d}=e;const u=l/a.width,m=o/u;let p=0,v=s;for(;p<a.height-1;){const e=Math.min(m,a.height-p),o=document.createElement("canvas");o.width=a.width,o.height=Math.ceil(e);o.getContext("2d").drawImage(a,0,p,a.width,o.height,0,0,a.width,o.height);const c=o.toDataURL("image/png",1),h=o.height*u;p>0&&(n.addPage(),n.setFillColor(...V(d)),n.rect(0,0,i,t,"F"),v=s),n.addImage(c,"PNG",r,v,l,h),p+=e}return s+18}function V(e){const n=String(e||"").replace("#","").trim();if(6!==n.length)return[238,238,238];return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}const{Title:U,Text:X,Paragraph:Z}=f.A;function K(e){let{label:n,value:a}=e;return(0,y.jsxs)("div",{className:"app-row",children:[(0,y.jsx)(X,{className:"app-label",children:n}),(0,y.jsx)(X,{className:"app-value",children:a||"\u2014"})]})}function G(e){var n,a;const i=null!==(n=null===e||void 0===e||null===(a=e.country)||void 0===a?void 0:a.title_uz)&&void 0!==n?n:"\u2014",t=Array.isArray(null===e||void 0===e?void 0:e.cities)?e.cities.map((e=>null===e||void 0===e?void 0:e.title_uz)).filter(Boolean):[],l=Array.from(new Set(t)).join(", ")||"\u2014";return"".concat(i," \u2022 ").concat(l)}function J(e){var n;let{statusTitle:a="Ariza qabul qilindi",data:t}=e;const{t:o}=(0,v.Bd)(),s=(0,i.useRef)(null),[c,d]=(0,i.useState)(!1),u=(0,i.useMemo)((()=>(Array.isArray(null===t||void 0===t?void 0:t.exhibitions)?t.exhibitions:[]).map(G)),[null===t||void 0===t?void 0:t.exhibitions]),m=(0,i.useCallback)((async()=>{d(!0);try{var e;await O({rootEl:s.current,filename:"ariza_".concat(null!==(e=null===t||void 0===t?void 0:t.id)&&void 0!==e?e:"x",".pdf"),pageBg:"#EEEEEE",scale:2,blockSelector:".app-block",marginX:38,marginTop:38,marginBottom:38})}catch(n){l.Ay.error("PDF yaratishda xatolik")}finally{d(!1)}}),[null===t||void 0===t?void 0:t.id]);return(0,i.useEffect)((()=>{m()}),[m]),(0,y.jsx)("div",{className:"app-wrap",children:(0,y.jsxs)(A.A,{className:"app-card",bordered:!1,bodyStyle:{padding:0},children:[(0,y.jsxs)("div",{ref:s,className:"app-card__inner",children:[!!u.length&&(0,y.jsxs)("div",{className:"app-venues",children:[(0,y.jsxs)("div",{className:"app-venues__label",children:[o("venue"),":"]}),(0,y.jsx)("div",{className:"app-venues__chips",children:u.map(((e,n)=>(0,y.jsx)("span",{className:"app-venues__chip",children:e},"".concat(e,"-").concat(n))))})]}),(0,y.jsx)(A.A,{className:"app-block",bordered:!1,bodyStyle:{padding:0},children:(0,y.jsxs)("div",{className:"app-block__inner",children:[(0,y.jsx)(U,{level:2,className:"app-status",children:a}),(0,y.jsx)(B.A,{className:"app-divider"}),(0,y.jsxs)("div",{className:"app-topline",children:[(0,y.jsx)(X,{className:"app-muted",children:"Ariza ID ".concat(null!==(n=null===t||void 0===t?void 0:t.id)&&void 0!==n?n:"\u2014")}),(0,y.jsx)(X,{className:"app-muted",children:(0,k.IY)(null===t||void 0===t?void 0:t.created_at,"YYYY-MM-DD")})]})]})}),(0,y.jsx)(A.A,{className:"app-block app-block--info",bordered:!1,bodyStyle:{padding:0},children:(0,y.jsxs)("div",{className:"app-block__inner",children:[(0,y.jsx)(K,{label:"Korxona nomi",value:null===t||void 0===t?void 0:t.company_name}),(0,y.jsx)(K,{label:"Nomer",value:null===t||void 0===t?void 0:t.phone_number}),(0,y.jsx)(B.A,{className:"app-divider app-divider--soft"})]})}),((null===t||void 0===t?void 0:t.exhibitions)||[]).map(((e,n)=>{var a;return(0,y.jsx)(A.A,{className:"app-block",bordered:!1,bodyStyle:{padding:0},children:(0,y.jsxs)("div",{className:"app-block__inner",children:[(0,y.jsxs)(U,{level:2,className:"app-expo-title",children:[o("venue"),":"," ",(0,y.jsx)("b",{className:"app-expo-venue",children:G(e)})]}),(0,y.jsx)(U,{level:2,className:"app-expo-title",children:(null===e||void 0===e?void 0:e.title_uz)||"\u2014"}),(0,y.jsx)(Z,{className:"app-expo-desc",children:(null===e||void 0===e?void 0:e.description_uz)||"\u2014"}),(0,y.jsx)(Z,{className:"app-expo-date",children:(0,k.IY)(null===e||void 0===e?void 0:e.exhibition_date)||"\u2014"})]})},null!==(a=null===e||void 0===e?void 0:e.id)&&void 0!==a?a:n)}))]}),(0,y.jsx)("div",{className:"app-actions",children:(0,y.jsx)(Y.A,{style:{width:"100%"},direction:"vertical",size:12,children:(0,y.jsx)(r.Ay,{type:"primary",size:"large",icon:(0,y.jsx)(D.A,{}),className:"app-download",onClick:m,loading:c,block:!0,children:"\u0421\u043a\u0430\u0447\u0430\u0442\u044c PDF"})})})]})})}const $="".concat(b.NT,"/public/applications");function Q(e){return String(e||"").replace(/\D+/g,"")}function ee(e){let{exhibitionIds:n,lang:a="ru"}=e;const{t:t}=(0,v.Bd)(),[r]=I.A.useForm(),[c,m]=(0,i.useState)(!1),[p,h]=(0,i.useState)(!1),[g]=(0,i.useState)([]),[_,x]=(0,i.useState)();return(0,y.jsxs)("div",{className:"pubAppModal",children:[(0,y.jsx)(o.A,{open:c,onCancel:()=>m(!1),maskClosable:!1,footer:null,width:550,centered:!0,destroyOnClose:!0,children:(0,y.jsx)(J,{data:null===_||void 0===_?void 0:_.data})}),(0,y.jsx)(f.A.Title,{level:1,className:"pubAppModal__title",children:t("questionnaire")}),(0,y.jsxs)(I.A,{form:r,layout:"vertical",requiredMark:!1,onFinish:async e=>{var i;if(!n.length)return void l.Ay.error(t("form.err.exhibition_ids"));const o=new FormData;o.append("company_name",(e.company_name||"").trim()),o.append("company_inn",Q(e.company_inn)),o.append("company_address",(e.company_address||"").trim()),o.append("representative_full_name",(e.representative_full_name||"").trim()),(e.export_volume||"").trim()&&o.append("export_volume",String(e.export_volume).trim()),(e.export_countries_2025||"").trim()&&o.append("export_
1countries_2025",String(e.export_countries_2025).trim()),(e.phone_number||"").trim()&&o.append("phone_number",function(e){const n=Q(e);return n?"+"+n:""}(e.phone_number)),o.append("exhibition_ids",n);const r=null===g||void 0===g||null===(i=g[0])||void 0===i?void 0:i.originFileObj;r&&o.append("catalog_file",r),h(!0);try{const e=await fetch($,{method:"POST",headers:{Accept:"application/json","Accept-Language":a},body:o}),n=await e.json();if(!e.ok)throw new Error((null===n||void 0===n?void 0:n.message)||(null===n||void 0===n?void 0:n.error)||"HTTP ".concat(e.status));l.Ay.success((null===n||void 0===n?void 0:n.message)||t("form.msg.sent")),x(n),m(!0),localStorage.removeItem("qc:selectedExhibitionsv1")}catch(s){l.Ay.error((null===s||void 0===s?void 0:s.message)||t("form.msg.error"))}finally{h(!1)}},initialValues:{phone_number:"+998 (__) ___-__-__"},children:[(0,y.jsxs)(d.A,{gutter:[28,22],children:[(0,y.jsx)(u.A,{xs:24,children:(0,y.jsx)(I.A.Item,{name:"company_name",className:"pubAppForm__item",rules:[{required:!0,message:t("form.err.company_name")}],children:(0,y.jsx)(M.A,{size:"large",className:"pubAppInput",placeholder:t("form.ph.company_name")})})}),(0,y.jsx)(u.A,{xs:24,md:12,children:(0,y.jsx)(I.A.Item,{name:"representative_full_name",className:"pubAppForm__item",rules:[{required:!0,message:t("form.err.representative_full_name")}],children:(0,y.jsx)(M.A,{size:"large",className:"pubAppInput",placeholder:t("form.ph.representative_full_name")})})}),(0,y.jsx)(u.A,{xs:24,md:12,children:(0,y.jsx)(I.A.Item,{name:"phone_number",className:"pubAppForm__item",rules:[{required:!0,message:t("form.ph.phone_number")||"Telefon majburiy"}],getValueFromEvent:e=>e.target.value,children:(0,y.jsx)(T(),{mask:"+998 (99) 999-99-99",maskChar:"_",alwaysShowMask:!0,onFocus:()=>{const e=r.getFieldValue("phone_number");e&&""!==String(e).trim()||r.setFieldsValue({phone_number:"+998 (__) ___-__-__"})},children:e=>(0,y.jsx)(M.A,(0,F.A)((0,F.A)({},e),{},{size:"large",className:"pubAppInput",placeholder:t("form.ph.phone_number"),inputMode:"tel"}))})})})]}),(0,y.jsxs)("button",{type:"submit",className:"pubAppSubmit",disabled:p,size:"large",children:[p?(0,y.jsx)(s.A,{size:"small",style:{marginRight:10}}):null,t("form.send")]})]})]})}function ne(e,n){for(const a of n){const n=null===e||void 0===e?void 0:e[a];if("string"===typeof n&&n.trim())return n}return""}function ae(e){var n,a;const i=null!==e&&void 0!==e&&e.exhibition_date?g()(e.exhibition_date):null,t=null!==i&&void 0!==i&&i.isValid()?i.month()+1:null,l=ne(e,["title","name","title_ru","title_uz","title_en"])||"\u2014",o=ne(e,["description","desc","description_ru","description_uz","description_en"])||"\u2014",r=Array.isArray(null===e||void 0===e?void 0:e.images)?e.images.filter(Boolean):[];return{id:String(null!==(n=null===e||void 0===e?void 0:e.id)&&void 0!==n?n:""),month:t,title:l,desc:o,date:null!==i&&void 0!==i&&i.isValid()?i.format("DD.MM.YYYY"):"\u2014",views:Number(null!==(a=null===e||void 0===e?void 0:e.participants_count)&&void 0!==a?a:0)||0,images:r,raw:e}}function ie(e){const n=new URLSearchParams(e||""),a=Number(n.get("month")||0);return a>=1&&a<=12?a:null}function te(){try{const e=localStorage.getItem("selectedExhibitions"),n=e?JSON.parse(e):{};return n&&"object"===typeof n?n:{}}catch(e){return{}}}function le(e,n){var a;const i=te(),t=String(e),l=String(n),o=null===i||void 0===i||null===(a=i[t])||void 0===a?void 0:a[l];return Array.isArray(o)?o.map(String):[]}function oe(e,n,a){const i=te(),t=String(e),l=String(n),o=(0,F.A)({},i);o[t]&&"object"===typeof o[t]||(o[t]={}),o[t]=(0,F.A)((0,F.A)({},o[t]),{},{[l]:Array.from(new Set(a.map(String)))}),function(e){try{localStorage.setItem("selectedExhibitions",JSON.stringify(e))}catch(n){}}(o)}var re=a(80801);const se="#5DB075";function ce(){const e=(0,t.Zp)(),n=(0,t.zy)(),{t:a,i18n:h}=(0,v.Bd)(),b=(h.language||"ru").toLowerCase(),f=g()().year(),[A,w]=(0,i.useState)(!1),[N,S]=(0,i.useState)(1),[k,q]=(0,i.useState)(6),[C,E]=(0,i.useState)((()=>{var e;return null!==(e=ie(window.location.search))&&void 0!==e?e:1})),[F,I]=(0,i.useState)((()=>{var e;const n=null!==(e=ie(window.location.search))&&void 0!==e?e:1,a=le(f,n);return(Array.isArray(a)?a:[]).map(String)})),M=(0,i.useMemo)((()=>new Set(F.map(String))),[F]);(0,i.useEffect)((()=>{var e;const a=null!==(e=ie(n.search))&&void 0!==e?e:1;E(a),S(1);const i=le(f,a);I((Array.isArray(i)?i:[]).map(String))}),[n.search,f]);const P=(0,i.useCallback)((a=>{const i=null!==a&&void 0!==a?a:1;E(i),S(1);const t=le(f,i);I((Array.isArray(t)?t:[]).map(String)),function(e,n,a){const i=new URLSearchParams(n.search||"");null==a?i.delete("month"):i.set("month",String(a)),i.delete("page");const t=i.toString();e("".concat(n.pathname).concat(t?"?".concat(t):""),{replace:!0})}(e,n,i)}),[e,n,f]),{data:T,isLoading:B,isError:Y,error:D}=(0,_.I)({queryKey:["public-exhibitions",{selectedMonth:C,year:f,currentPage:N,pageSize:k,lang:b}],queryFn:async()=>C?await re.Ay.setBase("quessinnaries").get("/public/exhibitions",{params:{month:String(C),year:String(f),page:String(N),page_size:String(k)}}):{data:{data:[],total_items:0}},placeholderData:x.rX,enabled:!!C}),H=(0,i.useMemo)((()=>{var e;const n=null===T||void 0===T||null===(e=T.data)||void 0===e?void 0:e.data;return Array.isArray(n)?n:[]}),[T]),R=(0,i.useMemo)((()=>H.map(ae)),[H]),L=(0,i.useMemo)((()=>{var e,n;return Number(null!==(e=null===T||void 0===T||null===(n=T.data)||void 0===n?void 0:n.total_items)&&void 0!==e?e:0)||R.length}),[T,R.length]),O=(0,i.useMemo)((()=>{var e,n;return Y?(null===D||void 0===D||null===(e=D.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.message)||(null===D||void 0===D?void 0:D.message)||"Failed to load exhibitions":""}
1),[Y,D]),W=(0,i.useCallback)(((e,n)=>{const a=String(e);I((e=>{const i=new Set((e||[]).map(String));n?i.add(a):i.delete(a);const t=Array.from(i);return oe(f,C,t),t}))}),[f,C]),V=()=>w(!1);return(0,y.jsxs)("div",{className:"q-page",children:[(0,y.jsx)(o.A,{open:A,onCancel:V,footer:null,width:900,centered:!0,destroyOnClose:!0,children:(0,y.jsx)(ee,{exhibitionIds:F,lang:b,onSuccess:()=>{!function(){try{localStorage.removeItem("selectedExhibitions")}catch(e){}}(),I([]),w(!1)},onClose:V})}),(0,y.jsx)("div",{className:"q-head",children:(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{className:"q-head__left",children:[(0,y.jsx)(r.Ay,{icon:(0,y.jsx)(p.A,{}),onClick:()=>e(-1),className:"q-head__back"}),(0,y.jsx)("h2",{className:"q-head__title",children:a("questionnaire")})]}),(0,y.jsxs)("div",{className:"q-head__total",children:[a("total")," ",(0,y.jsx)("b",{children:L})," ",a("ta")||"ta"]})]})}),(0,y.jsxs)("div",{className:"q-calendarRow",children:[(0,y.jsx)(j,{value:C,onChange:P,lang:b}),(0,y.jsx)("div",{className:"q-calendarRow__right",children:(0,y.jsx)("button",{type:"button",className:"q-saveBtn ".concat(0===F.length?"is-disabled":""),disabled:0===F.length,onClick:()=>{0!==F.length?w(!0):l.Ay.warning(a("select_at_least_one")||"Hech bo\u2018lmasa bitta tanlang")},children:a("vote")})})]}),B?(0,y.jsx)("div",{style:{padding:24,display:"flex",justifyContent:"center"},children:(0,y.jsx)(s.A,{})}):Y?(0,y.jsxs)("div",{style:{padding:24},children:[(0,y.jsx)("div",{style:{marginBottom:12,color:"crimson"},children:O}),(0,y.jsx)(c.A,{description:a("no_data")})]}):0===R.length?(0,y.jsx)(c.A,{style:{padding:24},description:a("no_data")}):(0,y.jsx)(d.A,{gutter:[24,24],children:R.map((e=>{const n=String(e.id),a=M.has(n);return(0,y.jsx)(u.A,{xl:8,lg:8,md:12,sm:24,xs:24,children:(0,y.jsx)(z,{item:e,selected:a,onToggle:e=>W(n,e),accentColor:se})},n)}))}),(0,y.jsx)("div",{className:"q-pagination",children:L>0?(0,y.jsx)("div",{className:"text-right mt-20",children:(0,y.jsx)(m.A,{current:N,pageSize:k,total:L,showSizeChanger:!0,pageSizeOptions:[6,12,24,48],onChange:(e,n)=>{n!==k?(q(n),S(1)):S(e)}})}):null})]})}},52867:(e,n,a)=>{a.d(n,{Hu:()=>s,IY:()=>r,Q9:()=>o,Up:()=>u,lb:()=>l});var i=a(4159),t=a.n(i);const l=function(e,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return e&&(null===e||void 0===e?void 0:e.map((e=>({label:"function"===typeof n?n(e):e[n],value:e[a]}))))||[]};function o(e){if(!e)return"";const n=null===e||void 0===e?void 0:e.match(/v=([a-zA-Z0-9_-]+)/),a=null===e||void 0===e?void 0:e.match(/youtu\.be\/([a-zA-Z0-9_-]+)/),i=null===e||void 0===e?void 0:e.match(/youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);return n&&(null===n||void 0===n?void 0:n.length)>1?n[1]:a&&a.length>1?a[1]:i&&i.length>1?i[1]:""}const r=(e,n)=>t()(new Date(e)).format(n||"YYYY-MM-DD ");function s(e){return(""+e).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")}const c=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const a=Number(e);return Number.isFinite(a)?a.toFixed(n).replace(/\.0+$/,""):"\u2014"},d=(e,n,a)=>{const i=Number(e),t=(e=>String(e||"").trim().toLowerCase())(n);if(!Number.isFinite(i))return{v:"\u2014",u:""};if("g"===t||t.includes("gram"))return{v:c(i/1e3),u:"kg"};if("kg"===t||t.includes("\u043a\u0438\u043b")||t.includes("kilo"))return{v:c(i),u:"kg"};if(t.includes("piece")||t.includes("pcs")||t.includes("dona")){const e="function"===typeof a?a("pieces"):"dona";return i>=1e6?{v:c(i/1e6),u:"mln ".concat(e)}:i>=1e3?{v:c(i/1e3),u:"k ".concat(e)}:{v:c(i,0),u:e}}return{v:c(i),u:n||""}},u=(e,n,a)=>{if(!Array.isArray(e))return null;const i=e.find((e=>String(null===e||void 0===e?void 0:e.product)===n));return i?d(null===i||void 0===i?void 0:i.power,(null===i||void 0===i?void 0:i.power_measure)||(null===i||void 0===i?void 0:i.power_messure)||(null===i||void 0===i?void 0:i.power_meassure),a):null}}}]);
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.