1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5060],{93162:function(e,n,t){var r,s,i;s=[],r=function(){"use strict";function n(e,n){return"undefined"==typeof n?n={autoBom:!1}:"object"!=typeof n&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function r(e,n,t){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,n,t)},r.onerror=function(){console.error("could not download file")},r.send()}function s(e){var n=new XMLHttpRequest;n.open("HEAD",e,!1);try{n.send()}catch(e){}return 200<=n.status&&299>=n.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof t.g&&t.g.global===t.g?t.g:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,t){var a=o.URL||o.webkitURL,l=document.createElement("a");n=n||e.name||"download",l.download=n,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):s(l.href)?r(e,n,t):i(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,o){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(n(e,o),t);else if(s(e))r(e,t,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout((function(){i(a)}))}}:function(e,n,t,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return r(e,n,t);var i="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||i&&l||a)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,f=d.createObjectURL(e);s?s.location=f:location.href=f,s=null,setTimeout((function(){d.revokeObjectURL(f)}),4e4)}});o.saveAs=l.saveAs=l,e.exports=l},void 0===(i="function"===typeof r?r.apply(n,s):r)||(e.exports=i)},83590:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/surveys",function(){return t(90241)}])},69149:function(e,n,t){"use strict";t.d(n,{t:function(){return f}});var r=t(85893),s=t(82183),i=t(20013),o=t(17524),a=t(30347),l=t(67294),u=t(93054),c=[5,10,20,50,100].map((function(e){return{value:e,label:e.toString()}})),d=function(e){return(0,r.jsx)("button",{className:"\n text-xs font-semibold\n px-2 py-1\n rounded\n transition-colors\n flex justify-center basis-8 flex-shrink-0\n hover:bg-boni-blue/25\n disabled:text-slate-200 disabled:bg-slate-50 disabled:hover:bg-slate-50\n ".concat(e.active?"bg-boni-blue text-white":"bg-slate-100","\n "),disabled:e.disabled,onClick:e.onClick,type:"button",children:e.children})},f=function(e){var n=function(){return e.pageIndex==p},t=function(){var n=p+f-1;return e.pageIndex==n},f=Math.ceil(e.itemsCount/e.itemsPerPage),v=(0,l.useState)(0),p=v[0],m=v[1],x=(0,l.useState)(0),h=x[0],g=x[1],b=(0,l.useState)(e.itemsPerPage||20),y=b[0],w=b[1],j=(0,l.useCallback)((function(e){var n=Math.max(0,e-Math.floor(2.5)),t=Math.min(n+5,f),r=t-n;r<5&&(n=Math.max(0,n-(5-r))),m(n),g(t)}),[f]);return(0,l.useEffect)((function(){j(e.pageIndex)}),[e.pageIndex,j]),(0,r.jsxs)("div",{className:"flex gap-2 justify-between py-2 text-slate-600",children:[(0,r.jsx)("div",{className:"w-32"}),(0,r.jsxs)("div",{className:"flex overflow-hidden flex-1 gap-2 justify-center items-center",children:[(0,r.jsx)(d,{onClick:function(){j(0)},disabled:n(),children:(0,r.jsx)(s.Z,{className:"h-4"})}),(0,r.jsx)(d,{onClick:function(){j(p-5)},disabled:n(),children:(0,r.jsx)(i.Z,{className:"h-4"})}),function(e){for(var n=[],t=e;t<h;t++)n.push(t);return n}(p).map((function(n,t){return(0,r.jsx)(d,{active:e.pageIndex==n,onClick:function(){e.onClickPage(n)},children:n+1},t)})),(0,r.jsx)(d,{onClick:function(){j(h)},disabled:t(),children:(0,r.jsx)(o.Z,{className:"h-4"})}),(0,r.jsx)(d,{onClick:function(){j(f-5)},disabled:t(),children:(0,r.jsx)(a.Z,{className:"h-4"})})]}),(0,r.jsx)("div",{className:"w-32",children:(0,r.jsx)(u.ZP,{options:c,value:{value:y,label:y.toString()},onChange:function(n){return function(n){w(n),e.onClickPage(0),e.onItemsPerPageChange(n)}(n.value)},isSearchable:!1,menuPlacement:"auto"})})]})}},31445:function(e,n,t){"use strict";t.d(n,{E:function(){return g},B:function(){return y}});var r=t(34051),s=t.n(r),i=t(17283),o=t(43170),a=t(57976),l=t(8819),u=t(37865);function c(e,n,t,r,s,i,o){try{var a=e[i](o),l=a.value}catch(u){return void t(u)}a.done?n(l):Promise.resolve(l).then(r,s)}function d(e){return function(){var n=this,t=arguments;return new Promise((function(r,s){var i=e.apply(n,t);function o(e){c(i,r,s,o,a,"next",e)}function a(e){c(i,r,s,o,a,"throw",e)}o(void 0)}))}}function f(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){f(e,n,t[n])}))}return e}function p(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function m(){var e=p(["\n query sendPushNotification($title: String, $body: String, $groupID: String, $uriType: String, $uri: String, $extraData: String) {\n sendPushNotification(title: $title, body: $body, groupID: $groupID, uriType: $uriType, uri: $uri, extraData: $extraData){\n responses {\n success\n messageId\n },\n successCount,\n failureCount\n }\n }"]);return m=function(){return e},e}function x(){var e=p(["\n query sendPushNotification($title: String, $body: String, $userIDs: [String], $uriType: String, $uri: String){\n sendPushNotification(title: $title, body: $body, userIDs: $userIDs, uriType: $uriType, uri: $uri){\n responses {\n success\n messageId\n },\n successCount,\n failureCount\n }\n }"]);return x=function(){return e},e}function h(){var e=localStorage.getItem("hjwt");if(!e&&document.cookie){var n=document.cookie.split(";").find((function(e){return e.trim().startsWith("__Secure-next-auth.session-token=")||e.trim().startsWith("next-auth.session-token=")}));n&&(e=n.split("=")[1])}return e}function g(e,n,t,r,s,i){return b.apply(this,arguments)}function b(){return(b=d(s().mark((function e(n,t,r,c,d,f){var p,x,g,b,y;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=(0,i.Ps)(m()),x=(0,o.L)({uri:"https://firmapp-backend.netlify.app/.netlify/functions/graphql"}
1),g=(0,u.v)((function(e,n){var t=n.headers,r=h();return{headers:v({},t,r&&{authorization:"Bearer ".concat(r)})}})),b=new a.f({cache:new l.h,link:g.concat(x)}),e.prev=4,e.next=7,b.query({query:p,variables:{title:n,body:t,groupID:r,uriType:c,uri:d,extraData:f?JSON.stringify(f):void 0}});case 7:return y=e.sent,e.abrupt("return",y.data.sendPushNotification);case 11:throw e.prev=11,e.t0=e.catch(4),console.error("Error sending push notification to group:",e.t0),e.t0;case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}function y(e,n,t,r,s){return w.apply(this,arguments)}function w(){return(w=d(s().mark((function e(n,t,r,c,d){var f,p,m,g,b;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=(0,i.Ps)(x()),p=(0,o.L)({uri:"https://firmapp-backend.netlify.app/.netlify/functions/graphql"}),m=(0,u.v)((function(e,n){var t=n.headers,r=h();return{headers:v({},t,r&&{authorization:"Bearer ".concat(r)})}})),g=new a.f({cache:new l.h,link:m.concat(p)}),e.prev=4,e.next=7,g.query({query:f,variables:{title:n,body:t,userIDs:r,uriType:c,uri:d}});case 7:return b=e.sent,e.abrupt("return",b.data.sendPushNotification);case 11:throw e.prev=11,e.t0=e.catch(4),console.error("Error sending push notification to users:",e.t0),e.t0;case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}},11927:function(e,n,t){"use strict";function r(e,n){var t,r,s;return null===e||void 0===e||null===(t=e.user)||void 0===t||null===(r=t.roleObj)||void 0===r||null===(s=r.permissions)||void 0===s?void 0:s.includes(n)}t.d(n,{C:function(){return r}})},90241:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return E},default:function(){return A}});var r=t(34051),s=t.n(r),i=t(85893),o=t(37887),a=t(33299),l=t(97568),u=t(67294),c=t(44297),d=t(20921),f=t(92422),v=t(28309),p=t(69149),m=t(11163),x=t(31445),h=t(11927),g=t(13560),b=t(84105),y=t(93162),w=t(17283);function j(){var e,n,t=(e=["\n query getSurveyDetails($id: uuid!) {\n surveys(where: { id: { _eq: $id } }) {\n id\n title\n anonymous\n options(order_by: { created_at: asc }) {\n id\n title\n answers_aggregate { aggregate { count } }\n answers { user { id first_name last_name } }\n }\n }\n }\n"],n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}})));return j=function(){return t},t}var _=(0,w.Ps)(j());function N(e){var n,t=e.open,r=e.onClose,s=e.surveyId,a=(0,l.$G)(["surveys"]).t,u=(0,o.a)(_,{variables:{id:s},skip:!t}),c=u.data,d=u.loading;if(!t)return null;var f=null===c||void 0===c||null===(n=c.surveys)||void 0===n?void 0:n[0];return f?(0,i.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:(0,i.jsxs)("div",{className:"w-full max-w-2xl p-4 bg-white rounded shadow-xl",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:a("surveys.details_dialog_title")}),(0,i.jsx)("button",{className:"text-slate-500",onClick:r,children:"\u2715"})]}),d?(0,i.jsx)("div",{className:"py-8 text-center",children:a("surveys.loading")}):(0,i.jsx)("div",{className:"flex flex-col gap-4 max-h-[70vh] overflow-auto",children:f.options.map((function(e){var n,t,r;return(0,i.jsxs)("div",{className:"p-3 bg-slate-50 rounded",children:[(0,i.jsxs)("div",{className:"mb-2 font-semibold",children:[e.title," (",(null===(n=e.answers_aggregate)||void 0===n||null===(t=n.aggregate)||void 0===t?void 0:t.count)||0,")"]}),(0,i.jsx)("ul",{className:"list-disc pl-5 text-sm text-slate-700",children:null===(r=e.answers)||void 0===r?void 0:r.map((function(e,n){var t,r;return(0,i.jsx)("li",{children:[null===(t=e.user)||void 0===t?void 0:t.first_name,null===(r=e.user)||void 0===r?void 0:r.last_name].filter(Boolean).join(" ")},n)}))})]},e.id)}))}),(0,i.jsx)("div",{className:"flex justify-end mt-4",children:(0,i.jsx)("button",{className:"px-4 py-2 text-white rounded bg-boni-blue",onClick:r,children:a("surveys.close")})})]})}):null}var k=t(51534);function P(e,n,t,r,s,i,o){try{var a=e[i](o),l=a.value}catch(u){return void t(u)}a.done?n(l):Promise.resolve(l).then(r,s)}function S(e){return function(){var n=this,t=arguments;return new Promise((function(r,s){var i=e.apply(n,t);function o(e){P(i,r,s,o,a,"next",e)}function a(e){P(i,r,s,o,a,"throw",e)}o(void 0)}))}}function C(){var e,n,t=(e=["\n query exportSurveyDetails($id: uuid!) {\n surveys(where: { id: { _eq: $id } }) {\n id\n title\n options(order_by: { created_at: asc }) {\n id\n title\n answers {\n user { id first_name last_name }\n }\n answers_aggregate { aggregate { count } }\n }\n }\n }\n "],n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}})));return C=function(){return t},t}(0,g.Z)(function(){var e=S(s().mark((function e(n,t,r){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("send push notification to groups",n),e.next=3,Promise.all(n.map((function(e){return(0,x.E)(t,r,e,"internal","GroupStack/Group/Survey")})));case 3:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}(),3e3);var O=function(e){var n,t,r,o,c,p,x=e.survey,g=(0,l.$G)(["surveys"]).t,j=((0,l.$G)("push_notifications").t,(0,m.useRouter)()),_=(0,a.useSession)().data,P=(0,u.useState)(!1),O
1=P[0],I=P[1],$=(0,u.useState)(!1),E=$[0],A=$[1],T=(0,u.useState)(!1),D=T[0],q=T[1],L=!x.is_standard&&(0,h.C)(_,"survey_update")||x.is_standard&&((0,h.C)(_,"standardcontent_edit")||"moderator"===(null===(n=_.user)||void 0===n||null===(t=n.roleObj)||void 0===t?void 0:t.name)&&x.id);return(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-2 overflow-hidden bg-white rounded-md",children:[(0,i.jsxs)("div",{className:"flex justify-between pr-4",children:[(0,i.jsx)("h3",{className:"flex items-center gap-2",children:(0,i.jsx)("span",{className:"font-semibold text-slate-600",children:null===x||void 0===x?void 0:x.title})}),(0,i.jsxs)("div",{className:"flex gap-4 my-2",children:[!x.is_standard&&(0,i.jsxs)("div",{className:"flex items-center gap-1 text-sm text-slate-400",children:[(0,i.jsx)(v.e,{icon:"UserGroupIcon",className:"w-4 h-4 text-boni-gold"}),(null===x||void 0===x||null===(r=x.group)||void 0===r?void 0:r.name)||g("surveys.all_groups")]}),x.is_standard&&(0,i.jsx)("span",{className:"block px-2 py-1 text-xs font-semibold text-white rounded bg-boni-blue",children:g("surveys.standard_content")}),(0,i.jsxs)("div",{className:"flex items-center gap-1 text-sm text-slate-400",children:[(0,i.jsx)(v.e,{icon:"UserIcon",className:"w-4 h-4 text-boni-gold"}),[null===x||void 0===x||null===(o=x.user)||void 0===o?void 0:o.first_name,null===x||void 0===x||null===(c=x.user)||void 0===c?void 0:c.last_name].filter(Boolean).join(" ")]}),(0,i.jsxs)("div",{className:"flex items-center gap-1 text-sm text-slate-400",children:[(0,i.jsx)(v.e,{icon:"CalendarIcon",className:"w-4 h-4 text-boni-gold"}),new Date(null===x||void 0===x?void 0:x.created_at).toLocaleDateString()]})]})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsx)("div",{className:"text-sm text-slate-400",children:null===x||void 0===x?void 0:x.text}),!1===(null===(p=x)||void 0===p?void 0:p.anonymous)&&(0,i.jsxs)("div",{className:"flex items-center gap-4",children:[(0,i.jsxs)("button",{disabled:E||D,onClick:function(){A(!0),I(!0)},className:"flex items-center gap-2 text-sm text-boni-blue hover:text-boni-blue/80 disabled:text-slate-400 disabled:cursor-not-allowed",children:[E?(0,i.jsx)(d.Z,{className:"w-4 h-4"}):null,(0,i.jsx)("span",{children:g("surveys.show_details")})]}),(0,i.jsxs)("button",{disabled:E||D,onClick:S(s().mark((function e(){var n,t,r,i,o,a,l,u,c,d;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q(!0),e.next=5,k.ZP.query({query:(0,w.Ps)(C()),variables:{id:x.id},fetchPolicy:"network-only"});case 5:if(t=e.sent.data,r=null===t||void 0===t||null===(n=t.surveys)||void 0===n?void 0:n[0]){e.next=9;break}return e.abrupt("return");case 9:i=[],o=[],r.options.forEach((function(e){var n,t,r;o.push({Auswahl:e.title,Anzahl:(null===(n=e.answers_aggregate)||void 0===n||null===(t=n.aggregate)||void 0===t?void 0:t.count)||0}),null===(r=e.answers)||void 0===r||r.forEach((function(n){var t,r;i.push({Auswahl:e.title,Vorname:(null===(t=n.user)||void 0===t?void 0:t.first_name)||"",Nachname:(null===(r=n.user)||void 0===r?void 0:r.last_name)||""})}))})),a=b.P6.book_new(),l=b.P6.json_to_sheet(i),b.P6.book_append_sheet(a,l,"Details"),u=b.P6.json_to_sheet(o),b.P6.book_append_sheet(a,u,"Zusammenfassung"),c=b.cW(a,{bookType:"xlsx",type:"array"}),d=new Blob([c],{type:"application/octet-stream"}),(0,y.saveAs)(d,"".concat((x.title||"survey").replace(/[^\.\w\d_-]/g,"_"),".xlsx")),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(0),console.error("Export error:",e.t0);case 25:return e.prev=25,q(!1),e.finish(25);case 28:case"end":return e.stop()}}),e,null,[[0,22,25,28]])}))),className:"flex items-center gap-2 text-sm text-boni-blue hover:text-boni-blue/80 disabled:text-slate-400 disabled:cursor-not-allowed",children:[D?(0,i.jsx)(d.Z,{className:"w-4 h-4"}):(0,i.jsx)(v.e,{icon:"ArrowDownTrayIcon",className:"w-4 h-4"}),(0,i.jsx)("span",{children:g("surveys.download_results")})]})]})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(null===x||void 0===x?void 0:x.options)&&!!(null===x||void 0===x?void 0:x.options.length)&&(0,i.jsx)("ul",{className:"text-sm text-slate-500 list-decimal flex flex-col gap-1 min-w-half min-w-[40%] max-w-[70%]",children:null===x||void 0===x?void 0:x.options.map((function(e){var n,t;return(0,i.jsxs)("li",{className:"flex justify-between gap-4 p-1 rounded",style:{background:"linear-gradient(90deg, #0001 ".concat(function(){var n=function(e){var n,t;return(null===(n=e.answers_aggregate)||void 0===n||null===(t=n.aggregate)||void 0===t?void 0:t.count)||0},t=null===x||void 0===x?void 0:x.options.reduce((function(e,t){return e+(n(t)||0)}),0);return 100*n(e)/t}(),"%, transparent 0.1%)")},children:[(0,i.jsx)("span",{className:"font-semibold text-slate-600",children:e.title}),(0,i.jsx)("span",{className:"font-semibold text-boni-blue",children:(null===(n=e.answers_aggregate)||void 0===n||null===(t=n.aggregate)||void 0===t?void 0:t.count)||0})]},null===e||void 0===e?void 0:e.id)}
1))})||(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(v.e,{className:"w-6 h-6 text-boni-red",icon:"ExclamationCircleIcon"}),(0,i.jsx)("p",{className:"text-sm text-center text-slate-500",children:g("surveys.no_survey_options_found")})]}),(0,i.jsx)("div",{children:(0,h.C)(_,"survey_update")&&(0,i.jsxs)(f.Z,{disabled:!L,color:"secondary",className:"flex items-center gap-2 disabled:bg-slate-200 disabled:text-slate-300",onClick:function(){j.push("surveys/edit/".concat(null===x||void 0===x?void 0:x.id))},children:[(0,i.jsx)(v.e,{icon:"PencilIcon",className:"w-3 h-3",outline:!0}),(0,i.jsx)("span",{children:g("surveys.edit_button_caption")})]})})]}),(0,i.jsx)(N,{open:O,onClose:function(){I(!1),A(!1)},surveyId:x.id})]})},I=t(41883);function $(e,n,t,r,s,i,o){try{var a=e[i](o),l=a.value}catch(u){return void t(u)}a.done?n(l):Promise.resolve(l).then(r,s)}var E=!0;function A(){var e,n,t,r,x,g,b,y,w,j,_=(0,l.$G)(["surveys"]).t,N=(0,a.useSession)().data,k=(0,m.useRouter)(),P=(0,u.useState)(20),S=P[0],C=P[1],E=(0,u.useState)(0),A=E[0],T=E[1],D=(0,u.useState)(!1),q=D[0],L=D[1],Z=("moderator"==(null===(e=N.user)||void 0===e?void 0:e.roleObj.name)||"group_leader"==(null===(n=N.user)||void 0===n?void 0:n.roleObj.name))&&0==(null===(t=N.user)||void 0===t||null===(r=t.groups)||void 0===r?void 0:r.length),R={_and:[]};if("admin"!==(null===(x=N.user)||void 0===x||null===(g=x.roleObj)||void 0===g?void 0:g.name)){var M,B,U=(null===(M=N.user)||void 0===M||null===(B=M.groups)||void 0===B?void 0:B.map((function(e){return e.id})))||[];R._and.push({_or:[{group_id:{_in:U}},{_and:[{is_standard:{_eq:!0}},{group_id:{_is_null:!0}}]},{survey_visibilities:{group_id:{_in:U},visible:{_eq:!0}}}]})}var z=(0,o.a)(c.ZC,{variables:{condition:R,offset:A*S,limit:S},fetchPolicy:"network-only"}),G=z.data,H=z.loading,W=function(){var e,n=(e=s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L(!0),k.push("/surveys/edit/null");case 2:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,s){var i=e.apply(n,t);function o(e){$(i,r,s,o,a,"next",e)}function a(e){$(i,r,s,o,a,"throw",e)}o(void 0)}))});return function(){return n.apply(this,arguments)}}();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex justify-between items-end px-4 mt-4 mr-4 mb-4",children:[(0,i.jsx)("h1",{className:"text-xl font-semibold text-slate-900",children:_("surveys.title")}),(0,i.jsxs)("div",{children:[(0,h.C)(N,"survey_create")&&(Z?(0,i.jsxs)("a",{className:"my-anchor-element inline-flex justify-center items-center py-2 px-4 text-sm font-medium rounded-md border border-transparent shadow-sm sm:w-auto focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-none bg-gray-200 text-gray-400 cursor-not-allowed",children:[(0,i.jsx)(v.e,{icon:"PlusCircleIcon",className:"w-6 h-6 text-white"}),_("surveys.create_button_caption")]}):(0,i.jsxs)(f.Z,{color:"primary",className:"flex gap-2 items-center w-auto",disabled:H||q,onClick:function(){W()},children:[q?(0,i.jsx)(d.Z,{className:"w-5 h-5"}):(0,i.jsx)(v.e,{icon:"PlusCircleIcon",className:"w-6 h-6 text-white"}),(0,i.jsx)("span",{children:q?"Wird erstellt...":_("surveys.create_button_caption")})]})),(0,i.jsx)(I.u,{anchorSelect:".my-anchor-element",place:"bottom",children:_("surveys.no_group_tooltip")})]})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-4 p-4 mr-4 bg-gray-100 rounded",children:[H&&(0,i.jsx)(d.Z,{className:"self-center w-20 h-20 text-boni-blue"}),null===G||void 0===G||null===(b=G.surveys)||void 0===b?void 0:b.map((function(e){return(0,i.jsx)(O,{survey:e},"survey-".concat(e.id))})),!H&&(!(null===G||void 0===G?void 0:G.surveys)||!(null===G||void 0===G||null===(y=G.surveys)||void 0===y?void 0:y.length))&&(0,i.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center p-10",children:[(0,i.jsx)(v.e,{className:"w-20 h-20 text-slate-500",icon:"ExclamationCircleIcon",outline:!0}),(0,i.jsx)("p",{className:"text-sm text-slate-500 text-center max-w-[50%]",children:_("surveys.no_surveys_found")})]})]}),(0,i.jsx)("div",{className:"m-4",children:(0,i.jsx)(p.t,{itemsCount:(null===G||void 0===G||null===(w=G.surveys_aggregate)||void 0===w||null===(j=w.aggregate)||void 0===j?void 0:j.count)||0,itemsPerPage:S,pageIndex:A,onClickPage:T,onItemsPerPageChange:C})})]})}},13560:function(e,n){"use strict";function t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(e,n){var t;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];clearTimeout(t),t=setTimeout((function(){e.apply(void 0,r(i))}),null!==n&&void 0!==n?n:200)}}},20067:function(){},72061:function(){}},function(e){e.O(0,[2251,3054,7887,1883,1070,9774,2888,179],(function(){return n=83590,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.