You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
8.5 KiB
JavaScript
2 lines
8.5 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3338],{45816:function(n,e,t){var i=t(85893),r=t(41664),o=t.n(r),l=t(11163);e.Z=function(n){var e=n.children,t=n.isActive,r=void 0!==t&&t,s=n.href,a=n.activeClassName,c=void 0===a?null:a,u=n.style,d=void 0===u?null:u,f=(0,l.useRouter)(),g=c||"active",p="function"===typeof r?r(s,f):f.asPath===s;return(0,i.jsx)(o(),{href:s,children:(0,i.jsx)("a",{className:p?g:"",style:d,children:e})})}},83338:function(n,e,t){t.d(e,{l:function(){return _},Z:function(){return z}});var i=t(26042),r=t(69396),o=t(7297),l=t(85893),s=t(67294),a=t(45697),c=t.n(a),u=t(87379),d=t(41664),f=t.n(d),g=t(1247),p=t(45816),h=t(61257),v=t(8293),m=t(36434),x=t(61590),b=t(94586);function j(){var n=(0,o.Z)(["\n position: relative;\n top: 8px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n height: 2rem;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0 0 0 15px;\n z-index: 9999;\n\n &:focus {\n outline: none;\n }\n\n div {\n width: 1rem;\n height: 0.25rem;\n background: ",";\n border-radius: 10px;\n transition: all 0.3s linear;\n position: relative;\n transform-origin: 1px;\n\n :first-child {\n transform: ",";\n }\n\n :nth-child(2) {\n transform: ",";\n }\n }\n"]);return j=function(){return n},n}function y(){var n=(0,o.Z)(["\n position: relative;\n left: ",";\n padding: 0.5rem 0.5rem 0.5rem 2rem;\n margin-left: -2rem;\n width: 6rem;\n background: white;\n border-radius: 0 0.5rem 0.5rem 0;\n border: 1px solid #e0e0e0;\n border-left: none;\n display: flex;\n align-items: center;\n flex-direction: column;\n transition: 0.3s ease-in-out;\n z-index: 100;\n"]);return y=function(){return n},n}var w=u.default.button.withConfig({componentId:"sc-a58f9a59-0"})(j(),(0,b.E)("main"),(function(n){return n.open?"rotate(-45deg)":"translateY(-15px) rotate(45deg)"}),(function(n){return n.open?"translateY(-5px) rotate(45deg)":"rotate(-45deg)"})),S=u.default.div.withConfig({componentId:"sc-a58f9a59-1"})(y(),(function(n){return n.open?"265px":"0px"})),k=function(n){var e=n.setOpen,t=n.open,i=n.style;return(0,l.jsxs)(S,{open:t,onClick:function(){return e(!t)},children:[(0,l.jsxs)(w,{open:t,style:i,children:[(0,l.jsx)("div",{}),(0,l.jsx)("div",{})]}),"Menu"]})};k.propTypes={open:c().bool.isRequired,setOpen:c().func.isRequired};var Z=k,R=t(41347),C=t(33548);function T(n){var e=n.title,t=n.slug,i=n.language,r=n.expandable,o=n.catSlug,a=n.itemSlug,c=n.isPreview,u=(0,s.useState)(!1),d=u[0],g=u[1],p=(0,s.useState)([]),h=p[0],x=p[1],b=(0,s.useState)([]),j=b[0],y=b[1],w=(0,s.useState)(!1),S=w[0],k=w[1];return(0,s.useEffect)((function(){k(!1)}),[o,a]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.HC,{padding:.5,children:r?(0,l.jsx)("a",{href:"#",onClick:function(n){if(n.preventDefault(),r)if(0===h.length&&0===j.length){g(!0),k(!0);var e={lng:i,page:1,per_page:9999,category:t,admin:c};(0,C.Z)("v1/helps",{params:e}).then((function(n){x(n.data||[]),(0,C.Z)("v1/guides",{params:e}).then((function(n){g(!1),y(n.data||[])}))}))}else k(!S)},style:{display:"block"},children:(0,l.jsx)("strong",{children:e})}):(0,l.jsx)("strong",{style:{color:"black"},children:e})}),r&&S&&(0,l.jsxs)(l.Fragment,{children:[d&&(0,l.jsx)(R.Z,{size:30}),j.length>0&&j.map((function(n){return(0,l.jsx)(v.HC,{depth:1,padding:.5,children:(0,l.jsx)(f(),{href:(0,m.Y4)({language:i,item:n}),children:(0,l.jsx)("a",{style:{display:"block"},children:n.title})})},n.id)})),h.length>0&&h.map((function(n){return(0,l.jsx)(v.HC,{depth:1,padding:.5,children:(0,l.jsx)(f(),{href:(0,m.Y4)({language:i,item:n}),children:(0,l.jsx)("a",{style:{display:"block"},children:n.title})})},n.id)}))]})]})}T.propTypes={title:c().string.isRequired,slug:c().string.isRequired,language:c().string.isRequired,expandable:c().bool,isPreview:c().bool,catSlug:c().string,itemSlug:c().string};var H=T;function O(){var n=(0,o.Z)(["\n z-index: 40;\n padding-right: 5px;\n\n @media print {\n display: none;\n }\n"]);return O=function(){return n},n}var E=(0,u.default)(g.Z).withConfig({componentId:"sc-4f0b5a76-0"})(O());function q(n){var e=n.siblings,t=n.itemSlug,i=n.items,r=n.labelRender;return e?("object"===typeof e?Object.values(e):e).map((function(n){return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(v.HC,{depth:1,padding:.5,children:(null===n||void 0===n?void 0:n.slug)!==t?(0,l.jsx)(f(),{href:(0,m.Y4)({item:n}),children:(0,l.jsx)("a",{style:{display:"block"},children:(0,m.Hl)(n.title,"no-html")})}):(0,l.jsx)("span",{style:{color:"black",fontWeight:"bold"},children:(0,m.Hl)(n.title,"no-html")})}),(null===n||void 0===n?void 0:n.slug)===t&&(null===i||void 0===i?void 0:i.map((function(n,e){return(0,l.jsx)(v.HC,{depth:2,padding:.5,children:(0,l.jsx)(p.Z,{href:"#".concat((null===n||void 0===n?void 0:n.id)||(null===n||void 0===n?void 0:n.slug)),isActive:function(){return window.location.hash==="#".concat((null===n||void 0===n?void 0:n.id)||(null===n||void 0===n?void 0:n.slug))},style:{display:"block"},children:r(n,e)})},null===n||void 0===n?void 0:n.slug)})))]},null===n||void 0===n?void 0:n.id)})):null}function F(n){var e=n.items,t=n.width,o=void 0===t?250:t,a=n.labelRender,c=void 0===a?function(n){return(0,m.Hl)(n.label,"no-html")}:a,u=n.categories,d=n.siblings,f=n.catSlug,g=n.itemSlug,p=n.language,b=(n.loading,(0,s.useState)(!1)),j=b[0],y=b[1],w=(0,s.useRef)();(0,x.O3)(w,(function(){j&&y(!1)}));var S=(0,s.useState)(!1),k=S[0],R=S[1];return s.useEffect((function(){w.current&&(w.current.clientHeight+60>window.innerHeight?R(!0):R(!1))}),[w.current,d]),e?(0,l.jsxs)(E,{offsetTop:60,offsetBottom:-80,children:[(0,l.jsx)(h.Z,{style:{width:"60px"},children:(0,l.jsx)(Z,{setOpen:y,open:j})}),(0,l.jsx)(v.xT,{style:{top:"60px",width:"".concat(o,"px")},open:j,ref:w,isLong:k,children:(0,l.jsx)(v.aV,{children:u&&u.length>0?u.map((function(n){return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(H,(0,r.Z)((0,i.Z)({},n),{catSlug:f,itemSlug:g,language:p,expandable:(null===n||void 0===n?void 0:n.slug)!==f})),(null===n||void 0===n?void 0:n.slug)===f&&(0,l.jsx)(q,(0,r.Z)((0,i.Z)({},n),{siblings:d,itemSlug:g,items:e,labelRender:c}))]},null===n||void 0===n?void 0:n.id)})):(0,l.jsx)(q,{siblings:d,itemSlug:g,items:e,labelRender:c})})})]}):null}function _(n){var e=n.items,t=n.baseUrl,i=n.width,r=void 0===i?250:i,o=(n.offset,n.labelRender),s=void 0===o?function(n){return n.label}:o,a=n.urlFunction,c=void 0===a?function(n){return"".concat(t,"#").concat(null===n||void 0===n?void 0:n.slug)}:a;return e?(0,l.jsx)(g.Z,{offsetTop:60,offsetBottom:-80,children:(0,l.jsx)(v.xT,{style:{top:"60px",width:"".concat(r,"px")},children:(0,l.jsx)(v.aV,{children:e.map((function(n,e){return(0,l.jsx)(v.HC,{depth:2,children:(0,l.jsx)(p.Z,{href:c(n),activeClassName:"selected",children:s(n,e)})},null===n||void 0===n?void 0:n.slug)}))})})}):null}F.propTypes={labelRender:c().func,items:c().arrayOf(c().shape({slug:c().string,label:c().string})),offset:c().number,width:c().number,categories:c().array.isRequired,itemType:c().string,baseUrl:c().string,catSlug:c().string,itemSlug:c().string,language:c().string.isRequired},_.propTypes={baseUrl:c().string,labelRender:c().func,urlFunction:c().func,items:c().arrayOf(c().shape({slug:c().string,label:c().oneOfType([c().string,c().object])})),width:c().number,offset:c().number,isPreview:c().bool};var z=F},33548:function(n,e,t){t.d(e,{Z:function(){return o}});var i=t(64487);function r(n){return n.status>=200&&n.status<302?204===n.status?"":n.json().catch((function(n){i.Tb(n)})):n.json().catch((function(e){throw i.Tb(e),new Error("".concat(n.status," ").concat(n.statusText))})).then((function(n){var e=new Error(n.message);throw e.response=n,e}))}function o(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.params,i=e.headers,o=void 0===i?{}:i,l=e.method,s=void 0===l?"get":l,a=e.body,c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=new URLSearchParams;t&&Object.keys(t).forEach((function(n){n&&t[n]&&"object"===typeof t[n]?Object.keys(t[n]).forEach((function(e){u.append("".concat(n,"[").concat(e,"]"),t[n][e])})):n&&t[n]&&u.append(n,t[n])}));var d=u.toString();d.length>0&&(d="?".concat(d));var f="";f=n.includes("http")||n.includes("/next/")?"".concat(n).concat(d):"/api/".concat(n).concat(d);var g={Accept:"application/json","Content-Type":"application/json"};if(!c){var p=sessionStorage.getItem("jwt_token");p&&(g["JWT-Authorization"]="Bearer ".concat(p))}var h={redirect:"follow",referrer:"no-referrer",cache:"no-cache",method:s,headers:Object.assign(g,o)};return c||(h.credentials="include"),"get"!==s&&"head"!==s&&(h.body=a),fetch(f,h).then(r)}}}]);
|
|
//# sourceMappingURL=3338-ce9246526f13568e.js.map
|