/
opt
/
canhelp
/
apps
/
web
/
.next
/
static
/
chunks
/
app
/
tasks
/
new
/
/opt/canhelp/apps/web/.next/static/chunks/app/tasks/new
mkdir
upload
Name
Size
Mode
Actions
page-f488fb1a3ed4fb5c.js
26495
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/static/chunks/app/tasks/new/page-f488fb1a3ed4fb5c.js
(26495B)
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9478],{1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>l})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>s,Jv:()=>l,wV:()=>i,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:a,signUp:s,useSession:i}=n},2928:(e,t,r)=>{"use strict";r.d(t,{l:()=>f,$:()=>p});var n=r(4568),l=r(7620),a=(0,l.forwardRef)((e,t)=>{let{as:r="div",...l}=e;return(0,n.jsx)(r,{...l,ref:t})});let s="onloadTurnstileCallback",i=e=>!!document.getElementById(e),o={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",d,u=new Promise((e,t)=>{d={resolve:e,reject:t},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return"unloaded"===c&&(c="loading",window[e]=()=>{d.resolve(),c="ready",delete window[e]}),u},x=(0,l.forwardRef)((e,t)=>{let{scriptOptions:r,options:d={},siteKey:u,onWidgetLoad:x,onSuccess:g,onExpire:f,onError:p,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y,onLoadScript:w,id:j,style:N,as:k="div",injectScript:S=!0,rerenderOnCallbackChange:E=!1,...C}=e,D=d.size,T=(0,l.useCallback)(()=>void 0===D?{}:"execute"===d.execution?o.invisible:"interaction-only"===d.appearance?o.interactionOnly:o[D],[d.execution,D,d.appearance]),[_,I]=(0,l.useState)(T()),A=(0,l.useRef)(null),[L,R]=(0,l.useState)(!1),U=(0,l.useRef)(void 0),O=(0,l.useRef)(!1),F=j||"cf-turnstile",P=(0,l.useRef)({onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y});(0,l.useEffect)(()=>{E||(P.current={onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y})});let M=(null==r?void 0:r.id)||"cf-turnstile-script",z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[t,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let t=()=>{i(e)&&r(!0)},n=new MutationObserver(t);return n.observe(document,{childList:!0,subtree:!0}),t(),()=>{n.disconnect()}},[e]),t}(M),B=(null==r?void 0:r.onLoadCallbackName)||"onloadTurnstileCallback",V=d.appearance||"always",H=(0,l.useMemo)(()=>{var e;return{sitekey:u,action:d.action,cData:d.cData,theme:d.theme||"auto",language:d.language||"auto",tabindex:d.tabIndex,"response-field":d.responseField,"response-field-name":d.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(D),retry:d.retry||"auto","retry-interval":d.retryInterval||8e3,"refresh-expired":d.refreshExpired||"auto","refresh-timeout":d.refreshTimeout||"auto",execution:d.execution||"render",appearance:d.appearance||"always","feedback-enabled":null==(e=d.feedbackEnabled)||e,callback:e=>{var t,r;O.current=!0,E?null==g||g(e):null==(t=(r=P.current).onSuccess)||t.call(r,e)},"error-callback":E?p:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onError)?void 0:e.call(t,...n)},"expired-callback":E?f:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onExpire)?void 0:e.call(t,...n)},"before-interactive-callback":E?h:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onBeforeInteractive)?void 0:e.call(t,...n)},"after-interactive-callback":E?b:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onAfterInteractive)?void 0:e.call(t,...n)},"unsupported-callback":E?v:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onUnsupported)?void 0:e.call(t,...n)},"timeout-callback":E?y:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l<r;l++)n[l]=arguments[l];return null==(e=(t=P.current).onTimeout)?void 0:e.call(t,...n)}}},[d.action,d.appearance,d.cData,d.execution,d.language,d.refreshExpired,d.responseField,d.responseFieldName,d.retry,d.retryInterval,d.tabIndex,d.theme,d.feedbackEnabled,d.refreshTimeout,u,D,E,E?g:null,E?p:null,E?f:null,E?h:null,E?b:null,E?v:null,E?y:null]),W=(0,l.useCallback)(()=>"u">typeof window&&!!window.turnstile,[]);return(0,l.useEffect)(function(){S&&!L&&(m(B),(e=>{let{render:t="explicit",onLoadCallbackName:r=s,scriptOptions:{nonce:n="",defer:l=!0,async:a=!0,id:o="",appendTo:c,onError:d,crossOrigin:u=""}={}}=e,m=o||"cf-turnstile-script";if(i(m))return;let x=document.createElement("script");x.id=m,x.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(r,"&render=").concat(t),document.querySelector('script[src="'.concat(x.src,'"]'))||(x.defer=!!l,x.async=!!a,n&&(x.nonce=n),u&&(x.crossOrigin=u),d&&(x.onerror=d,delete window[r]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(x))})({onLoadCallbackName:B,scriptOptions:{...r,id:M}}))},[S,L,r,M,B]),(0,l.useEffect)(function(){"ready"!==c&&m(B).then(()=>R(!0)).catch(console.error)},[B]),(0,l.useEffect)(function(){if(!A.current||!L)return;let e=!1;return(async()=>{e||!A.current||(U.current=window.turnstile.render(A.current,H),U.current&&(null==x||x(U.current)))})(),()=>{e=!0,U.current&&(window.turnstile.remove(U.current),O.current=!1)}},[F,L,H]),(0,l.useImperativeHandle)(t,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&U.current&&W()?e.getResponse(U.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((r,n)=>{let l,a=async()=>{if(O.current&&window.turnstile&&U.current)try{let e=window.turnstile.getResponse(U.current);return l&&clearTimeout(l),e?r(e):n(Error("No response received"))}catch(e){return l&&clearTimeout(l),console.warn("Failed to get response",e),n(Error("Failed to get response"))}l||(l=setTimeout(()=>{l&&clearTimeout(l),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,t)),await a()};a()})},reset(){if(!(null==e?void 0:e.reset)||!U.current||!W())return void console.warn("Turnstile has not been loaded");"execute"===d.execution&&I(o.invisible);try{O.current=!1,e.reset(U.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(U.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!U.current||!W())return void console.warn("Turnstile has not been loaded");I(o.invisible),O.current=!1,e.remove(U.current),U.current=null},render(){if(!(null==e?void 0:e.render)||!A.current||!W()||U.current)return void console.warn("Turnstile has not been loaded or container not found");let t=e.render(A.current,H);return U.current=t,U.current&&(null==x||x(U.current)),"execute"!==d.execution&&I(D?o[D]:{}),t},execute:()=>"execute"!==d.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&A.current&&U.current&&W()?void(e.execute(A.current,H),I(D?o[D]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&U.current&&W()?e.isExpired(U.current):(console.warn("Turnstile has not been loaded"),!1)}},[U,d.execution,D,H,A,W,L,x]),(0,l.useEffect)(()=>{if(L||!z)return;if(window.turnstile)return void R(!0);let e=setInterval(()=>{window.turnstile&&(R(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[L,z]),(0,l.useEffect)(()=>{I(T())},[d.execution,D,V]),(0,l.useEffect)(()=>{z&&"function"==typeof w&&w()},[z]),(0,n.jsx)(a,{ref:A,as:k,id:F,style:{..._,...N},...C})});x.displayName="Turnstile";let g="0x4AAAAAAC_FtTQJ0_6Cp9-9",f=!!g;function p(e){let{onSuccess:t,onError:r,onExpire:l}=e;return g?(0,n.jsx)(x,{siteKey:g,onSuccess:t,onError:r,onExpire:l,options:{theme:"light",language:"auto"}}):null}},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>i,z:()=>o});var n=r(4568),l=r(7620),a=r(2982);let s=(0,l.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function i(e){let{children:t,initialSlug:r=""}=e,[i,o]=(0,l.useState)(r),[c,d]=(0,l.useState)([]),[u,m]=(0,l.useState)(!0);(0,l.useEffect)(()=>{o(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,l.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>m(!1))},[]);let x=(0,l.useCallback)(e=>{o(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),g=(0,l.useCallback)(e=>{if(!i)return"";for(let l of c){var t,r,n;if(l.slug===i)return null!=(t=l.names[e])?t:l.names.el;for(let t of null!=(r=l.children)?r:[])if(t.slug===i)return null!=(n=t.names[e])?n:t.names.el}return i},[i,c]);return(0,n.jsx)(s.Provider,{value:{locationSlug:i,locationTree:c,locationLoading:u,setLocation:x,getLabel:g},children:t})}function o(){return(0,l.useContext)(s)}},5338:(e,t,r)=>{"use strict";function n(e,t){if(!e)return"";let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<5)return t("user.online");if(r<60)return t("user.seen_minutes").replace("{n}",String(r));let n=Math.floor(r/60);if(n<24)return t("user.seen_hours").replace("{n}",String(n));let l=Math.floor(n/24);return 1===l?t("user.seen_yesterday"):t("user.seen_days").replace("{n}",String(l))}r.d(t,{V:()=>n})},6261:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(4568),l=r(7620),a=r(7541),s=r(9664),i=r.n(s),o=r(1592),c=r(9906),d=r(4029),u=r(2982),m=r(1258),x=r(5338),g=r(3119),f=r(2818),p=r(2928);let h="https://api.canhelp.gr",b=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)};function v(){var e;let{data:t,isPending:r}=(0,o.wV)(),s=(0,a.useRouter)(),v=null!=(e=(0,a.useSearchParams)().get("category"))?e:"",{t:y,locale:w}=(0,c.Y)(),[j,N]=(0,l.useState)([]),[k,S]=(0,l.useState)([]),[E,C]=(0,l.useState)(!1),[D,T]=(0,l.useState)(""),[_,I]=(0,l.useState)([]),[A,L]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e)}),[R,U]=(0,l.useState)(30),[O,F]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e).slice(0,7)}),P=(0,l.useRef)(null),[M,z]=(0,l.useState)({}),[B,V]=(0,l.useState)(new Set),[H,W]=(0,l.useState)(p.l?"":"dev"),{locationSlug:q}=(0,d.z)(),[K,J]=(0,l.useState)(""),[Y,$]=(0,l.useState)(v);(0,l.useEffect)(()=>{q&&J(q)},[q]);let[G,Q]=(0,l.useState)([]),[X,Z]=(0,l.useState)(!1),ee=(0,l.useRef)(null);async function et(e){var t;let r=null==(t=e.target.files)?void 0:t[0];if(r){Z(!0);try{let e=new FormData;e.append("file",r);let t=await fetch("".concat(h,"/api/uploads"),{method:"POST",credentials:"include",body:e});if(!t.ok)throw Error("Upload failed");let{url:n}=await t.json();Q(e=>[...e,"".concat(h).concat(n)])}catch(e){T(y("profile.upload.error"))}finally{Z(!1),ee.current&&(ee.current.value="")}}}async function er(e){e.preventDefault(),T(""),C(!0);let t=new FormData(e.currentTarget),r={title:t.get("title"),description:t.get("description"),category:t.get("category")||void 0,location:t.get("location")||void 0,budget:t.get("budget")?Number(t.get("budget")):void 0,budgetNegotiable:"on"===t.get("budgetNegotiable"),deadline:t.get("deadline")?new Date(t.get("deadline")).toISOString():void 0,expiresAt:(()=>{let e=new Date;return e.setDate(e.getDate()+Number(t.get("expiresAtDays")||30)),e.toISOString()})(),timeSlot:t.get("timeSlot")||void 0,district:t.get("district")||void 0,street:t.get("street")||void 0,houseNumber:t.get("houseNumber")||void 0,confidentialNote:t.get("confidentialNote")||void 0,images:G.length>0?G:void 0,status:"open",locale:w,inviteSpecialistIds:B.size>0?[...B]:void 0};try{let e=await (0,u.UT)({...r,captchaToken:H});s.push("/tasks/".concat(e.id))}catch(e){T(e.message||y("create.error"))}finally{C(!1)}}if((0,l.useEffect)(()=>{r||t||s.push("/login"),(0,u.bW)().then(N).catch(()=>{}),(0,u.Vs)().then(S).catch(()=>{})},[t,r]),(0,l.useEffect)(()=>{if(!Y)return void I([]);(0,u.F7)({limit:"5",category:Y,locale:w}).then(e=>I(e.data)).catch(()=>{})},[Y,w]),(0,l.useEffect)(()=>{if(!A||0===_.length)return;let e=A.slice(0,7);Promise.all(_.map(e=>e.id).map(t=>fetch("".concat(h,"/api/availability/user/").concat(t,"?month=").concat(e),{credentials:"include"}).then(e=>e.ok?e.json():[]).then(e=>{var r;let n=e.find(e=>e.date===A);return{id:t,status:null!=(r=null==n?void 0:n.status)?r:null}}).catch(()=>({id:t,status:null})))).then(e=>{let t={};e.forEach(e=>{let{id:r,status:n}=e;t[r]=n}),z(t)})},[A,_]),r)return(0,n.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let en="en"===w?"en":"ru"===w?"ru":"uk"===w?"uk":"el",el="ru"===w?"ru-RU":"uk"===w?"uk-UA":"en"===w?"en-US":"el-GR",ea=new Date;ea.setHours(0,0,0,0);let[es,ei]=O.split("-").map(Number),eo=new Date(es,ei,0).getDate(),ec=[];for(let e=1;e<=eo;e++){let t=new Date(es,ei-1,e);t>=ea&&ec.push(t)}let ed=Array.from({length:12},(e,t)=>{let r=new Date;return r.setDate(1),r.setMonth(r.getMonth()+t),{value:b(r).slice(0,7),label:r.toLocaleDateString(el,{month:"long",year:"numeric"})}}),eu=y("tasks.new.top_specialists");return(0,n.jsxs)("div",{className:"max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8",children:[(0,n.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6",children:y("create.title")}),(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-6 lg:gap-8 items-start",children:[(0,n.jsx)("div",{className:"flex-1 min-w-0 w-full",children:(0,n.jsxs)("form",{onSubmit:er,className:"bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5",children:[D&&(0,n.jsx)("div",{className:"bg-red-50 text-red-700 p-3 rounded-lg text-sm",children:D}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.category")}),(0,n.jsx)(f.W,{categories:j,locale:en,value:Y,onChange:$,placeholder:y("create.field.category.select")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.location")}),(0,n.jsx)(g.V,{locations:k,value:K,onChange:J,anyLabel:y("create.field.location.any"),allLabel:y("create.field.location.all")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.title")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("input",{name:"title",required:!0,minLength:5,maxLength:200,placeholder:y("create.field.title.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.description")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("textarea",{name:"description",required:!0,minLength:20,rows:4,placeholder:y("create.field.description.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.budget")}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"budget",type:"number",min:1,step:1,placeholder:y("create.field.budget.placeholder"),className:"w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,n.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,n.jsx)("input",{type:"checkbox",name:"budgetNegotiable",className:"w-4 h-4 rounded border-gray-300 text-green-600"}),(0,n.jsx)("span",{className:"text-sm text-gray-700",children:y("create.field.budget_negotiable")})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700 shrink-0",children:y("create.field.deadline")}),(0,n.jsx)("select",{value:O,onChange:e=>F(e.target.value),className:"flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:ed.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,n.jsx)("button",{type:"button",title:"Открыть календарь",onClick:()=>{var e,t;try{null==(e=P.current)||e.showPicker()}catch(e){null==(t=P.current)||t.click()}},className:"shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,n.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,n.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,n.jsx)("input",{ref:P,type:"date",min:b(ea),value:A,onChange:e=>{e.target.value&&(L(e.target.value),F(e.target.value.slice(0,7)))},className:"absolute w-0 h-0 opacity-0 pointer-events-none"})]}),(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory",children:ec.map(e=>{let t=b(e),r=A===t,l=e.toLocaleDateString(el,{weekday:"short"}),a=e.getDate();return(0,n.jsxs)("button",{type:"button",onClick:()=>L(t),className:"flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(r?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50"),children:[(0,n.jsx)("span",{className:"text-xs font-medium uppercase leading-none mb-0.5",children:l}),(0,n.jsx)("span",{className:"text-xl font-bold leading-none",children:a})]},t)})}),(0,n.jsx)("input",{type:"hidden",name:"deadline",value:A})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.expires_at")}),(0,n.jsx)("div",{className:"flex gap-2",children:[7,14,30,60].map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>U(e),className:"flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(R===e?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300"),children:[e," ",y("create.field.expires_at.days").replace("{n}","")]},e))}),(0,n.jsx)("input",{type:"hidden",name:"expiresAtDays",value:R})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.time_slot")}),(0,n.jsxs)("select",{name:"timeSlot",className:"w-full border border-gray-300 rounded-lg px-3 py-2",children:[(0,n.jsx)("option",{value:"",children:y("create.field.time_slot.any")}),(0,n.jsx)("option",{value:"morning",children:y("create.field.time_slot.morning")}),(0,n.jsx)("option",{value:"afternoon",children:y("create.field.time_slot.afternoon")}),(0,n.jsx)("option",{value:"evening",children:y("create.field.time_slot.evening")}),(0,n.jsx)("option",{value:"weekend",children:y("create.field.time_slot.weekend")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.photos")}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mb-2",children:[G.map((e,t)=>(0,n.jsxs)("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200",children:[(0,n.jsx)("img",{src:e,alt:"",className:"w-full h-full object-cover"}),(0,n.jsx)("button",{type:"button",onClick:()=>Q(e=>e.filter((e,r)=>r!==t)),className:"absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70",children:"\xd7"})]},t)),G.length<5&&(0,n.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=ee.current)?void 0:e.click()},disabled:X,className:"w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50",children:X?"...":(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-2xl leading-none",children:"+"}),(0,n.jsx)("span",{children:y("create.field.photos.add")})]})})]}),(0,n.jsx)("input",{ref:ee,type:"file",accept:"image/*",className:"hidden",onChange:et})]}),(0,n.jsxs)("div",{className:"space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl",children:[(0,n.jsxs)("p",{className:"text-xs font-medium text-yellow-700 flex items-center gap-1",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"\uD83D\uDD12 ",y("create.field.confidential.hint")]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.address")}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"district",placeholder:y("create.field.address.district"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"street",placeholder:y("create.field.address.street"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"houseNumber",placeholder:y("create.field.address.house"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.confidential")}),(0,n.jsx)("textarea",{name:"confidentialNote",rows:2,placeholder:y("create.field.confidential.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white"})]})]}),(0,n.jsx)(p.$,{onSuccess:W,onError:()=>W(""),onExpire:()=>W("")}),(0,n.jsx)("button",{type:"submit",disabled:E||!H,className:"w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:E?y("create.submitting"):y("create.submit")})]})}),(0,n.jsx)("aside",{className:"hidden lg:block lg:w-64 shrink-0",children:(0,n.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 sticky top-24",children:[(0,n.jsx)("h3",{className:"font-semibold text-gray-900 mb-4 text-sm",children:eu}),Y?0===_.length?(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("specialists.empty")}):(0,n.jsx)("div",{className:"space-y-3",children:_.map(e=>{var t,r,l,a,s,o;let c=(0,m.H)(e.firstName,e.lastName,e.name),d="".concat(null!=(s=null==(t=e.firstName)?void 0:t[0])?s:"").concat(null!=(o=null==(r=e.lastName)?void 0:r[0])?o:"").toUpperCase()||(null==(a=e.name)||null==(l=a[0])?void 0:l.toUpperCase())||"?",u=(0,x.V)(e.lastSeenAt,y),g=M[e.id],f=B.has(e.id);return(0,n.jsxs)("div",{className:"rounded-lg border border-gray-100 hover:bg-gray-50 transition",children:[(0,n.jsxs)(i(),{href:"/users/".concat(e.id),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-2",children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100",children:e.image?(0,n.jsx)("img",{src:e.image,alt:c,className:"w-full h-full object-cover"}):d}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:c}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.rating?(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["★ ",Number(e.rating).toFixed(1)]}):u?(0,n.jsx)("p",{className:"text-xs text-gray-400",children:u}):null,"number"==typeof e.reviewCount&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-gray-400",children:[e.reviewCount," ",y("reviews.count")]}),"number"==typeof e.positivePercent&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-green-600",children:[e.positivePercent,"% \uD83D\uDC4D"]}),"available"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 inline-block"}),y("schedule.available")]}),"busy"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 inline-block"}),y("schedule.busy")]})]})]})]}),(0,n.jsx)("div",{className:"px-2 pb-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>V(t=>{let r=new Set(t);return r.has(e.id)?r.delete(e.id):r.add(e.id),r}),className:"w-full text-xs font-medium py-1 rounded-lg transition ".concat(f?"bg-green-600 text-white hover:bg-green-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:f?y("tasks.new.invited"):y("tasks.new.invite")})})]},e.id)})}):(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("tasks.new.select_category")})]})})]})]})}},7029:(e,t,r)=>{Promise.resolve().then(r.bind(r,6261))}},e=>{e.O(0,[1516,9664,9906,2982,1530,587,18,7358],()=>e(e.s=7029)),_N_E=e.O()}]);
Save
cmd:
run