1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b8b91137-1f7c-4a71-a96f-2c642639cf4a",e._sentryDebugIdIdentifier="sentry-dbid-b8b91137-1f7c-4a71-a96f-2c642639cf4a")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1651],{9592:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>N});var r=n(70236),i=n(42969),o=n(45794),a=n(24702),s=n(52617),l=n(93295),u=n(14232),c=n(3031),d=n(59477),f=n(25118),v=n(59331),p=n(75224),m=n(1592),h=n(442),b=n(55822),y=n(37876);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=["Konzultant(ka) EKIS","Energetick\xfd specialista(ka) - PENB","Energetick\xfd specialista(ka) - energetick\xe9 audity / posudky","Energetick\xfd specialista(ka) - kontroly otopn\xfdch soustav","Energetick\xfd specialista(ka) - kontroly soustav vÄtr\xe1n\xed a klimatizace","Autorizovan\xfd projektant(ka) ÄKAIT - stavebn\xed","Autorizovan\xfd projektant(ka) ÄKAIT - TZB","Autorizovan\xfd technik","Autorizovan\xfd inspektor","Autorizovan\xfd architekt","Soudn\xed znalec energetika","Soudn\xed znalec stavebnictv\xed - stavby obytn\xe9","Soudn\xed znalec stavebnictv\xed - stavby průmyslov\xe9","Soudn\xed znalec stavebnictv\xed - energetick\xe1 zaÅ\xedzen\xed","Soudn\xed znalec stavebnictv\xed - stavebn\xed odvÄtn\xed různ\xe1","Technick\xfd dozor investora","Stavbyvedouc\xed","Blower door tester","Certifikovan\xfd projektant pasivn\xedch domů (Passivhaus Institut Darmstadt)","Certifikovan\xfd poradce pro pasivn\xed domy (Passivhaus Institut Darmstadt)","Certifikovan\xfd inspektor nemovitost\xed","Autorizovan\xe1 osoba SBtoolCZ","LEED AP","WELL AP","BREEAM AP","BREEAM Assessor","Osoba opr\xe1vnÄn\xe1 k instalaci OZE","Neautorizovan\xfd projektant","Älen MAS (M\xedstn\xed akÄn\xed skupina)"],k=(0,p.Z)({permissions:[],otherPermissions:[]}),P=(0,o.A)(k,2),A=P[0],w=P[1],E=(0,d.N1)(function(e){var t,n,r=e.slug,i=(0,s.useMeQuery)({ssr:!1}),o=null==(t=i.data)?void 0:t.me,l=(0,s.useMeProjectManagerQuery)({ssr:!1,fetchPolicy:"cache-and-network",variables:{withPermission:!0}}),f=null==(n=l.data)||null==(n=n.me)?void 0:n.projectManager,p=null!=f&&f.profile?(0,d.Zs)(f.profile):void 0,m=(0,u.useMemo)(function(){return f&&(0,y.jsx)(c.Breadcrumbs,{root:"/my/settings/permissions",variables:{slug:{path:r,title:null!=p?p:"Projektant"}}})},[f]),h=(0,u.useMemo)(function(){if(!(null!=f&&f.profile))return{permissions:[],otherPermissions:[]};var e,t,n,r=null!=(e=null==(t=f.profile.permission)?void 0:t.split(",").map(function(e){return e.trim()}))?e:[],i=[],o=[],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return x(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(r);try{for(a.s();!(n=a.n()).done;){var s=n.value;j.includes(s)?i.push(s):o.push(s)}}catch(e){a.e(e)}finally{a.f()}return{permissions:i,otherPermissions:o}},[f]),b=h.permissions,g=h.otherPermissions,k=["Nastaven\xed z\xe1kladn\xedch \xfadajů specialisty",p].filter(function(e){return!!e}).join(" ");return(0,y.jsx)(a.Wr,{pageTitle:k,me:o,breadcrumbs:m,openedTab:"settings-permissions",children:(0,y.jsx)(c.QueryLoader,{queries:[i,l],children:f&&f.profile&&(0,y.jsx)(v.O,{children:(0,y.jsx)(A,{initial:{permissions:b,otherPermissions:g},children:(0,y.jsx)(O,{projectManagerId:f.id,allPermissions:j})})})})})});E.getInitialProps=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?g(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},(0,f.withSlugProps)(e))};let N=E;var O=function(e){var t=e.projectManagerId,n=e.allPermissions,i=(0,v.m)(),a=w(),f=a.state,g=a.update;(0,p.$)(f,g);var x=(0,d.Yf)().addToast,j=(0,s.useEditProjectManagerPermissionMutation)({onCompleted:function(){x({kind:s.ToastKind.Success,content:"Požadavek byl \xfaspÄÅ¡n\xfd"})},update:function(e){e.evict({id:"ProjectManagerType:".concat(t)}),e.gc()}}),k=(0,o.A)(j,2),P=k[0];k[1];var A=(0,u.useMemo)(function(){var e;return null!=(e=n.map(function(e){return{label:e,value:e,checked:f.permissions.includes(e)}}))?e:[]},[]);return(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{className:"flex flex-col gap-y-48",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("h2",{className:"text-14 font-bold mb-8",children:(0,y.jsx)(l.x6,{id:"myCompany.settings.permissions"})}),(0,y.jsx)(c.Card,{children:(0,y.jsx)(h.x,{layout:"col",items:A,onChange:function(e){return g({permissions:e})}})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("h2",{className:"text-14 font-bold mb-8",children:(0,y.jsx)(l.x6,{id:"myCompany.settings.otherPermissions"})}),(0,y.jsx)(c.Card,{children:(0,y.jsx)(b.o,{addBtnText:"PÅidat položku",removeAriaLabel:"Odebrat položku",layout:"col",initial:f.otherPermissions,onChange:function(e){return g({otherPermissions:null!=e?e:[]})}})})]})]}),(0,y.jsx)(m.JL,{className:"mt-24",withTruthAffidavit:!0,state:f,update:g,onSubmit:function(){if(i.validate()){var e,n;P({variables:{id:t,permission:[].concat((0,r.A)(null!=(e=f.permissions)?e:[]),(0,r.A)(null!=(n=f.otherPermissions)?n:[])).map(function(e){return e.replaceAll(",","")}).join(",")}})}},hasPermission:!0})]})}},10020:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/my/settings/permissions",function(){return n(9592)}])},55822:(e,t,n)=>{"use strict";n.d(t,{o:()=>m});var r=n(15039),i=n.n(r),o=n(14232),a=n(83629),s=n(46640),l=n(59477),u=n(43501),c=n(91423),d=n(37847),f=n(49742),v=n(37364),p=n(37876),m=function(e){var t=e.initial,n=e.onChange,r=e.required,i=e.label,u=e.tip,f=e.addBtnText,m=e.itemPlaceholder,b=e.itemTextColorCn,y=e.removeAriaLabel,g=e.layout,x=e.validator,j=(0,l.Ph)((null==t?void 0:t.map(function(e,t){return{id:"".concat(t),text:e}}))||[]),k=j.list,P=j.add,A=j.remove,w=j.update,E=(0,o.useRef)([]),N=function(){var e=(0,c.A)();P({id:e,text:""}),S(e)},O=function(e){var t,n=null==(t=E.current)?void 0:t[e];n&&n.focus()},C=(0,o.useState)(),z=C[0],S=C[1];(0,l.Es)(function(){if(z){var e=k.findIndex(function(e){return e.id===z});-1!==e&&(O(e),S(void 0))}},[z,k]);var I=(0,o.useMemo)(function(){var e=k.map(function(e){return e.text.trim()}).filter(function(e){return!!e.length});return e.length?e:void 0},[k]),T=(0,d.$)({getValue:function(){return I},required:r,validator:x}),M=T.elementRef,_=T.validity,D=(T.validate,T.resetValidity),B=(0,o.useRef)(!0);return(0,o.useEffect)(function(){if(B.current){B.current=!1;return}n(I),D()},[I]),(0,p.jsxs)(a.z,{label:i,tip:u,validity:_,required:r,fieldRef:M,layout:g,children:[(0,p.jsx)("div",{children:(0,p.jsxs)(s.$n,{variant:"bare",className:"flex gap-16 items-center group",onClick:function(){var e=k[k.length-1];if(e&&!e.text.length)return S(e.id);N()},children:[(0,p.jsx)("div",{className:"w-24 h-2 flex items-center justify-center",children:(0,p.jsx)(v.A,{className:"w-24 h-auto text-blue-700 group-hover:text-blue-800"})}),(0,p.jsx)("span",{className:"text-blue-700 group-hover:text-blue-800 group-hover:underline",children:f})]})}),!!k.length&&(0,p.jsx)("div",{className:"flex flex-col gap-8 mt-8",children:k.map(function(e,t){var n=e.id,r=e.text;return(0,p.jsx)(h,{ref:function(e){E.current&&(E.current[t]=e)},initial:r,placeholder:m,onBlur:function(e){return w(n,{text:e})},onRemove:function(e){A(n),e&&t>0&&O(t-1)},onNext:function(e){if(e.length){var n=t+1;k[n]?O(n):N()}},textColorCn:b,removeAriaLabel:y},n)})})]})},h=(0,o.forwardRef)(function(e,t){var n=e.initial,r=e.onBlur,a=e.onRemove,l=e.onNext,c=e.placeholder,d=e.removeAriaLabel,v=e.textColorCn,m=(0,o.useState)(n),h=m[0],b=m[1];function y(e){e.style.height="1px",e.style.height=e.scrollHeight+"px"}var g=(0,o.useCallback)(function(e){if(e)return y(e),null==t?void 0:t(e)},[]);return(0,p.jsxs)("div",{className:"flex gap-8 items-start",children:[(0,p.jsx)(s.$n,{type:"button",variant:"bare",tabIndex:-1,
1className:"flex gap-8 group items-center shrink-0",onClick:function(){return a(!1)},ariaLabel:d,children:(0,p.jsx)("div",{className:"w-24 h-24 mt-8 flex items-center justify-center",children:(0,p.jsx)(f.A,{className:"w-24 h-auto text-black-600 group-hover:text-red"})})}),(0,p.jsx)("textarea",{className:i()(u.s,h&&"border-transparent!",v,"focus:text-black-900 resize-none overflow-hidden pl-8"),ref:g,rows:1,value:h,onInput:function(e){var t=e.currentTarget;b(t.value),y(t)},placeholder:c,onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),l(e.currentTarget.value)),"Backspace"!==e.key||h.length||(e.preventDefault(),a(!0))},onBlur:function(e){return r(e.target.value)}})]})});h.displayName="Item"}},e=>{var t=t=>e(e.s=t);e.O(0,[5118,1495,1592,636,6593,8792],()=>t(10020)),_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.