PageSourceSearch

https://baskadia.com/_next/static/chunks/1425-7834f41c51e63a47.js

js baskadia.com collected 2026-09-24 09:04:00 UTC 46,915 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1425],{40570:function(e,n,t){var r=t(26042),a=t(69396),i=t(99534),o=t(85893),s=t(67294),l=t(86002),c=t(4662),d=t(282),u=t(71344),p=s.forwardRef((function(e,n){var t=e.color,p=(0,i.Z)(e,["color"]),h=(0,c.Z)(),f=s.useMemo((function(){switch(t){case"default":case"inherit":case"primary":case"secondary":case void 0:return h;case"warning":return(0,a.Z)((0,r.Z)({},h),{palette:(0,a.Z)((0,r.Z)({},h.palette),{primary:(0,r.Z)({},h.palette.warning)})});case"error":return(0,a.Z)((0,r.Z)({},h),{palette:(0,a.Z)((0,r.Z)({},h.palette),{primary:(0,r.Z)({},h.palette.error)})});default:return(0,l.default)((0,a.Z)((0,r.Z)({},h),{palette:{primary:{main:t}}}))}}),[t,h]);return"default"===t||"inherit"===t||"primary"===t||"secondary"===t||void 0===t?(0,o.jsx)(d.Z,(0,r.Z)({ref:n,color:t},p)):(0,o.jsx)(u.Z,{theme:f,children:(0,o.jsx)(d.Z,(0,r.Z)({ref:n,color:"primary"},p))})}));n.Z=p},62284:function(e,n,t){var r=t(14924),a=t(26042),i=t(85893),o=t(67294),s=t(32427),l=t(43832),c=(0,s.Z)((function(e){return{root:(0,r.Z)({},e.breakpoints.down("xs"),{paddingRight:"8px",paddingLeft:"8px"})}})),d=o.forwardRef((function(e,n){var t=c();return(0,i.jsx)(l.Z,(0,a.Z)({ref:n,classes:t,fixed:!0,maxWidth:"sm"},e))}));n.Z=d},86263:function(e,n,t){var r=t(14924),a=t(26042),i=t(85893),o=t(67294),s=t(32427),l=t(41749),c=(0,s.Z)((function(e){return{root:(0,r.Z)({width:"calc(100% + 16px)",margin:"-8px"},e.breakpoints.down("xs"),{width:"calc(100% + 8px)",margin:"-4px"})}})),d=o.forwardRef((function(e,n){var t=c();return(0,i.jsx)(l.Z,(0,a.Z)({ref:n,classes:t,container:!0,justifyContent:"center"},e))}));n.Z=d},73844:function(e,n,t){var r=t(14924),a=t(26042),i=t(85893),o=t(67294),s=t(32427),l=t(41749),c=(0,s.Z)((function(e){return{root:(0,r.Z)({padding:"8px"},e.breakpoints.down("xs"),{padding:"4px"})}})),d=o.forwardRef((function(e,n){var t=c();return(0,i.jsx)(l.Z,(0,a.Z)({ref:n,classes:t,item:!0,xs:12},e))}));n.Z=d},77327:function(e,n,t){var r=t(828),a=t(85893),i=t(60357),o=t.n(i),s=t(67294),l=t(60253),c=t(95477),d=t(12098),u=t(61164);n.Z=function(e){var n=e.content,t=e.aspectRatio,i=e.style,p=(0,l.$G)().t,h=(0,r.Z)((0,u.o)(),1)[0].isIntersectionObserverEnabled,f=s.useRef(null),g=(0,r.Z)(s.useState(!0),2),b=g[0],x=g[1],v=(0,r.Z)(s.useState("/loading.jpg"),2),y=v[0],m=v[1],Z=(null===n||void 0===n?void 0:n.Title)||p("untitled");return s.useEffect((function(){return x(!0)}),[null===n||void 0===n?void 0:n.Img]),s.useEffect((function(){if(h){var e=f.current;if(e&&b){var t,r=new IntersectionObserver((function(e){e.forEach((function(e){if(e.isIntersecting){var r="/baskadia_gray.png";(null===n||void 0===n?void 0:n.Img)&&(r="".concat("https://api.baskadia.com","/static/").concat(n.SmallImg||n.Img)),(t=new Image).src=r,t.onload=function(){m(r),x(!1)}}}))}),{root:null,rootMargin:"1200px",threshold:0});return r.observe(e),function(){r.unobserve(e),t&&(t.onload=null)}}}}),[null===n||void 0===n?void 0:n.Img,null===n||void 0===n?void 0:n.SmallImg,h,b]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{ref:f,style:i,className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]])+" container",children:[(0,a.jsx)("img",{src:y,alt:Z,className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]])}),t&&(0,a.jsx)("div",{className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]])+" aspect-ratio"}),(0,a.jsx)("div",{className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]])+" placeholder",children:(0,a.jsx)("div",{className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]]),children:b&&(0,a.jsx)(c.Z,{})})}),!b&&"image"===(null===n||void 0===n?void 0:n.Type)&&n.Paid&&(0,a.jsx)("div",{className:"jsx-699c9edf4bc37c39 "+o().dynamic([["287682c163f0aed4",[100/(t||1),b?1:0]]])+" lock",children:(0,a.jsx)(d.Z,{style:{width:"40px",height:"40px"}})})]}),(0,a.jsx)(o(),{id:"287682c163f0aed4",dynamic:[100/(t||1),b?1:0],children:".aspect-ratio.__jsx-style-dynamic-selector{padding-top:".concat(100/(t||1),"%}.placeholder.__jsx-style-dynamic-selector{opacity:").concat(b?1:0,"}")}),(0,a.jsx)(o(),{id:"699c9edf4bc37c39",children:".container.jsx-699c9edf4bc37c39{position:relative;overflow:hidden;background-color:#f5f5f5}img.jsx-699c9edf4bc37c39{position:absolute;top:50%;left:50%;-moz-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);width:auto;height:100%}.placeholder.jsx-699c9edf4bc37c39{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f5f5f5;background-image:url(/loading.jpg);background-repeat:no-repeat;background-position:center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;-webkit-transition:opacity 225ms cubic-bezier(.4,0,.2,1)0ms;-moz-transition:opacity 225ms cubic-bezier(.4,0,.2,1)0ms;-o-transition:opacity 225ms cubic-bezier(.4,0,.2,1)0ms;transition:opacity 225ms cubic-bezier(.4,0,.2,1)0ms}.placeholder.jsx-699c9edf4bc37c39>div.jsx-699c9edf4bc37c39{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;
1-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;height:100%}.lock.jsx-699c9edf4bc37c39{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;top:0;width:100%;height:100%}"})]})}},8998:function(e,n,t){t.d(n,{Z:function(){return ce}});var r=t(47568),a=t(82670),i=t(26042),o=t(69396),s=t(828),l=t(29815),c=t(20414),d=t(85893),u=t(67294),p=t(11163),h=t(60253),f=t(13288),g=t(72091),b=t(18463),x=t(79912),v=t(52663),y=t(66856),m=t(29525),Z=t(66083),j=t(49384),D=t(61164),k=t(92674),E=t(40570),w=t(3479),I=t(93092),C=t(38584),S=t(48799),T=t(85614),P=t(11135),_=t(26315),L=t(49253),A=t(15948),B=t(61557),U=t(51907),W=t(58769),z=t(8936),R=t(5391),N=t(94827),G=function(e){var n=e.content,t=e.disabled,a=e.pages,i=e.onDisable,o=e.onEnable,s=e.onPagesUpdate,p=(0,h.$G)().t,f=(0,g.Ds)().enqueueSnackbar,b=(0,k.Z)(),x=u.useCallback(function(){var e=(0,r.Z)((function(e){var t,r,d;return(0,c.__generator)(this,(function(c){switch(c.label){case 0:i(),c.label=1;case 1:if(c.trys.push([1,3,,4]),!n.ID)throw new Error("content.ID is undefined");return t=JSON.stringify({header:e,unpublished:!!n.Published,temp:!0}),[4,b("/auth/content/".concat(n.ID,"/page"),{method:"POST",body:t})];case 2:if(null===(r=c.sent()))throw new Error("newPage is null");return s((0,l.Z)(a).concat([r])),[3,4];case 3:return d=c.sent(),(0,j.kg)(d),f(p(e?"failed-to-add-header":"failed-to-add-page"),{variant:"error"}),o(),[2];case 4:return o(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[n,f,b,i,o,s,a,p]),v=u.useCallback((function(){return x(!1)}),[x]);return(0,d.jsx)(U.Z,{style:{padding:"8px"},children:(0,d.jsx)(E.Z,{color:"primary",disabled:t,variant:"contained",style:{marginLeft:"auto"},onClick:v,children:p("add-page")})})},M=t(60357),F=t.n(M),$=t(45258),q=t(17812),H=t(28358),O=t(868),J=t(78584),X=t(26317),V=t(66448),K=t(48859),Y=function(e){var n=e.disabled,t=e.index,r=e.pages,a=e.provided,c=e.reverse,p=e.onPagesUpdate,f=(0,h.$G)().t,g=(0,s.Z)(u.useState(!1),2),b=g[0],x=g[1],m=r[t],j=u.useCallback((function(){x(!0)}),[]),D=u.useCallback((function(){x(!1)}),[]),k=u.useCallback((function(){var e,n=c?t+1:t-1;if(!(n<0||n>=r.length||n===t)){var a=(0,l.Z)(r);(e=a).splice.apply(e,[n,0].concat((0,l.Z)(a.splice(t,1)))),p(a)}}),[t,p,r,c]),w=u.useCallback((function(){var e,n=c?t-1:t+1;if(!(n<0||n>=r.length||n===t)){var a=(0,l.Z)(r);(e=a).splice.apply(e,[n,0].concat((0,l.Z)(a.splice(t,1)))),p(a)}}),[t,p,r,c]),I=u.useCallback((function(){var e=(0,l.Z)(r);e.splice(t,1),p(e)}),[t,p,r]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($.Z,{position:"static",style:{backgroundColor:"#424242"},children:(0,d.jsxs)(H.Z,{disableGutters:!0,variant:"dense",children:[(0,d.jsx)("div",(0,o.Z)((0,i.Z)({},a.dragHandleProps),{className:"jsx-16fa05f7ba8ade75 "+F().dynamic([["6f43c1774c2ef789",[n?.38:1,n?"default":"move"]]])+" "+(a.dragHandleProps&&null!=a.dragHandleProps.className&&a.dragHandleProps.className||"drag"),children:(0,d.jsx)(K.Z,{})})),(0,d.jsx)(O.ZP,{title:f("move-up")||"-",children:(0,d.jsx)(q.Z,{color:"inherit",disabled:n,onClick:k,children:(0,d.jsx)(X.Z,{})})}),(0,d.jsx)(O.ZP,{title:f("move-down")||"-",children:(0,d.jsx)(q.Z,{color:"inherit",disabled:n,onClick:w,children:(0,d.jsx)(J.Z,{})})}),(0,d.jsx)(O.ZP,{title:f("delete")||"-",children:(0,d.jsx)(q.Z,{color:"inherit",disabled:n,onClick:j,children:(0,d.jsx)(V.Z,{})})})]})}),(0,d.jsxs)(v.Z,{open:b,fullWidth:!0,maxWidth:"xs",onClose:D,children:[(0,d.jsx)(Z.Z,{children:m.Header?f("delete-this-header?"):f("delete-this-page?")}),(0,d.jsxs)(y.Z,{children:[(0,d.jsx)(E.Z,{disabled:n,onClick:D,children:f("cancel")}),(0,d.jsx)(E.Z,{color:"error",disabled:n,onClick:I,children:f("delete")})]})]}),(0,d.jsx)(F(),{id:"6f43c1774c2ef789",dynamic:[n?.38:1,n?"default":"move"],children:".drag.__jsx-style-dynamic-selector{opacity:".concat(n?.38:1,";cursor:").concat(n?"default":"move","}")}),(0,d.jsx)(F(),{id:"16fa05f7ba8ade75",children:".drag.jsx-16fa05f7ba8ade75{display:inline-block;-webkit-box-flex:1;-webkit-flex-grow:1;-moz-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:3px}"})]})},Q=t(39803),ee=t(22318),ne=t(22284),te=t(38047),re=function(e){var n=e.content,t=e.disabled,r=e.index,a=e.number,c=e.pages,p=e.onPagePublish,f=e.onPagesUpdate,g
1=(0,h.$G)().t,Z=(0,s.Z)(u.useState(!1),2),j=Z[0],D=Z[1],k=c[r],w=k.Title||"",I=u.useCallback((function(){D(!0)}),[]),C=u.useCallback((function(){D(!1)}),[]),S=u.useCallback((function(){p(k)}),[p,k]),T=u.useCallback((function(e){var n=(0,l.Z)(c);n.splice(r,1,(0,o.Z)((0,i.Z)({},c[r]),{Title:e.target.value})),f(n)}),[r,c,f]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(b.Z,{square:!0,variant:"outlined",children:[(0,d.jsx)(x.Z,{style:{paddingBottom:"0px"},children:(0,d.jsxs)(ee.Z,{noWrap:!0,variant:"body2",children:[a,"."," ",(!n.Published||k.Unpublished)&&(0,d.jsxs)(ee.Z,{color:"error",component:"span",children:[g("unpublished")," -"," "]}),(0,d.jsx)(ee.Z,{component:"span",style:{fontWeight:"bold"},children:k.Title||g("untitled")})]})}),(0,d.jsxs)(U.Z,{children:[(0,d.jsx)(E.Z,{color:"primary",disabled:t,size:"small",startIcon:(0,d.jsx)(ne.Z,{}),onClick:I,children:g("edit")}),n.Published&&k.Unpublished&&(0,d.jsx)(E.Z,{color:"primary",disabled:t,size:"small",startIcon:(0,d.jsx)(te.Z,{}),onClick:S,children:g("publish")})]})]}),(0,d.jsxs)(v.Z,{open:j,fullWidth:!0,maxWidth:"xs",onClose:C,children:[(0,d.jsxs)(m.Z,{children:[(0,d.jsx)(Q.Z,{name:"title",value:w,placeholder:g("untitled"),error:w.length>100,autoComplete:"off",disabled:t,fullWidth:!0,multiline:!0,type:"text",variant:"outlined",onChange:T}),(0,d.jsx)(ee.Z,{align:"right",color:w.length>100?"error":"inherit",display:"block",variant:"caption",children:"".concat(w.length," / 100")})]}),(0,d.jsx)(y.Z,{children:(0,d.jsx)(E.Z,{disabled:t,onClick:C,children:g("close")})})]})]})},ae=t(25282),ie=function(e){var n=e.content,t=e.disabled,r=e.index,a=e.number,i=e.pages,o=e.onPageEdit,s=e.onPagePreview,l=e.onPagePublish,c=(0,h.$G)().t,p=i[r],f=u.useCallback((function(){o(p)}),[o,p]),g=u.useCallback((function(){s(p)}),[s,p]),v=u.useCallback((function(){l(p)}),[l,p]);return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(b.Z,{square:!0,variant:"outlined",children:[(0,d.jsx)(x.Z,{style:{paddingBottom:"0px"},children:(0,d.jsxs)(ee.Z,{noWrap:!0,variant:"body2",children:[a,"."," ",(!n.Published||p.Unpublished)&&(0,d.jsxs)(ee.Z,{color:"error",component:"span",children:[c("unpublished")," -"," "]}),(0,d.jsx)(ee.Z,{component:"span",style:{fontWeight:"bold"},children:p.Title||c("untitled")})]})}),(0,d.jsxs)(U.Z,{children:[(0,d.jsx)(E.Z,{color:"primary",disabled:t,size:"small",startIcon:(0,d.jsx)(ne.Z,{}),onClick:f,children:c("edit")}),(!n.Published||p.Unpublished)&&(0,d.jsx)(E.Z,{color:"primary",disabled:t,size:"small",startIcon:(0,d.jsx)(ae.Z,{}),onClick:g,children:c("preview")}),n.Published&&p.Unpublished&&(0,d.jsx)(E.Z,{color:"primary",disabled:t,size:"small",startIcon:(0,d.jsx)(te.Z,{}),onClick:v,children:c("publish")})]})]})})},oe=function(e){var n=e.content,t=e.disabled,r=e.draggableIndex,a=e.index,s=e.number,l=e.pages,c=e.reverse,u=e.onPageEdit,p=e.onPagePreview,h=e.onPagePublish,f=e.onPagesUpdate,g=l[a];return(0,d.jsx)(A._l,{draggableId:"".concat(g.ID||""),index:r,isDragDisabled:t,children:function(e){return(0,d.jsx)("div",(0,o.Z)((0,i.Z)({ref:e.innerRef},e.draggableProps),{children:(0,d.jsx)(B.$3,{flipId:g.ID,children:(0,d.jsxs)("div",{style:{paddingTop:"16px"},children:[(0,d.jsx)(Y,{disabled:t,index:a,pages:l,provided:e,reverse:c,onPagesUpdate:f}),g.Header&&(0,d.jsx)(re,{content:n,disabled:t,index:a,number:s,pages:l,onPagePublish:h,onPagesUpdate:f}),!g.Header&&(0,d.jsx)(ie,{content:n,disabled:t,index:a,number:s,pages:l,onPageEdit:u,onPagePreview:p,onPagePublish:h})]})})}))}})},se=u.memo((function(e){var n=e.content,t=e.disabled,r=e.pages,a=e.reverse,i=e.onPageEdit,o=e.onPagePreview,s=e.onPagePublish,l=e.onPagesUpdate,c=u.useMemo((function(){var e=0,n=1,t=r.map((function(t,r){var a="";return t.Header?(a="".concat(e+=1),n=1):(a=e?"".concat(e,".").concat(n):"".concat(n),n+=1),{index:r,number:a}}));return a&&(t=t.reverse()),t}),[r,a]);return(0,d.jsx)(d.Fragment,{children:c.map((function(e,c){var u=e.index,p=e.number;return(0,d.jsx)(oe,{content:n,disabled:t,draggableIndex:c,index:u,number:p,pages:r,reverse:a,onPageEdit:i,onPagePreview:o,onPagePublish:s,onPagesUpdate:l},r[u].ID)}))})})),le=function(e){var n=e.content,t=e.disabled,a=e.pages,s=e.onDisable,f=e.onEnable,g=e.onPageEdit,b=e.onPagePreview,v=e.onPagePublish,y=e.onPagesUpdate,m=(0,p.useRouter)(),Z=(0,h.$G)().t,D=m.locale,k=m.pathname,E=m.query,w="true"===E.reverse,I="";if("ja"===D)I="\u53f3\u4e0b\u306e\u300c\u30da\u30fc\u30b8\u3092\u8ffd\u52a0\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u30da\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u3001\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044";else I='Press the "ADD PAGE" button in the lower right and edit the added page';var C=u.useMemo((function(){return JSON.stringify((0,l.Z)(a).concat([w]))}),[a,w]),S=u.useCallback(function(){var e=(0,r.Z)((function(e,n){var t;return(0,c.__generator)(this,(function(e){switch(e.label){case 0:if(null===n)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,m.replace({pathname:k,query:(0,o.Z)((0,i.Z)({},E),{reverse:n})},void 0,{scroll:!1,shallow:!0})];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),(0,j.kg)(t),[3,4];case 4:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),[k,E,m]),T=u.useCallback((function(e){var n,t=e.reason,r=e.destination,i=e.source;if("CANCEL"!==t&&r){var o=i.index,s=r.index;w&&(o=((null===a||void 0===a?void 0:a.length)||0)-o-1,s=((null===a||void 0===a?void 0:a.length)||0)-s-1);var c=(0,l.Z)(a);(n=c).splice.apply(n,[s,0].concat((0,l.Z)(c.splice(o,1)))),y(c)}}),[y,a,w]);return(0,d.jsxs)(d.Fragment,{children:[!(null===a||void 0===a?void 0:a.length)&&(0,d.jsx)(x.Z,{children:(0,d.jsx)(z.Z,{severity:"info",children:I})}),!!(null===a||void 0===a?void 0:a.length)&&(0,d.jsx)(U.Z,{style:{padding:"8px 16px"},children:(0,d.jsxs)(N.Z,{value:w,exclusive:!0,size:"small",onChange:S,children:[(0,d.jsx)(R.Z,{value:!1,style:{minWidth:"72px"},children:Z("oldest-first")}),(0,d.jsx)(R.Z,{value:!0,style:{minWidth:"72px"},children:Z("newest-first")})]})}),(0,d.jsxs)(B.U5,{flipKey:C,children:[w&&(0,d.jsx)(G,{content:n,disabled:t,pages:a,onDisable:s,onEnable:f,onPagesUpdate:y}),!!(null===a||void 0===a?void 0:a.length)&&(0,d.jsx)(x.Z,{style:{paddingTop:"0"},children:(0,d.jsx)(W.Z,{children:(0,d.jsx)(A.Z5,{onDragEnd:T,children:(0,d.jsx)(A.bK,{droppableId:"droppable",children:function(e){return(0,d.jsxs)("div",(0,o.Z)((0,i.Z)({ref:e.innerRef},e.droppableProps),{children:[(0,d.jsx)(se,{content:n,disabled:t,pages:a,reverse:w,onPageEdit:g,onPagePreview:b,onPagePublish:v,onPagesUpdate:y}),e.placeholder]}))}})})})}),!w&&(0,d.jsx)(G,{content:n,disabled:t,pages:a,onDisable:s,onEnable:f,onPagesUpdate:y})]})]})},ce=function(e){var n=e.content,t=e.onContentUpdate,A=(0,p.useRouter)(),B=(0,h.$G)().t,U=(0,f.kY)().mutate,W=(0,g.Ds)().enqueueSnackbar,z=(0,k.Z)(),R=(0,s.Z)((0,D.o)(),2),N=R[0],G=N.disabled,M=N.isEdited,F=R[1],$=(0,s.Z)(u.useState(0),2),q=$[0],H=$[1],O=(0,s.Z)(u.useState(""),2),J=O[0],X=O[1],V=(0,s.Z)(u.useState(""),2),K=V[0],Y=V[1],Q=(0,s.Z)(u.useState(""),2),ee=Q[0],ne=Q[1],te=(0,s.Z)(u.useState([]),2),re=te[0],ae=te[1],ie=(0,s.Z)(u.useState((function(){return n.Pages||[]})),2),oe=ie[0],se=ie[1],ce=(0,s.Z)(u.useState(!1),2),de=ce[0],ue=ce[1],pe=(0,s.Z)(u.useState(""),2),he=pe[0],fe=pe[1],ge=(0,s.Z)(u.useState(!1),2),be=ge[0],xe=ge[1],ve=(0,s.Z)(u.useState(!1),2),ye=ve[0],me=ve[1],Ze=u.useMemo((function(){var e=(n.Tags||[]).map((function(e){return e.Name}));if(re.length!==e.length)return!0;for(var t=(0,l.Z)(re).sort(),r=e.sort(),a=0;a<t.length;a+=1)if(t[a]!==r[a])return!0;return!1}),[n.Tags,re]),je=u.useMemo((function(){var e=n.Pages||[];if(oe.length!==e.length)return!0;for(var t=0;t<e.length;t+=1){if(oe[t].ID!==e[t].ID)return!0;if(oe[t].Header&&(oe[t].Title||"").trim()!==(e[t].Title||""))return!0}return!1}),[n.Pages,oe]),De=u.useCallback((function(e){X((null===e||void 0===e?void 0:e.Paid)?"true":"false"),Y((null===e||void 0===e?void 0:e.Title)||""),ne((null===e||void 0===e?void 0:e.Description)||""),ae(((null===e||void 0===e?void 0:e.Tags)||[]).map((function(e){return e.Name}))),se((null===e||void 0===e?void 0:e.Pages)||[])}),[]);u.useEffect((function(){n.ID&&n.ID!==q&&(H(n.ID),z("/auth/content/".concat(n.ID)).then((function(e){De(e)})).catch((function(e){return(0,j.kg)(e)})))}),[n,z,q,t,De]),u.useEffect((function(){"true"===J===!!n.Paid?K.trim().slice(0,100)===(n.Title||"")&&ee.trim().slice(0,1e3)===(n.Description||"")?F(Ze||je?{type:"SET_IS_EDITED",payload:!0}:{type:"SET_IS_EDITED",payload:!1}):F({type:"SET_IS_EDITED",payload:!0}):F({type:"SET_IS_EDITED",payload:!0})}),[je,Ze,n.Description,n.Img,n.Paid,n.Title,ee,F,J,K]),u.useEffect((function(){if(he){if(de){var e=he;return fe(""),void A.replace(e).catch((function(e){return(0,j.kg)(e)})).finally((function(){F({type:"SET_DISABLED",payload:!1})}))}if(!M){var n=he;fe(""),A.push(n).catch((function(e){return(0,j.kg)(e)})).finally((function(){F({type:"SET_DISABLED",payload:!1})}))}}}),[F,de,M,he,A]),u.useEffect((function(){var e=function(e){if(M&&!de){var t=B("you-have-unsaved-changes");return e.preventDefault(),e.returnValue=t,t}n.ID&&z("/auth/content/".concat(n.ID,"/page"),{method:"DELETE"}).catch((function(e){return(0,j.kg)(e)}))};return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[n.ID,z,de,M,B]),u.useEffect((function(){var e=function(e,t){if(!t.shallow){if(M&&!de&&!window.confirm(B("you-have-unsaved-changes")))throw A.events.emit("routeChangeError"),"Route change was cancelled";n.ID&&z("/auth/content/".concat(n.ID,"/page"),{method:"DELETE"}).catch((function(e){return(0,j.kg)(e)}))}};return A.events.on("routeChangeStart",e),function(){A.events.off("routeChangeStart",e)}}),[n.ID,z,de,M,A.events,B]);var ke=u.useCallback((function(){return xe(!1)}),[]),Ee=u.useCallback((function(){return me(!1)}),[]),we=u.useCallback((function(){return F({type:"SET_DISABLED",payload:!0})}),[F]),Ie=u.useCallback((function(){return F({type:"SET_DISABLED",payload:!1})}),[F]),Ce=u.useCallback((function(e){return X(e)}),[]),Se=u.useCallback((function(e){return Y(e.target.value)}),[]),Te=u.useCallback((function(e){return ne(e.target.value)}),[]),Pe=u.useCallback((function(e,n){return ae(n)}),[]),_e=u.useCallback((function(e){return se(e)}),[]),Le=u.useCallback((0,r.Z)((function(){var e,r,a,i;return(0,c.__generator)(this,(function(o){switch(o.label){case 0:if(!M)return[2];if(e=new FormData,"true"===J!==!!n.Paid&&e.append("paid",J),(r=K.trim().slice(0,100))!==(n.Title||"")&&e.a
1ppend("title",r),(a=ee.trim().slice(0,1e3))!==(n.Description||"")&&e.append("description",a),Ze&&e.append("tags",re.join(",")),je&&e.append("pages",JSON.stringify(oe)),!n.ID)throw new Error("content.ID is undefined");return[4,z("/auth/content/".concat(n.ID),{method:"PUT",body:e})];case 1:if(null===(i=o.sent()))throw new Error("newContent is null");return De(i),t(i),[2]}}))})),[je,Ze,n.Description,n.ID,n.Paid,n.Title,ee,z,M,t,oe,J,De,re,K]),Ae=u.useCallback((0,r.Z)((function(){var e;return(0,c.__generator)(this,(function(t){switch(t.label){case 0:F({type:"SET_DISABLED",payload:!0}),t.label=1;case 1:if(t.trys.push([1,3,,4]),!n.ID)throw new Error("content.ID is undefined");return[4,z("/auth/content/".concat(n.ID),{method:"DELETE"})];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),(0,j.kg)(e),W(B("failed-to-delete-post"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:try{return ue(!0),fe("/auth/upload"),[2]}catch(r){(0,j.kg)(r)}return F({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.ID,W,F,z,B]),Be=u.useCallback((0,r.Z)((function(){var e;return(0,c.__generator)(this,(function(t){switch(t.label){case 0:if(n.Published&&!oe.length)return W(B("content-is-empty"),{variant:"error"}),[2];F({type:"SET_DISABLED",payload:!0}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Le()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),(0,j.kg)(e),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:return F({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.Published,F,W,oe.length,Le,B]);u.useEffect((function(){F({type:"SET_ON_SAVE",payload:Be})}),[F,Be]);var Ue=u.useCallback((0,r.Z)((function(){var e,t,r;return(0,c.__generator)(this,(function(a){switch(a.label){case 0:if(!oe.length)return W(B("content-is-empty"),{variant:"error"}),[2];F({type:"SET_DISABLED",payload:!0}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Le()];case 2:return a.sent(),[3,4];case 3:return e=a.sent(),(0,j.kg)(e),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:if(a.trys.push([4,6,,7]),!n.ID)throw new Error("content.ID is undefined");return[4,z("/auth/content/".concat(n.ID,"?for=validation"),{method:"GET"})];case 5:return(null===(t=a.sent())||void 0===t?void 0:t.isEmpty)?(W(B("content-is-empty"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2]):[3,7];case 6:return r=a.sent(),(0,j.kg)(r),[3,7];case 7:try{if(!n.ID||!n.Type)throw new Error("content.ID or content.Type is undefined");return fe("/auth/upload/".concat(n.Type,"/preview?id=").concat(n.ID)),[2]}catch(i){(0,j.kg)(i)}return F({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.ID,n.Type,F,W,z,oe,Le,B]);u.useEffect((function(){F({type:"SET_ON_PREVIEW",payload:Ue})}),[F,Ue]);var We=u.useCallback((0,r.Z)((function(){var e,t,r;return(0,c.__generator)(this,(function(a){switch(a.label){case 0:if(!oe.length)return W(B("content-is-empty"),{variant:"error"}),[2];F({type:"SET_DISABLED",payload:!0}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Le()];case 2:return a.sent(),[3,4];case 3:return e=a.sent(),(0,j.kg)(e),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:if(a.trys.push([4,6,,7]),!n.ID)throw new Error("content.ID is undefined");return[4,z("/auth/content/".concat(n.ID,"?for=validation"),{method:"GET"})];case 5:return(null===(t=a.sent())||void 0===t?void 0:t.isEmpty)?(W(B("content-is-empty"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2]):[3,7];case 6:return r=a.sent(),(0,j.kg)(r),[3,7];case 7:return F({type:"SET_DISABLED",payload:!1}),xe(!0),[2]}}))})),[n.ID,F,W,z,oe,Le,B]);u.useEffect((function(){F({type:"SET_ON_PUBLISH",payload:We})}),[F,We]);var ze=u.useCallback((0,r.Z)((function(){var e,r,i,o;return(0,c.__generator)(this,(function(s){switch(s.label){case 0:F({type:"SET_DISABLED",payload:!0}),xe(!1),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Le()];case 2:return s.sent(),[3,4];case 3:return e=s.sent(),(0,j.kg)(e),W(B("failed-to-publish-post"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:if(s.trys.push([4,6,,7]),!n.ID)throw new Error("content.ID is undefined");
1return(r=new FormData).append("published","true"),[4,z("/auth/content/".concat(n.ID),{method:"PUT",body:r})];case 5:if(null===(i=s.sent()))throw new Error("newContent is null");return De(i),t(i),[3,7];case 6:if(o=s.sent(),!(0,a.Z)(o,Error))return(0,j.kg)(o),W(B("failed-to-publish-post"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];switch(o.message.trim()){case"contentIsEmpty":W(B("content-is-empty"),{variant:"error"});break;case"tooManyRequests":W(B("daily-rate-limit-exceeded"),{variant:"error"});break;default:(0,j.kg)(o),W(B("failed-to-publish-post"),{variant:"error"})}return F({type:"SET_DISABLED",payload:!1}),[2];case 7:return me(!0),F({type:"SET_DISABLED",payload:!1}),[2]}}))})),[n.ID,F,W,z,t,Le,De,B]),Re=u.useCallback(function(){var e=(0,r.Z)((function(e){var t;return(0,c.__generator)(this,(function(r){switch(r.label){case 0:F({type:"SET_DISABLED",payload:!0}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Le()];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),(0,j.kg)(t),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:try{if(!n.Type||!e.ID)throw new Error("content.Type or newPage.ID is undefined");return fe("/auth/upload/".concat(n.Type,"/page?id=").concat(e.ID)),[2]}catch(a){(0,j.kg)(a)}return F({type:"SET_DISABLED",payload:!1}),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[n.Type,F,W,Le,B]),Ne=u.useCallback(function(){var e=(0,r.Z)((function(e){var t,r,a,i,o,s,l,d,u;return(0,c.__generator)(this,(function(c){switch(c.label){case 0:F({type:"SET_DISABLED",payload:!0}),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Le()];case 2:return c.sent(),[3,4];case 3:return t=c.sent(),(0,j.kg)(t),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:if(c.trys.push([4,7,,8]),!e.ID)throw new Error("page.ID is undefined");return[4,z("/auth/page/".concat(e.ID,"?for=preview"),{method:"GET"})];case 5:if(null===(i=c.sent()))throw new Error("newContent is null");return"[]"===(o=null===(r=i.Pages)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.Body)||'{"type":"doc","content":[{"type":"paragraph"}]}'===o?(W(B("content-is-empty"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2]):[4,U("/auth/page/".concat(e.ID,"?for=preview"),i,!1)];case 6:return c.sent(),[3,8];case 7:return s=c.sent(),(0,j.kg)(s),[3,8];case 8:try{for(l=0,d=0;d<oe.length&&(oe[d].Header||!((l+=1)>1));d+=1);return u="",l>1&&n.Type&&e.ID?u="/auth/upload/".concat(n.Type,"/preview/page?id=").concat(e.ID):n.Type&&n.ID&&(u="/auth/upload/".concat(n.Type,"/preview?id=").concat(n.ID)),fe(u),[2]}catch(p){(0,j.kg)(p)}return F({type:"SET_DISABLED",payload:!1}),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[n.ID,n.Type,F,W,z,U,oe,Le,B]),Ge=u.useCallback(function(){var e=(0,r.Z)((function(e){var r,s,d,u,p,h,f,g;return(0,c.__generator)(this,(function(c){switch(c.label){case 0:F({type:"SET_DISABLED",payload:!0}),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Le()];case 2:return c.sent(),[3,4];case 3:return r=c.sent(),(0,j.kg)(r),W(B("failed-to-save-changes"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];case 4:if(c.trys.push([4,6,,7]),!e.ID)throw new Error("oldPage.ID is undefined");return d=JSON.stringify({unpublished:!1}),[4,z("/auth/page/".concat(e.ID),{method:"PUT",body:d})];case 5:if(u=c.sent(),!(p=null===u||void 0===u||null===(s=u.Pages)||void 0===s?void 0:s[0]))throw new Error("newPage is undefined");for(h=(0,l.Z)(oe),f=0;f<h.length;f+=1)if(p.ID===h[f].ID){h.splice(f,1,p);break}return se(h),t((0,o.Z)((0,i.Z)({},n),{Pages:h})),[3,7];case 6:if(g=c.sent(),!(0,a.Z)(g,Error))return(0,j.kg)(g),W(B("failed-to-publish-page"),{variant:"error"}),F({type:"SET_DISABLED",payload:!1}),[2];switch(g.message.trim()){case"contentIsEmpty":W(B("content-is-empty"),{variant:"error"});break;case"tooManyRequests":W(B("daily-rate-limit-exceeded"),{variant:"error"});break;default:(0,j.kg)(g),W(B("failed-to-publish-page"),{variant:"error"})}return F({type:"SET_DISABLED",payload:!1}),[2];case 7:return F({type:"SET_DISABLED",payload:!1}),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[n,F,W,z,t,oe,Le,B]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(b.Z,{children:[(0,d.jsx)(I.Z,{content:n,disabled:G,onContentUpdate:t,onContentDelete:Ae}),(0,d.jsx)(x.Z,{style:{padding:"0 16px"},children:(0,d.jsx)(S.Z,{value:J,disabled:G,onChange:Ce})}),(0,d.jsx)(w.Z,{content:n}),"image"!==n.Type&&(0,d.jsx)(_.Z,{content:n,onContentUpdate:t}),(0,d.jsxs)(x.Z,{children:[(0,d.jsx)(L.Z,{value:K,disabled:G,onChange:Se}),(0,d.jsx)(P.Z,{value:re,disabled:G,style:{marginTop:"8px"},onChange:Pe}),(0,d.jsx)(T.Z,{value:ee,disabled:G,style:{marginTop:"8px"},onChange:Te})]}),(0,d.jsx)(le,{content:n,disabled:G,pages:oe,onDisable:we,onEnable:Ie,onPageEdit:Re,onPagePreview:Ne,onPagePublish:Ge,onPagesUpdate:_e})]}),(0,d.jsxs)(v.Z,{open:be,fullWidth:!0,maxWidth:"xs",onClose:ke,children:[(0,d.jsx)(Z.Z,{children:B("publish-this-post?")}),(0,d.jsxs)(m.Z,{children:[(0,d.jsx)(L.Z,{value:K,disabled:G,onChange:Se}),(0,d.jsx)(P.Z,{value:re,disabled:G,style:{marginTop:"8px"},onChange:Pe}),(0,d.jsx)(T.Z,{value:ee,disabled:G,style:{marginTop:"8px"},onChange:Te})]}),(0,d.jsxs)(y.Z,{children:[(0,d.jsx)(E.Z,{disabled:G,onClick:ke,children:B("cancel")}),(0,d.jsx)(E.Z,{disabled:G,onClick:ze,children:B("publish")})]})]}),(0,d.jsx)(C.Z,{content:n,open:ye,onClose:Ee})]})}},3479:function(e,n,t){var r=t(85893),a=t(67294),i=t(60253),o=t(79912),s=t(22318),l=t(57308);n.Z=function(e){var n,t,c=e.content,d=(0,i.$G)().t,u=null===(n=c.Collabo)||void 0===n?void 0:n.Original,p=a.useMemo((function(){return(null===u||void 0===u?void 0:u.ID)?"/post/".concat(u.ID.toString(36)):""}),[null===u||void 0===u?void 0:u.ID]);return c.ID===(null===u||void 0===u?void 0:u.ID)?null:(0,r.jsxs)(o.Z,{style:{padding:"8px 16px 24px 16px"},children:[(0,r.jsx)(s.Z,{variant:"body1",style:{opacity:.7},children:d("collaborating-with")}),(0,r.jsx)(s.Z,{noWrap:!0,variant:"body1",style:{marginTop:"8px"},children:(0,r.jsx)(l.Z,{href:p,textLink:!0,children:"".concat((null===u||void 0===u?void 0:u.Title)||d("untitled")||""," by ").concat((null===u||void 0===u||null===(t=u.User)||void 0===t?void 0:t.Name)||d("guest")||"")})})]})}},93092:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(828),a=t(85893),i=t(67294),o=t(11163),s=t(60253),l=t(79912),c=t(17812),d=t(24794),u=t(22318),p=t(46160),h=t(57308),f=t(52663),g=t(66856),b=t(66083),x=t(95757),v=t(85639),y=t(40570),m=i.forwardRef((function(e,n){var t=e.disabled,o=e.onClose,l=e.onContentDelete,c=(0,s.$G)().t,d=(0,r.Z)(i.useState(!1),2),u=d[0],p=d[1],h=i.useCallback((function(){p(!0),o()}),[o]),m=i.useCallback((function(){return p(!1)}),[]),Z=i.useCallback((function(){p(!1),l()}),[l]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.Z,{ref:n,disabled:t,onClick:h,children:(0,a.jsx)(x.Z,{primary:c("delete")})}),(0,a.jsxs)(f.Z,{open:u,fullWidth:!0,maxWidth:"xs",onClose:m,children:[(0,a.jsx)(b.Z,{children:c("delete-this-post?")}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(y.Z,{disabled:t,onClick:m,children:c("cancel")}),(0,a.jsx)(y.Z,{color:"error",disabled:t,onClick:Z,children:c("delete")})]})]})]})})),Z=t(47568),j=t(20414),D=t(72091),k=t(49384),E=t(61164),w=t(92674),I=i.forwardRef((function(e,n){var t=e.content,o=e.disabled,l=e.onClose,c=e.onContentUpdate,d=(0,s.$G)().t,u=(0,D.Ds)().enqueueSnackbar,p=(0,w.Z)(),h=(0,E.o)()[1],m=(0,r.Z)(i.useState(!1),2),I=m[0],C=m[1],S=i.useCallback((function(){C(!0),l()}),[l]),T=i.useCallback((function(){return C(!1)}),[]),P=i.useCallback((0,Z.Z)((function(){var e,n,r;return(0,j.__generator)(this,(function(a){switch(a.label){case 0:h({type:"SET_DISABLED",payload:!0}),C(!1),a.label=1;case 1:if(a.trys.push([1,3,,4]),!t.ID)throw new Error("content.ID is undefined");
1return(e=new FormData).append("published","false"),[4,p("/auth/content/".concat(t.ID),{method:"PUT",body:e})];case 2:if(null===(n=a.sent()))throw new Error("newContent is null");return c(n),[3,4];case 3:return r=a.sent(),(0,k.kg)(r),u(d("failed-to-unpublish-post"),{variant:"error"}),h({type:"SET_DISABLED",payload:!1}),[2];case 4:return u(d("this-post-has-been-unpublished"),{variant:"success"}),h({type:"SET_DISABLED",payload:!1}),[2]}}))})),[t.ID,h,u,p,c,d]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.Z,{ref:n,disabled:o,onClick:S,children:(0,a.jsx)(x.Z,{primary:d("unpublish")})}),(0,a.jsxs)(f.Z,{open:I,fullWidth:!0,maxWidth:"xs",onClose:T,children:[(0,a.jsx)(b.Z,{children:d("unpublish-this-post?")}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(y.Z,{disabled:o,onClick:T,children:d("cancel")}),(0,a.jsx)(y.Z,{disabled:o,onClick:P,children:d("unpublish")})]})]})]})})),C=function(e){var n=e.content,t=e.disabled,f=e.onContentDelete,g=e.onContentUpdate,b=(0,o.useRouter)(),x=b.defaultLocale,v=b.locale,y=(0,s.$G)().t,Z=i.useRef(null),j=(0,r.Z)(i.useState(null),2),D=j[0],k=j[1],E=i.useMemo((function(){return n.ID?"/post/".concat(n.ID.toString(36)):""}),[n.ID]),w=i.useMemo((function(){var e="https://baskadia.com";return v&&v!==x&&(e+="/".concat(v)),e+=E}),[x,E,v]),C=i.useCallback((function(e){k(e.currentTarget)}),[]),S=i.useCallback((function(){k(null)}),[]);return(0,a.jsxs)(l.Z,{style:{position:"relative"},children:[(0,a.jsx)(c.Z,{ref:Z,style:{position:"absolute",top:"0",right:"0",zIndex:1},onClick:C,children:(0,a.jsx)(p.Z,{})}),(0,a.jsxs)(d.Z,{open:!!D,anchorEl:Z.current,keepMounted:!0,onClose:S,children:[n.Published&&(0,a.jsx)(I,{content:n,disabled:t,onContentUpdate:g,onClose:S}),(0,a.jsx)(m,{disabled:t,onClose:S,onContentDelete:f})]}),(0,a.jsx)(u.Z,{variant:"body1",style:{opacity:.7},children:y("published-url")}),n.Published&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Z,{variant:"body1",style:{marginTop:"8px",overflowWrap:"break-word"},children:(0,a.jsx)(h.Z,{href:E,textLink:!0,children:w})}),(0,a.jsx)(u.Z,{variant:"caption",style:{opacity:.7},children:y("share-button-is-in-upper-right")})]}),!n.Published&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Z,{color:"error",variant:"body1",style:{marginTop:"8px",fontWeight:"bold"},children:y("this-post-is-unpublished")}),(0,a.jsx)(u.Z,{variant:"caption",style:{opacity:.7},children:y("publish-button-is-in-upper-right")})]})]})}},38584:function(e,n,t){var r=t(85893),a=t(67294),i=t(11163),o=t(60253),s=t(52663),l=t(66856),c=t(29525),d=t(66083),u=t(48179),p=t(43931),h=t(40570),f=t(57308);n.Z=function(e){var n=e.content,t=e.open,g=e.onClose,b=(0,i.useRouter)(),x=b.defaultLocale,v=b.locale,y=(0,o.$G)().t,m=a.useMemo((function(){return(null===n||void 0===n?void 0:n.ID)?"/post/".concat(n.ID.toString(36)):""}),[null===n||void 0===n?void 0:n.ID]),Z=a.useMemo((function(){var e="https://baskadia.com";return v&&v!==x&&(e+="/".concat(v)),e+=m}),[x,m,v]),j=a.useMemo((function(){return(null===n||void 0===n?void 0:n.ID)?"/post/".concat(n.ID.toString(36),"/share"):""}),[null===n||void 0===n?void 0:n.ID]);return(0,r.jsxs)(s.Z,{open:t,fullWidth:!0,maxWidth:"xs",onClose:g,children:[(0,r.jsx)(d.Z,{children:y("your-post-has-been-published")}),(0,r.jsxs)(c.Z,{style:{overflowWrap:"break-word"},children:[y("published-url"),(0,r.jsx)("br",{}),(0,r.jsx)(f.Z,{href:m,textLink:!0,children:Z})]}),(0,r.jsx)(l.Z,{style:{marginTop:"8px"},children:(0,r.jsx)(f.Z,{href:j,style:{display:"block",width:"100%"},children:(0,r.jsx)(h.Z,{color:"primary",fullWidth:!0,startIcon:(0,r.jsx)(p.Z,{}),variant:"contained",children:y("share")})})}),(0,r.jsx)(l.Z,{style:{paddingTop:"0"},children:(0,r.jsx)(f.Z,{href:"/",style:{display:"block",width:"100%"},children:(0,r.jsx)(h.Z,{fullWidth:!0,startIcon:(0,r.jsx)(u.Z,{}),variant:"contained",children:y("home")})})}),(0,r.jsx)(l.Z,{style:{paddingTop:"0"},children:(0,r.jsx)(h.Z,{fullWidth:!0,variant:"contained",onClick:g,children:y("close")})})]})}},48799:function(e,n,t){var r=t(828),a=t(85893),i=t(67294),o=t(11163),s=t(60253),l=t(52663),c=t(66856),d=t(29525),u=t(7212),p=t(66083),h=t(64436),f=t(30553),g=t(96019),b=t(32340),x=t(37661),v=t(61164),y=t(13048),m=t(40570),Z=t(57308);
1n.Z=function(e){var n,t,j,D,k=e.disabled,E=e.value,w=e.onChange,I=(0,r.Z)((0,v.o)(),1)[0].auth,C=(0,y.Z)((null===I||void 0===I?void 0:I.ID)?"/user/".concat(I.ID,"/product"):null).data,S=(0,o.useRouter)().locale,T=(0,s.$G)().t,P=(0,r.Z)(i.useState(!1),2),_=P[0],L=P[1],A=!!(null===C||void 0===C||null===(n=C[0])||void 0===n||null===(t=n.Prices)||void 0===t?void 0:t.length);if("ja"===S)j="\u53ce\u76ca\u5316\u306e\u8a2d\u5b9a\u3092\u5b8c\u4e86\u3057\u3066\u304f\u3060\u3055\u3044",D=(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{children:["\u30d7\u30ec\u30df\u30a2\u30e0\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u53ce\u76ca\u3092\u5f97\u308b\u306b\u306f\u3001",(0,a.jsx)(Z.Z,{href:"/auth/earnings",textLink:!0,children:"\u53ce\u76ca\u30da\u30fc\u30b8"}),"\u3067\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u5b8c\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\uff1a"]}),(0,a.jsxs)(u.Z,{component:"ol",style:{paddingLeft:"24px"},children:[(0,a.jsx)("li",{children:"\u30d3\u30b8\u30cd\u30b9\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3002"}),(0,a.jsx)("li",{children:"\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u306e\u6708\u984d\u6599\u91d1\u3092\u8a2d\u5b9a\u3059\u308b\u3002"})]}),(0,a.jsxs)(u.Z,{children:["\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001",(0,a.jsx)(Z.Z,{href:"/help/ja/351000000000",textLink:!0,children:T("how-to-earn-on-baskadia?")}),"\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002"]})]});else j="Complete your earnings setup",D=(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{children:["To start earning from your premium content, complete the following steps on"," ",(0,a.jsx)(Z.Z,{href:"/auth/earnings",textLink:!0,children:"the Earnings page"}),":"]}),(0,a.jsxs)(u.Z,{component:"ol",style:{paddingLeft:"24px"},children:[(0,a.jsx)("li",{children:"Set up your business account."}),(0,a.jsx)("li",{children:"Set your monthly subscription fee."})]}),(0,a.jsxs)(u.Z,{children:["For more information, see"," ",(0,a.jsx)(Z.Z,{href:"/help/en/251000000000",textLink:!0,children:T("how-to-earn-on-baskadia?")})]})]});var B=i.useCallback((function(){return L(!1)}),[]),U=i.useCallback((function(e){"true"!==e.target.value||A?w(e.target.value):L(!0)}),[A,w]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.Z,{disabled:k,fullWidth:!0,style:{marginTop:"16px"},children:[(0,a.jsxs)(g.Z,{children:[T("free")," / ",T("paid")]}),(0,a.jsxs)(x.Z,{row:!0,value:E,onChange:U,children:[(0,a.jsx)(f.Z,{value:"false",control:(0,a.jsx)(b.Z,{}),label:T("free")}),(0,a.jsx)(f.Z,{value:"true",control:(0,a.jsx)(b.Z,{}),label:T("premium")})]})]}),(0,a.jsxs)(l.Z,{open:_,onClose:B,children:[(0,a.jsx)(p.Z,{children:j}),D,(0,a.jsx)(c.Z,{children:(0,a.jsx)(m.Z,{onClick:B,children:T("close")})})]})]})}},85614:function(e,n,t){var r=t(85893),a=(t(67294),t(60253)),i=t(39803),o=t(22318);n.Z=function(e){var n=e.value,t=e.disabled,s=e.style,l=e.onChange,c=(0,a.$G)().t;return(0,r.jsxs)("div",{style:s,children:[(0,r.jsx)(i.Z,{name:"description",value:n,label:c("summary-optional"),error:n.length>500,autoComplete:"off",disabled:t,fullWidth:!0,multiline:!0,type:"text",variant:"outlined",onChange:l}),(0,r.jsx)(o.Z,{align:"right",color:n.length>500?"error":"inherit",display:"block",variant:"caption",children:"".concat(n.length," / 500")})]})}},11135:function(e,n,t){var r=t(47568),a=t(14924),i=t(26042),o=t(69396),s=t(828),l=t(20414),c=t(85893),d=t(67294),u=t(60253),p=t(32427),h=t(16204),f=t(39803),g=t(22318),b=t(33518),x=t(49384),v=t(92674),y=(0,p.Z)((function(e){return{root:(0,a.Z)({},e.breakpoints.down("xs"),{height:"24px"}),label:(0,a.Z)({},e.breakpoints.down("xs"),{padding:"0 8px"}),deleteIcon:{width:"16px",height:"16px"}}}));n.Z=function(e){var n=e.value,t=e.disabled,a=e.style,p=e.onChange,m=(0,u.$G)().t,Z=y(),j=(0,v.Z)(),D=(0,s.Z)(d.useState(""),2),k=D[0],E=D[1],w=(0,s.Z)(d.useState([]),2),I=w[0],C=w[1],S=d.useCallback((function(e){return e.filter((function(e){return!n.some((function(n){return n===e}))}))}),[n]),T=d.useCallback((function(e){return(0,c.jsx)(f.Z,(0,o.Z)((0,i.Z)({},e),{label:m("tags"),error:n.length>10,fullWidth:!0,variant:"outlined"}))}),[n,m]),P=d.useCallback((function(e,n){return e.map((function(e,t){return(0,c.jsx)(h.Z,(0,i.Z)({classes:Z,label:e},n({index:t})))}))}),[Z]),_=d.useCallback(function(){var e=(0,r.Z)((function(e,n){var t,r;return(0,l.__generator)(this,(function(e){switch(e.label){case 0:if(E(n),!n.trim())return C([]),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,j("/tag?search_query=".concat(encodeURIComponent(n.trim())))];case 2:if(null===(t=e.sent()))throw new Error("newTags is null");return C(t.map((function(e){return e.Name}))),[3,4];case 3:return r=e.sent(),(0,x.kg)(r),[3,4];case 4:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),[j]);return(0,c.jsxs)("div",{style:a,children:[(0,c.jsx)(b.ZP,{id:"tags",value:n,inputValue:k,autoSelect:!0,disabled:t,filterOptions:S,freeSolo:!0,multiple:!0,options:I,renderInput:T,renderTags:P,onChange:p,onInputChange:_}),(0,c.jsx)(g.Z,{align:"right",color:n.length>10?"error":"inherit",display:"block",variant:"caption",children:"".concat(n.length," / 10")})]})}},26315:function(e,n,t){var r=t(47568),a=t(828),i=t(20414),o=t(85893),s=t(60357),l=t.n(s),c=t(67294),d=t(60253),u=t(72091),p=t(79912),h=t(95477),f=t(22318),g=t(49384),b=t(92674),x=t(77327);n.Z=function(e){var n=e.content,t=e.onContentUpdate,s=(0,d.$G)().t,v=(0,u.Ds)().enqueueSnackbar,y=(0,b.Z)(),m=(0,a.Z)(c.useState(!1),2),Z=m[0],j=m[1],D=c.useCallback(function(){var e=(0,r.Z)((function(e){var r,a,o,l,c;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(j(!0),!(null===(r=e.target.files)||void 0===r?void 0:r.length))return v(s("file-upload-failed"),{variant:"error"}),j(!1),[2];if("image/jpeg"!==(a=e.target.files[0]).type&&"image/png"!==a.type&&"image/gif"!==a.type)return v(s("file-upload-failed"),{variant:"error"}),j(!1),[2];if(e.target.value="",a.size>32e6)return v(s("file-size-must-be-32-mb-or-less"),{variant:"error"}),j(!1),[2];i.label=1;case 1:if(i.trys.push([1,3,,4]),!n.ID)throw new Error("content.ID is undefined");return(o=new FormData).append("img",a),[4,y("/auth/content/".concat(n.ID),{method:"PUT",body:o})];case 2:if(null===(l=i.sent()))throw new Error("newContent is null");return t(l),[3,4];case 3:return c=i.sent(),(0,g.kg)(c),v(s("file-upload-failed"),{variant:"error"}),j(!1),[2];case 4:return j(!1),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[n.ID,v,y,t,s]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Z,{children:[(0,o.jsx)(f.Z,{variant:"body1",style:{opacity:.7},children:s("thumbnail")}),(0,o.jsxs)("div",{className:"jsx-a5d9fd11ed87f8ce "+l().dynamic([["d257737957cd7a28",[Z?"default":"pointer",Z?"default":"pointer"]]])+" container",children:[(0,o.jsx)(x.Z,{content:n,style:{height:"200px"}}),(0,o.jsx)("input",{accept:"image/x-png, image/jpeg, image/gif",disabled:Z,type:"file",onChange:D,className:"jsx-a5d9fd11ed87f8ce "+l().dynamic([["d257737957cd7a28",[Z?"default":"pointer",Z?"default":"pointer"]]])}),Z&&(0,o.jsx)("div",{className:"jsx-a5d9fd11ed87f8ce "+l().dynamic([["d257737957cd7a28",[Z?"default":"pointer",Z?"default":"pointer"]]]),children:(0,o.jsx)("div",{className:"jsx-a5d9fd11ed87f8ce "+l().dynamic([["d257737957cd7a28",[Z?"default":"pointer",Z?"default":"pointer"]]]),children:(0,o.jsx)(h.Z,{})})})]}),(0,o.jsx)(f.Z,{display:"block",variant:"caption",style:{opacity:.7,marginTop:"8px"},children:s("click-and-update-image")})]}),(0,o.jsx)(l(),{id:"d257737957cd7a28",dynamic:[Z?"default":"pointer",Z?"default":"pointer"],children:".__jsx-style-dynamic-selector::-webkit-file-upload-button{cursor:".concat(Z?"default":"pointer","}input.__jsx-style-dynamic-selector{cursor:").concat(Z?"default":"pointer","}")}),(0,o.jsx)(l(),{id:"a5d9fd11ed87f8ce",children:".container.jsx-a5d9fd11ed87f8ce{position:relative;margin:8px auto 0}.container.jsx-a5d9fd11ed87f8ce>div.jsx-a5d9fd11ed87f8ce{position:absolute;top:0;left:0;width:100%;height:100%}.container.jsx-a5d9fd11ed87f8ce>div.jsx-a5d9fd11ed87f8ce>div.jsx-a5d9fd11ed87f8ce{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;height:100%}input.jsx-a5d9fd11ed87f8ce{opacity:0;position:absolute;top:0;left:0;width:100%;height:100%}"})]})}},49253:function(e,n,t){var r=t(85893),a=t(67294),i=t(60253),o=t(39803),s=t(22318);n.Z=function(e){var n=e.value,t=e.disabled,l=e.style,c=e.onChange,d=(0,i.$G)().t,u=a.useCallback((function(e){"Enter"===e.key&&e.preventDefault()}),[]);return(0,r.jsxs)("div",{style:l,children:[(0,r.jsx)(o.Z,{name:"title",value:n,label:d("title"),error:n.length>100,autoComplete:"off",disabled:t,fullWidth:!0,multiline:!0,type:"text",variant:"outlined",onChange:c,onKeyPress:u}),(0,r.jsx)(s.Z,{align:"right",color:n.length>100?"error":"inherit",display:"block",variant:"caption",children:"".concat(n.length," / 100")})]})}},94118:function(e,n,t){var r=t(82670),a=t(26042),i=t(69396),o=t(828),s=t(67294),l=t(11163),c=t(36808),d=t.n(c);n.Z=function(){var e=(0,l.useRouter)().locale,n=(0,o.Z)(s.useState(null),2),t=n[0],c=n[1];return s.useEffect((function(){c(new XMLHttpRequest)}),[]),s.useMemo((function(){return{abort:function(){var e;null===t||void 0===t||null===(e=t.abort)||void 0===e||e.call(t)},send:function(n,s){if(null===t)return new Promise((function(e){return e(null)}));var l="".concat("https://api.baskadia.com").concat(n);t.open(s.method||"GET",l);var c={Accept:"application/json","Accept-Language":e||"en"},u=d().get("auth._token.local");return u&&(c=(0,i.Z)((0,a.Z)({},c),{Authorization:u}
1),t.withCredentials=!0),Object.entries(c).forEach((function(e){var n=(0,o.Z)(e,2),r=n[0],a=n[1];t.setRequestHeader(r,a)})),s.onAbort&&(t.upload.onabort=s.onAbort),s.onProgress&&(t.upload.onprogress=s.onProgress),new Promise((function(e,n){null!==t?(t.onload=function(t){if((0,r.Z)(t.target,XMLHttpRequest))if(200===t.target.status)try{var a=JSON.parse(t.target.responseText);e(a)}catch(i){e(null)}else n(new Error(t.target.responseText));else n(new Error("event.target must be XMLHttpRequest"))},t.onerror=function(e){(0,r.Z)(e.target,XMLHttpRequest)?n(new Error(e.target.responseText)):n(new Error("event.target must be XMLHttpRequest"))},t.send(s.body)):e(null)}))}}}),[e,t])}}}]);

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.