1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7352],{39598:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/memberships",function(){return t(26908)}])},74708:function(e,n,t){"use strict";t.d(n,{y:function(){return a}});var r=t(85893),i=t(67294),o=t(11163),l=t(59622),a=function(e){var n=e.children,t=e.mode,a=(0,o.useRouter)(),u=(0,i.useState)(!1),s=u[0],c=u[1],d=(0,i.useState)(!1),f=d[0],p=d[1],h="USER";return(0,i.useEffect)((function(){a.isReady&&(h===t||t.includes(h)?(c(!0),p(!0)):(c(!0),p(!1)))}),[a.isReady]),s?f?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(l.default,{}):null}},11705:function(e,n,t){"use strict";t.d(n,{w:function(){return d}});var r=t(85893),i=t(81687),o=t(17271),l=t(85598),a=t(4810),u=t(855),s=t(36526),c=t(47773),d=function(e){var n=e.disabled,t=e.label,d=e.value,f=e.options,p=e.setValue;return(0,r.jsx)(c.O,{children:(0,r.jsxs)(i.Z,{fullWidth:!0,children:[(0,r.jsx)(o.Z,{id:"".concat(t,"-label"),children:t}),(0,r.jsx)(l.Z,{multiple:!0,disabled:n,labelId:"".concat(t,"-label"),value:d,label:t,onChange:function(e){var n=e.target.value;p("string"===typeof n?n.split(","):n)},renderValue:function(e){var n,t=e.map((function(e){var t;return null!==(n=null===(t=f.find((function(n){return n.value===e})))||void 0===t?void 0:t.label)&&void 0!==n?n:""}));return t.length===f.length?"All":0===t.length?"None":t.join(", ")},children:f.map((function(e){return(0,r.jsxs)(a.Z,{value:e.value,children:[(0,r.jsx)(u.Z,{checked:d.includes(e.value)}),(0,r.jsx)(s.Z,{primary:e.label})]},e.value)}))})]})})}},94453:function(e,n,t){"use strict";t.d(n,{v:function(){return i}});var r=t(85893),i=(0,t(15295).Z)((0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"})}),"Plus")},59622:function(e,n,t){"use strict";t.r(n);var r=t(85893),i=t(67294),o=t(41664),l=t.n(o),a=t(45955),u=t(66624),s=t(68592),c=t(77046),d=t(67398),f=t(13255),p=t(59084);n.default=function(){var e=(0,f.Z)(),n=(0,a.Z)(e.breakpoints.down("sm"));return(0,i.useEffect)((function(){p.w.push({event:"page_view"})}),[]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{component:"main",sx:{alignItems:"center",backgroundColor:"background.paper",display:"flex",flexGrow:1,py:"80px"},children:(0,r.jsxs)(s.Z,{maxWidth:"lg",children:[(0,r.jsx)(c.Z,{align:"center",variant:n?"h4":"h1",children:"404: The page you are looking for isn\u2019t here"}),(0,r.jsx)(c.Z,{align:"center",color:"textSecondary",sx:{mt:.5},variant:"subtitle2",children:"You either tried some shady route or you came here by mistake. Whichever it is, try using the navigation."}),(0,r.jsx)(u.Z,{sx:{display:"flex",justifyContent:"center",mt:6},children:(0,r.jsx)(u.Z,{alt:"Under development",component:"img",src:"/static/error/error404_".concat(e.palette.mode,".svg"),sx:{height:"auto",maxWidth:"100%",width:400}})}),(0,r.jsx)(u.Z,{sx:{display:"flex",justifyContent:"center",mt:6},children:(0,r.jsx)(l(),{href:"/",passHref:!0,children:(0,r.jsx)(d.Z,{component:"a",variant:"outlined",children:"Back to Dashboard"})})})]})})})}},26908:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return H}});var r=t(34727),i=t(46587),o=t(85893),l=t(13307),a=t(14251),u=t(52875),s=t(44747),c=t(67294),d=t(41664),f=t.n(d),p=t(45697),h=t.n(p),v=t(68650),m=t(75298),x=t(66624),j=t(67398),g=t(54937),Z=t(78047),b=t(32104),y=t(29350),w=t(35526),C=t(91076),S=t(90021),M=t(47773),_=t(56807),P=t(11705),T=t(32707),E=t(42660),N=t(77160),k={label:"One of",value:"one-of",getApplyFilterFn:function(e){return e.field&&e.value&&e.operator?function(n){var t;return!!(null===(t=null===n||void 0===n?void 0:n.split(", "))||void 0===t?void 0:t.some((function(n){return e.value.includes(n)})))}:null}},F=function(e){var n,t=e.products,r=e.loading,i=(0,s.Z)(e,["products","loading"]),l=(0,c.useState)([]),d=l[0],p=l[1],h=(0,c.useState)(""),F=h[0],R=h[1],z=(0,c.useState)(["individual","group"]),A=z[0],O=z[1],I=(0,c.useState)(["recurring","nonrecurring"]),H=I[0],V=I[1],U=(0,c.useReducer)((function(e,n){var t=n.type,r=n.value,i=n.id;switch(t){case"set":return r;case"set-value":return{items:e.items.map((function(e){return e.id===i&&(e.value=r),e})),logicOperator:w.G.And};default:return e}}),{items:[{id:"nameFilter",field:"eventName",value:"",operator:"contains"},{id:"classificationFilter",field:"classification",value:[],operator:"one-of"},{id:"typeFilter",field:"userAmount",value:[],operator:"one-of"}],logicOperator:w.G.And}),W=U[0],L=U[1],$=(0,c.useState)(!1),G=$[0],B=$[1],D=(0,c.useState)({type:"include",ids:new Set}),Q=D[0],q=D[1],K=(0,C.A)();(0,c.useEffect)((function(){t&&(console.log("products",t),p(t.map((function(e){var n,t;return{id:e.id,name:e.name,classification:e.membershipClassification,pageTitle:(null===(n=e.page)||void 0===n?void 0:n.name)||"-",pageSlug:(null===(t=e.page)||void 0===t?void 0:t.slug)||"-",type:e.recurrence.recurring?"recurring":"nonrecurring"}}))))}),[t]),(0,c.useEffect)((function(){L({type:"set-value",id:"nameFilter",value:F})}),[F]),(0,c.useEffect)((function(){L({type:"set-value",id:"classificationFilter",value:A})}),[A]),(0,c.useEffect)((function(){L({type:"set-value",id:"typeFilter",value:H})}),[H]);var X=[{field:"id"},{field:"name",headerName:"Membership Name",flex:2},{field:"classification",headerName:"Classification",flex:1,valueFormatter:function(e){var n,t;return null!==(t=null===(n=E.d8.find((function(n){return n.value===e})))||void 0===n?void 0:n.label)&&void 0!==t?t:""},filterOperators:[k]},{field:"pageTitle",headerName:"Product Page",flex:1,renderCell:function(e){var n=e.row,t=e.value;return(0,o.jsx)(f(),{href:n.pageSlug.toString(),passHref:!0,children:(0,o.jsx)(v.Z,{component:"a",children:t})})}},{field:"type",headerName:"Type",flex:1,renderCell:function(e){var n,t,r,i=e.value,l=E.Oe.find((function(e){return e.value.toLowerCase()===i.toLowerCase()}));return(0,o.jsx)(m.Z,{color:null!==(t=null===l||void 0===l?void 0:l.color)&&void 0!==t?t:"primary",label:null!==(r=null===l||void 0===l||null===(n=l.label)||void 0===n?void 0:n.toUpperCase())&&void 0!==r?r:""})},filterOperators:[k]},{field:"actions",headerName:"Action",flex:1,renderCell:function(e){var n=e.row;return(0,o.jsxs)(x.Z,{children:[(0,o.jsx)(f(),{href:"/products/memberships/".concat(n.id,"?tab=edit"),passHref:!0,children:(0,o.jsx)(j.Z,{component:"a",children:"Edit"})}),"|",(0,o.jsx)(f(),{href:"/products/memberships/".concat(n.id),passHref:!0,children:(0,o.jsx)(j.Z,{component:"a",children:"View"})})]})}}];return(0,o.jsx)(M.O,{children:(0,o.jsxs)(g.Z,(0,u.Z)((0,a.Z)({sx:(0,a.Z)({},G?{mr:400,width:"calc(100% - 400px)"}:{width:"100%"})},i),{children:[(0,o.jsx)(N.n,{open:G,onClose:function(){B((function(e){return!e}))},ids:Q,type:"Membership"}),(0,o.jsxs)(Z.Z,{container:!0,spacing:3,sx:{p:2},children:[(0,o.jsx)(Z.Z,{size:{xs:12,md:6},children:(0,o.jsx)(b.Z,{fullWidth:!0,value:F,onChange:function(e){R(e.target.value)},placeholder:"Search membership name",slotProps:{input:{startAdornment:(0,o.jsx)(y.Z,{position:"start",children:(0,o.jsx)(T.o,{fontSize:"small"})})}}})}),(0,o.jsx)(Z.Z,{size:{xs:12,md:3},children:(0,o.jsx)(P.w,{label:"Classification",options:E.d8,value:A,setValue:O})}),(0,o.jsx)(Z.Z,{size:{xs:12,md:3},children:(0,o.jsx)(P.w,{label:"Type",options:E.Oe,value:H,setValue:V})})]}),(0,o.jsx)(_.L,{children:(0,o.jsxs)(x.Z,{children:[(null===Q||void 0===Q||null===(n=Q.ids)||void 0===n?void 0:n.size)>0&&(0,o.jsx)(j.Z,{onClick:function(){B(!0)},children:"BULK EDIT"}),(0,o.jsx)(S.K,{hideFooter:!0,apiRef:K,columns:X,columnVisibilityModel:{id:!1},filterModel:W,onFilterModelChange:function(e){return L({type:"set",value:e})},initialState:{sorting:{sortModel:[{field:"name",sort:"asc"}]}},rowHeight:80,rows:null!==d&&void 0!==d?d:[],loading:r,checkboxSelection:!0,rowSelectionModel:Q,onRowSelectionModelChange:function(e){q(e)}})]})})]}))})};F.propTypes={products:h().array};var R=t(73834),z=t(84498),A=t(74708),O=function(){var e=(0,r.Z)((function(){var e;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,l.s6)({source:"products",search:[{fields:["companyId"],value:"379a1e74-33cc-4c6d-8de0-8b22b852ee0e"},{fields:["type"],value:"membership"}],filter:{"companyId.keyword":"379a1e74-33cc-4c6d-8de0-8b22b852ee0e","type.keyword":"membership"}})];case 1:return[2,(null!==(e=n.sent())&&void 0!==e?e:[]).toSorted((function(e,n){var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.localeCompare(null===n||void 0===n?void 0:n.name)}))]}}))}));return function(){return e.apply(this,arguments)}}(),I=function(){return(0,o.jsx)(R._,{title:"Membership Product List",buttonText:"Add Membership Product",slug:"/products/memberships",query:O,filterFunction:function(e){return"membership"===e.type},Table:F})};I.getLayout=function(e){return(0,o.jsx)(A.y,{mode:"ADMIN",children:(0,o.jsx)(z.c,{children:e})})};var H=I},73834:function(e,n,t){"use strict";t.d(n,{_:function(){return m}});var r=t(34727),i=t(46587),o=t(85893),l=t(67294),a=t(41664),u=t.n(a),s=t(66624),c=t(68592),d=t(78047),f=t(77046),p=t(67398),h=t(94453),v=t(59084),m=function(e){var n=e.title,t=e.buttonText,a=e.Table,m=e.query,x=e.filterFunction,j=e.slug,g=(0,l.useState)([]),Z=g[0],b=g[1],y=(0,l.useState)(!1),w=y[0],C=y[1];return(0,l.useEffect)((function(){v.w.push({event:"page_view"})}),[]),(0,l.useEffect)((function(){(0,r.Z)((function(){var e;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return C(!0),[4,m()];case 1:return e=n.sent(),b(x?e.filter(x):e),C(!1),[2]}}))}))()}),[x,m]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(s.Z,{component:"main",sx:{flexGrow:1,py:6},children:(0,o.jsxs)(c.Z,{maxWidth:"xl",children:[(0,o.jsxs)(d.Z,{container:!0,justifyContent:"space-between",alignItems:"center",wrap:"nowrap",spacing:3,children:[(0,o.jsx)(d.Z,{children:(0,o.jsx)(f.Z,{color:"textPrimary",variant:"h2",children:n})}),(0,o.jsx)(d.Z,{children:(0,o.jsx)(u(),{passHref:!0,href:"".concat(j,"/new"),children:(0,o.jsx)(p.Z,{component:"a",variant:"contained",startIcon:(0,o.jsx)(h.v,{fontSize:"small"}),children:t})})})]}),(0,o.jsx)(s.Z,{sx:{mt:4},children:(0,o.jsx)(a,{products:Z,loading:w})})]})})})}},91076:function(e,n,t){"use strict";t.d(n,{A:function(){return i}});var r=t(67294),i=function(){return r.useRef(null)}},18099:function(e,n,t){"use strict";var r=t(15295),i=t(85893);n.Z=(0,r.Z)((0,i.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline")},20502:function(e,n,t){"use strict";var r=t(15295),i=t(85893);n.Z=(0,r.Z)([(0,i.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22z"},"0"),(0,i.jsx)("path",{d:"M13 16h-2v2h2zm0-6h-2v5h2z"},"1")],"WarningAmber")},74232:function(e,n,t){"use strict";t.d(n,{ZP:function(){return l},_i:function(){return a},pQ:function(){return s},uU:function(){return u}});var r=t(67294),i=t(85893);const o=r.createContext(null);function l(e){const{children:n,value:t}=e,l=function(){const[e,n]=r.useState(null);return r.useEffect((()=>{n(`mui-p-${Math.round(1e5*Math.random())}`)}),[]),e}(),a=r.useMemo((()=>({idPrefix:l,value:t})),[l,t]);return(0,i.jsx)(o.Provider,{value:a,children:n})}function a(){return r.useContext(o)}function u(e,n){const{idPrefix:t}=e;return null===t?null:`${e.idPrefix}-P-${n}`}function s(e,n){const{idPrefix:t}=e;return null===t?null:`${e.idPrefix}-T-${n}`}},49271:function(e,n,t){"use strict";var r=t(67294),i=t(13792),o=t(74232),l=t(85893);const a=r.forwardRef((function(e,n){const{children:t,...a}=e,u=(0,o._i)();if(null===u)throw new TypeError("No TabContext provided");const s=r.Children.map(t,(e=>r.isValidElement(e)?r.cloneElement(e,{"aria-controls":(0,o.uU)(u,e.props.value),id:(0,o.pQ)(u,e.props.value)}):null));return(0,l.jsx)(i.Z,{...a,ref:n,value:u.value,children:s})}));n.Z=a},16225:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var r=t(67294),i=t(90512),o=t(66917),l=t(80359),a=t(49348),u=t(1801);function s(e){return(0,u.ZP)("MuiTabPanel",e)}(0,t(57480).Z)("MuiTabPanel",["root","hidden"]);var c=t(74232),d=t(85893);const f=(0,o.ZP)("div",{name:"MuiTabPanel",slot:"Root",overridesResolver:(e,n)=>n.root})((({theme:e})=>({padding:e.spacing(3)})));var p=r.forwardRef((function(e,n){const t=(0,l.Z)({props:e,name:"MuiTabPanel"}),{children:r,className:o,value:u,keepMounted:p=!1,...h}=t,v={...t},m=(e=>{const{classes:n,hidden:t}=e,r={root:["root",t&&"hidden"]};return(0,a.Z)(r,s,n)})(v),x=(0,c._i)();if(null===x)throw new TypeError("No TabContext provided");const j=(0,c.uU)(x,u),g=(0,c.pQ)(x,u);return(0,d.jsx)(f,{"aria-labelledby":g,className:(0,i.Z)(m.root,o),hidden:u!==x.value,id:j,ref:n,role:"tabpanel",ownerState:v,...h,children:(p||u===x.value)&&r})}))},80359:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(6870),i=t(96292),o=t(9049);function l({props:e,name:n}){return(0,r.Z)({props:e,name:n,defaultTheme:i.Z,themeId:o.Z})}}},function(e){e.O(0,[1664,8449,4450,9134,8904,6731,8047,854,5866,1362,1710,21,4498,7673,9774,2888,179],(function(){return n=39598,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.