"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[375],{541:function(e,t,n){n.d(t,{fV:function(){return a},Ap:function(){return s},h:function(){return i},tO:function(){return d}});var o=n(8668),l=(n(5248),o.Z.apps.length?o.Z.app():o.Z.initializeApp({apiKey:"AIzaSyAzBCkPEzzPnYecMn4vZ_6xbElKlucfeqQ",authDomain:"hokkienph.firebaseapp.com",projectId:"hokkienph",storageBucket:"hokkienph.appspot.com",messagingSenderId:"692570251019",appId:"1:692570251019:web:9eac6c008263be367e8c0e",measurementId:"G-LG23G7493Y"})),a=l.auth(),i=l.firestore(),s=new o.Z.auth.GoogleAuthProvider,d=l.storage()},729:function(e,t,n){var o=n(4051),l=n.n(o),a=n(5893),i=n(7294),s=n(8471),d=n(541),r=n(6677),c=n(3349);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function v(e,t,n,o,l,a,i){try{var s=e[a](i),d=s.value}catch(r){return void n(r)}s.done?t(d):Promise.resolve(d).then(o,l)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(o,l){var a=e.apply(t,n);function i(e){v(a,o,l,i,s,"next",e)}function s(e){v(a,o,l,i,s,"throw",e)}i(void 0)}))}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(e){var t,n,o,u,v,p,x,m,y,b,k,g,j,N,w,S,T,M,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,$,X,G,J,Y,Q,q,ee,te,ne,oe,le,ae,ie,se,de,re,ce,ue,ve,he=e.docId,fe=f((0,c.F_)(d.fV),1)[0],pe=f((0,r.ky)(d.h.collection("hokkienWords").doc("".concat(he))),3),xe=pe[0],me=(pe[1],pe[2],(0,i.useState)(!1)),ye=me[0],be=me[1],ke=(0,i.useState)(!0),ge=ke[0],je=ke[1],Ne=(0,i.useState)(!1),we=Ne[0],Se=Ne[1],Te=(0,i.useState)(""),Me=Te[0],Ce=Te[1],Fe=(0,i.useState)(""),We=Fe[0],Be=Fe[1],Ae=(0,i.useState)(""),Ie=Ae[0],De=Ae[1],Ue=(0,i.useState)(""),Oe=Ue[0],_e=Ue[1],Ee=(0,i.useState)(""),Ve=Ee[0],Re=Ee[1],ze=(0,i.useState)(""),Le=ze[0],Ke=ze[1],Ze=(0,i.useState)(null),Pe=Ze[0],He=Ze[1],$e=(0,i.useState)(null),Xe=$e[0],Ge=$e[1],Je=(0,i.useState)(""),Ye=Je[0],Qe=Je[1],qe=(0,i.useState)(!1),et=qe[0],tt=qe[1],nt=(0,i.useState)(""),ot=nt[0],lt=nt[1],at=(0,i.useState)(""),it=at[0],st=at[1],dt=(0,i.useState)(""),rt=(dt[0],dt[1],(0,i.useState)("")),ct=(rt[0],rt[1],(0,i.useState)("")),ut=ct[0],vt=ct[1],ht=(0,i.useState)(""),ft=ht[0],pt=ht[1],xt=(0,i.useState)(""),mt=(xt[0],xt[1],(0,i.useState)("")),yt=(mt[0],mt[1],(0,i.useState)("")),bt=yt[0],kt=yt[1],gt=(0,i.useState)(""),jt=gt[0],Nt=gt[1],wt=(0,i.useState)(""),St=(wt[0],wt[1],(0,i.useState)("")),Tt=(St[0],St[1],(0,i.useState)("")),Mt=Tt[0],Ct=Tt[1],Ft=(0,i.useState)(""),Wt=Ft[0],Bt=Ft[1],At=(0,i.useState)(""),It=(At[0],At[1],(0,i.useState)("")),Dt=(It[0],It[1],(0,i.useState)("")),Ut=Dt[0],Ot=Dt[1],_t=(0,i.useState)(""),Et=_t[0],Vt=_t[1],Rt=(0,i.useState)(""),zt=(Rt[0],Rt[1],(0,i.useState)("")),Lt=(zt[0],zt[1],(0,i.useState)("")),Kt=Lt[0],Zt=Lt[1],Pt=(0,i.useState)(""),Ht=Pt[0],$t=Pt[1],Xt=(0,i.useState)(""),Gt=(Xt[0],Xt[1],(0,i.useState)("")),Jt=(Gt[0],Gt[1],(0,i.useState)("")),Yt=Jt[0],Qt=Jt[1],qt=(0,i.useState)(""),en=qt[0],tn=qt[1],nn=(0,i.useState)(""),on=(nn[0],nn[1],(0,i.useState)("")),ln=(on[0],on[1],(0,i.useState)("")),an=ln[0],sn=ln[1],dn=(0,i.useState)(""),rn=dn[0],cn=dn[1],un=(0,i.useState)(""),vn=(un[0],un[1],(0,i.useState)("")),hn=(vn[0],vn[1],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor1stMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor2ndMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor3rdMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor4thMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor5thMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor6thMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor7thMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("labelFor8thMean").orderBy("addedOn","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor1stMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor2ndMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor3rdMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor4thMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor5thMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor6thMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor7thMean").orderBy("synonymNo","asc")),1)[0],f((0,r.Kx)(d.h.doc("hokkienWords/".concat(he)).collection("synonymsFor8thMean").orderBy("synonymNo","asc")),1)[0],function(){var e=h(l().mark((function e(){var t,n,o,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia)){e.next=20;break}return e.prev=2,e.next=6,null===navigator||void 0===navigator||null===(n=navigator.mediaDevices)||void 0===n?void 0:n.getUserMedia({audio:!0});case 6:o=e.sent,a=new MediaRecorder(o),Ge(a),a.start(),tt(!0),a.ondataavailable=function(e){He(null===e||void 0===e?void 0:e.data);var t=null===URL||void 0===URL?void 0:URL.createObjectURL(null===e||void 0===e?void 0:e.data);Qe(t)},null===a||void 0===a||(a.onstop=function(){var e;null===(e=null===o||void 0===o?void 0:o.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),alert("Error accessing microphone: ",e.t0);case 18:e.next=21;break;case 20:alert("MediaDevices API not supported on this browser");case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(){return e.apply(this,arguments)}}()),fn=function(){var e=h(l().mark((function e(){var t,n,o,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(He(null),!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia)){e.next=21;break}return e.prev=3,e.next=7,null===navigator||void 0===navigator||null===(n=navigator.mediaDevices)||void 0===n?void 0:n.getUserMedia({audio:!0});case 7:o=e.sent,a=new MediaRecorder(o),Ge(a),a.start(),tt(!0),a.ondataavailable=function(e){He(null===e||void 0===e?void 0:e.data);var t=null===URL||void 0===URL?void 0:URL.createObjectURL(null===e||void 0===e?void 0:e.data);Qe(t)},null===a||void 0===a||(a.onstop=function(){var e;null===(e=null===o||void 0===o?void 0:o.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(3),alert("Error accessing microphone: ",e.t0);case 19:e.next=22;break;case 21:alert("MediaDevices API not supported on this browser");case 22:case"end":return e.stop()}}),e,null,[[3,16]])})));return function(){return e.apply(this,arguments)}}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:" w-full mx-auto bg-sky-500 bg-opacity-10 border-y border-sky-200 rounded-sm flex flex-col items-start ",children:[(0,a.jsx)("header",{className:" w-full flex items-center px-3 py-2 border-b border-sky-100 ",children:(0,a.jsx)("button",{onClick:function(){return be(!0)},className:" rounded-full p-1 text-base text-sky-400 border border-sky-400 focus:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:(0,a.jsx)(s.Z,{className:" h-[20px] "})})}),(0,a.jsxs)("div",{className:" w-full justify-evenly flex items-center px-3 py-2 overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-xl text-sky-400 min-w-[200px] ",children:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[200px] ",children:null===(n=null===xe||void 0===xe?void 0:xe.data())||void 0===n?void 0:n.taiLo}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[200px] ",children:null===(o=null===xe||void 0===xe?void 0:xe.data())||void 0===o?void 0:o.hanzi}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[200px] ",children:null===(u=null===xe||void 0===xe?void 0:xe.data())||void 0===u?void 0:u.lannang}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[200px] ",children:null===(v=null===xe||void 0===xe?void 0:xe.data())||void 0===v?void 0:v.poj}),(null===(p=null===xe||void 0===xe?void 0:xe.data())||void 0===p?void 0:p.pronunciation)&&(0,a.jsx)("audio",{src:null===(x=null===xe||void 0===xe?void 0:xe.data())||void 0===x?void 0:x.pronunciation,controls:!0,className:" min-w-[200px] mx-3 "}),(0,a.jsxs)("span",{className:" min-w-[600px] max-w-[1080px] flex items-center space-x-2 ",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[120px] ",children:null===(m=null===xe||void 0===xe?void 0:xe.data())||void 0===m?void 0:m.type}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-full ",children:null===(y=null===xe||void 0===xe?void 0:xe.data())||void 0===y?void 0:y.meaning})]}),(null===(b=null===xe||void 0===xe?void 0:xe.data())||void 0===b?void 0:b.secondType)&&(0,a.jsxs)("span",{className:" min-w-[600px] max-w-[1080px] flex items-center space-x-2",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[120px] ",children:null===(k=null===xe||void 0===xe?void 0:xe.data())||void 0===k?void 0:k.secondType}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-full ",children:null===(g=null===xe||void 0===xe?void 0:xe.data())||void 0===g?void 0:g.secondMeaning})]}),(null===(j=null===xe||void 0===xe?void 0:xe.data())||void 0===j?void 0:j.thirdType)&&(0,a.jsxs)("span",{className:" min-w-[600px] max-w-[1080px] flex items-center space-x-2 ",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[120px] ",children:null===(N=null===xe||void 0===xe?void 0:xe.data())||void 0===N?void 0:N.thirdType}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-full ",children:null===(w=null===xe||void 0===xe?void 0:xe.data())||void 0===w?void 0:w.thirdMeaning})]}),(null===(S=null===xe||void 0===xe?void 0:xe.data())||void 0===S?void 0:S.fourthType)&&(0,a.jsxs)("span",{className:" min-w-[600px] max-w-[1080px] flex items-center space-x-2 ",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-[120px] ",children:null===(T=null===xe||void 0===xe?void 0:xe.data())||void 0===T?void 0:T.fourthType}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-full ",children:null===(M=null===xe||void 0===xe?void 0:xe.data())||void 0===M?void 0:M.fourthMeaning})]}),(null===(C=null===xe||void 0===xe?void 0:xe.data())||void 0===C?void 0:C.fifthType)&&(0,a.jsxs)("span",{className:" min-w-[600px] max-w-[1080px] flex items-center space-x-2 ",children:[(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 min-w-[120px] ",children:null===(F=null===xe||void 0===xe?void 0:xe.data())||void 0===F?void 0:F.fifthType}),(0,a.jsx)("h1",{className:" font-font-robot font-semibold text-base text-sky-400 w-full ",children:null===(W=null===xe||void 0===xe?void 0:xe.data())||void 0===W?void 0:W.fifthMeaning})]})]})]},null===xe||void 0===xe?void 0:xe.id),ye&&(0,a.jsxs)("div",{className:" h-full w-full z-50 inset-0 fixed overflow-hidden flex items-center bg-slate-800 bg-opacity-95 ",children:[(0,a.jsx)("div",{onClick:function(){return be(!1)},className:" h-full lg:w-[15%] md:w-[5%] w-0 "}),(0,a.jsxs)("div",{className:" h-full lg:w-[70%] md:w-[90%] w-[95%] mx-auto flex flex-col ",children:[(0,a.jsx)("div",{onClick:function(){return be(!1)},className:" h-[2%] w-full "}),(0,a.jsxs)("div",{className:" h-[90%] w-full bg-slate-900 border border-sky-400 rounded ",children:[(0,a.jsxs)("header",{className:" w-full flex flex-col ",children:[(0,a.jsx)("span",{className:" w-full h-[40px] border-b-2 border-sky-400 justify-between flex items-center px-3 ",children:(0,a.jsx)("h3",{className:" font-robot-slab font-bold text-base text-sky-400 ",children:"Edit entry"})}),(0,a.jsxs)("span",{className:" w-full h-[40px] border-b-2 border-sky-400 justify-between flex items-center px-3 ",children:[(0,a.jsx)("button",{onClick:function(){we&&Se(!1),je(!0)},className:" w-[45%] h-[30px] text-lg rounded-md border-x border-sky-400 text-sky-400 hover:border-sky-600 hover:text-sky-600 focus:outline-none focus:border-x-2 focus:border-sky-300 transform transition duration-300 ease-in-out ",children:"First tab"}),(0,a.jsx)("button",{onClick:function(){ge&&je(!1),Se(!0)},className:" w-[45%] h-[30px] text-lg rounded-md border-x border-sky-400 text-sky-400 hover:border-sky-600 hover:text-sky-600 focus:outline-none focus:border-x-2 focus:border-sky-300 transform transition duration-300 ease-in-out ",children:"Second tab"})]})]}),(0,a.jsxs)("div",{className:" h-[90%] w-full flex flex-col items-start overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 px-3 py-2 pb-10 ",children:[we?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"First type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(B=null===xe||void 0===xe?void 0:xe.data())||void 0===B?void 0:B.type}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(A=null===xe||void 0===xe?void 0:xe.data())||void 0===A?void 0:A.meaning})]}),(0,a.jsx)("input",{placeholder:"First meaning type",value:ot,onChange:function(e){return lt(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"First meaning",value:it,onChange:function(e){return st(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),ot?(d.h.collection("hokkienWords").doc(he).set({type:ot,meaning:it},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #1`",firstType:ot,firstMeaning:it,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(ot," & ").concat(it)}),lt(""),st("")):alert("No input/s detected at Type & Meaning, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-sm hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update type & meaning"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Second type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(I=null===xe||void 0===xe?void 0:xe.data())||void 0===I?void 0:I.secondType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(D=null===xe||void 0===xe?void 0:xe.data())||void 0===D?void 0:D.secondMeaning})]}),(0,a.jsx)("input",{placeholder:"Second meaning type",value:ut,onChange:function(e){return vt(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Second meaning",value:ft,onChange:function(e){return pt(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),ut?(d.h.collection("hokkienWords").doc(he).set({secondType:ut,secondMeaning:ft},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #2",secondType:ut,secondMeaning:ft,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #2",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(ut," & ").concat(ft)}),vt(""),pt("")):alert("No input/s detected at Type & Meaning #2, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update type & meanings"})]})]}),ut||(null===(U=null===xe||void 0===xe?void 0:xe.data())||void 0===U?void 0:U.secondType)||(null===(O=null===xe||void 0===xe?void 0:xe.data())||void 0===O?void 0:O.thirdType)&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Third type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(_=null===xe||void 0===xe?void 0:xe.data())||void 0===_?void 0:_.thirdType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(E=null===xe||void 0===xe?void 0:xe.data())||void 0===E?void 0:E.thirdMeaning})]}),(0,a.jsx)("input",{placeholder:"Third meaning type",value:bt,onChange:function(e){return kt(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Third meaning",value:jt,onChange:function(e){return Nt(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),bt?(d.h.collection("hokkienWords").doc(he).set({thirdType:bt,thirdMeaning:jt},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #3",thirdType:bt,thirdMeaning:jt,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #3",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(bt," & ").concat(jt)}),kt(""),Nt("")):alert("No input/s detected at Type & Meaning #3, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update type & meaning"})]})]}),bt||(null===(V=null===xe||void 0===xe?void 0:xe.data())||void 0===V?void 0:V.thirdType)||(null===(R=null===xe||void 0===xe?void 0:xe.data())||void 0===R?void 0:R.fourthType)&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Fourth type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(z=null===xe||void 0===xe?void 0:xe.data())||void 0===z?void 0:z.fourthType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(L=null===xe||void 0===xe?void 0:xe.data())||void 0===L?void 0:L.fourthMeaning})]}),(0,a.jsx)("input",{placeholder:"Fourth meaning type",value:Mt,onChange:function(e){return Ct(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Fourth meaning",value:Wt,onChange:function(e){return Bt(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Mt?(d.h.collection("hokkienWords").doc(he).set({fourthType:Mt,fourthMeaning:Wt},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #4",fourthType:Mt,fourthMeaning:Wt,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #4",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(Mt," & ").concat(Wt)}),Ct(""),Bt("")):alert("No input/s detected at Type & Meaning #4, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update type & meaning"})]})]}),(Mt||(null===(K=null===xe||void 0===xe?void 0:xe.data())||void 0===K?void 0:K.fourthType)||(null===(Z=null===xe||void 0===xe?void 0:xe.data())||void 0===Z?void 0:Z.fifthType))&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Fifth type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(P=null===xe||void 0===xe?void 0:xe.data())||void 0===P?void 0:P.fifthType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(H=null===xe||void 0===xe?void 0:xe.data())||void 0===H?void 0:H.fifthMeaning})]}),(0,a.jsx)("input",{placeholder:"Fifth meaning type",value:Ut,onChange:function(e){return Ot(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Fifth meaning",value:Et,onChange:function(e){return Vt(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Ut?(d.h.collection("hokkienWords").doc(he).set({fifthType:Ut,fifthMeaning:Et},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #5",fifthType:Ut,fifthMeaning:Et,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #5",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(Ut," & ").concat(Et)}),Ot(""),Vt("")):alert("No input/s detected at Type & Meaning #5, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(Ut||(null===($=null===xe||void 0===xe?void 0:xe.data())||void 0===$?void 0:$.fifthType)||(null===(X=null===xe||void 0===xe?void 0:xe.data())||void 0===X?void 0:X.sixthType))&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Sixth type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(G=null===xe||void 0===xe?void 0:xe.data())||void 0===G?void 0:G.sixthType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(J=null===xe||void 0===xe?void 0:xe.data())||void 0===J?void 0:J.sixthMeaning})]}),(0,a.jsx)("input",{placeholder:"Sixth meaning type",value:Kt,onChange:function(e){return Zt(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Sixth meaning",value:Ht,onChange:function(e){return $t(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Kt?(d.h.collection("hokkienWords").doc(he).set({sixthType:Kt,sixthMeaning:Ht},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #6",sixthType:Kt,sixthMeaning:Ht,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #6",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(Kt," & ").concat(Ht)}),Zt(""),$t("")):alert("No input/s detected at Type & Meaning #6, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(Kt||(null===(Y=null===xe||void 0===xe?void 0:xe.data())||void 0===Y?void 0:Y.sixthType)||(null===(Q=null===xe||void 0===xe?void 0:xe.data())||void 0===Q?void 0:Q.seventhType))&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Seventh type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(q=null===xe||void 0===xe?void 0:xe.data())||void 0===q?void 0:q.seventhType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(ee=null===xe||void 0===xe?void 0:xe.data())||void 0===ee?void 0:ee.seventhMeaning})]}),(0,a.jsx)("input",{placeholder:"Seventh meaning type",value:Yt,onChange:function(e){return Qt(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Seventh meaning",value:en,onChange:function(e){return tn(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Yt?(d.h.collection("hokkienWords").doc(he).set({seventhType:Yt,seventhMeaning:en},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #7",seventhType:Yt,seventhMeaning:en,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #7",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(Yt," & ").concat(en)}),Qt(""),tn("")):alert("No input/s detected at Type & Meaning #7, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(Yt||(null===(te=null===xe||void 0===xe?void 0:xe.data())||void 0===te?void 0:te.seventhType)||(null===(ne=null===xe||void 0===xe?void 0:xe.data())||void 0===ne?void 0:ne.eighthType))&&(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-2 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Eighth type & meaning"}),(0,a.jsxs)("span",{className:" w-[80%] flex flex-col items-start ",children:[(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:null===(oe=null===xe||void 0===xe?void 0:xe.data())||void 0===oe?void 0:oe.eighthType}),(0,a.jsx)("h3",{className:" font-robot-slab font-semibold text-sm text-sky-600 ",children:null===(le=null===xe||void 0===xe?void 0:xe.data())||void 0===le?void 0:le.eighthMeaning})]}),(0,a.jsx)("input",{placeholder:"Eighth meaning type",value:an,onChange:function(e){return sn(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsx)("textarea",{placeholder:"Eighth meaning",value:rn,onChange:function(e){return cn(e.target.value)},type:"text",className:" w-[95%] h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),an?(d.h.collection("hokkienWords").doc(he).set({eighthType:an,eighthMeaning:rn},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Type & meaning #8",eighthType:an,eighthMeaning:rn,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),d.h.collection("hokkienWords").doc(he).collection("editorUpdates").add({updated:"meaning & type #8",updatedBy:null===fe||void 0===fe?void 0:fe.displayName,updatedOn:date,updateText:"".concat(an," & ").concat(rn)}),Zt(""),$t("")):alert("No input/s detected at Type & Meaning #6, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]})]}):(0,a.jsx)(a.Fragment,{}),ge?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Hokkien:"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(ae=null===xe||void 0===xe?void 0:xe.data())||void 0===ae?void 0:ae.hokkien})]}),(0,a.jsx)("input",{placeholder:"Hokkien",value:Me,onChange:function(e){return Ce(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 "}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Me?(d.h.collection("hokkienWords").doc(he).set({hokkien:Me},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).collection("updates").add({updated:"Hokkien",valueOfUpdate:Me,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),Ce("")):alert("No input/s detected at Hokkien, ".concat(null===fe||void 0===fe?void 0:fe.displayName,"!! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Variant/s:"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(ie=null===xe||void 0===xe?void 0:xe.data())||void 0===ie?void 0:ie.variants})]}),(0,a.jsx)("input",{placeholder:"Variant/s",value:We,onChange:function(e){return Be(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),We?(d.h.collection("hokkienWords").doc(he).set({variants:We},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).collection("updates").add({updated:"Variant/s",valueOfUpdate:We,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),Be("")):alert("No input/s detected at Variants, ".concat(null===fe||void 0===fe?void 0:fe.displayName,"!! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Tai-lo (#):"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(se=null===xe||void 0===xe?void 0:xe.data())||void 0===se?void 0:se.taiLo})]}),(0,a.jsx)("input",{placeholder:"Tai-lo (#)",value:Le,onChange:function(e){return Ke(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Le?(d.h.collection("hokkienWords").doc(he).set({taiLo:Le},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).collection("updates").add({updated:"Tai-lo (#)",valueOfUpdate:Le,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),Be("")):alert("No input/s detected at Variants, ".concat(null===fe||void 0===fe?void 0:fe.displayName,"!! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Hanzi:"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(de=null===xe||void 0===xe?void 0:xe.data())||void 0===de?void 0:de.hanzi})]}),(0,a.jsx)("input",{placeholder:"Hanzi",value:Ie,onChange:function(e){return De(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Ie?(d.h.collection("hokkienWords").doc(he).set({hanzi:Ie},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).collection("updates").add({updated:"Hanzi",valueOfUpdate:Ie,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})),De("")):alert("No input/s detected at Hanzi, ".concat(null===fe||void 0===fe?void 0:fe.displayName,"!! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Lannang"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(re=null===xe||void 0===xe?void 0:xe.data())||void 0===re?void 0:re.lannang})]}),(0,a.jsx)("input",{placeholder:"Lannang",value:Oe,onChange:function(e){return _e(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Oe?d.h.collection("hokkienWords").doc(he).set({lannang:Oe},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"Lannang",valueOfUpdate:Oe,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})):alert("No input/s detected at Lannang, ".concat(null===fe||void 0===fe?void 0:fe.displayName,"!! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"POJ"}),(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-500 ",children:null===(ce=null===xe||void 0===xe?void 0:xe.data())||void 0===ce?void 0:ce.poj})]}),(0,a.jsx)("input",{placeholder:"POJ",value:Ve,onChange:function(e){return Re(e.target.value)},type:"text",className:" w-[95%] mx-auto border outline-none border-sky-400 font-robot-slab font-semibold text-base text-sky-400 bg-transparent rounded-md px-3 py-2"}),(0,a.jsxs)("span",{className:" w-full justify-between px-3 flex items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(0,a.jsx)("button",{onClick:function(e){e.preventDefault(),Ve?d.h.collection("hokkienWords").doc(he).set({poj:Ve},{merge:!0}).then((function(e){var t;d.h.collection("wordsByUser").doc(null===fe||void 0===fe?void 0:fe.displayName).add({updated:"POJ",valueOfUpdate:Ve,updatedWord:null===(t=null===xe||void 0===xe?void 0:xe.data())||void 0===t?void 0:t.hokkien})})):alert("No input/s detected at POJ, ".concat(null===fe||void 0===fe?void 0:fe.displayName," !! Please check again"))},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]}),(0,a.jsxs)("span",{className:" w-full flex-col items-start space-y-1 ",children:[(0,a.jsx)("h1",{className:" font-robot-slab font-semibold lg:text-xl md:text-lg text-sky-400 ",children:"Pronunciation"}),(0,a.jsxs)("span",{className:" w-full px-3 flex flex-col space-y-2 items-center ",children:[(0,a.jsx)("span",{className:" w-[45%] "}),(null===(ue=null===xe||void 0===xe?void 0:xe.data())||void 0===ue?void 0:ue.pronunciation)?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("audio",{src:null===(ve=null===xe||void 0===xe?void 0:xe.data())||void 0===ve?void 0:ve.pronunciation,controls:!0,className:" w-[65%] mx-auto h-[50px] border-sky-400 border px-3 py-2 rounded "})}):Ye&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("audio",{src:Ye,controls:!0,className:" w-[65%] mx-auto h-[50px] border-red-400 border px-3 py-2 rounded "})}),et&&(0,a.jsxs)("span",{className:" flex items-center text-lg text-red-500 font-robot-slab font-normal ",children:[(0,a.jsx)("span",{className:" w-[10px] h-[10px] bg-red-500 rounded-lg animate-pulse "}),"Recording"]}),(0,a.jsxs)("span",{className:" flex items-center space-x-4 w-[50%] mx-auto ",children:[Pe||Ye?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("button",{onClick:fn,disabled:et,className:" border border-sky-400 font-robot-slab font-normal text-sky-400 rounded-base px-3 py-2 ",children:"Re-record"})}):(!Pe||!Ye)&&(0,a.jsx)("button",{onClick:hn,disabled:et,className:" border border-sky-400 font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Start recording"}),Pe&&Ye?(Pe||Ye)&&(0,a.jsx)("button",{onClick:function(){Pe&&He(null),Ye&&Qe("")},disabled:et,className:" border border-red-400 font-robot-slab font-normal text-red-400 px-3 py-2 ",children:"Delete"}):(0,a.jsx)("button",{onClick:function(){Xe&&(null===Xe||void 0===Xe||Xe.stop(),tt(!1))},disabled:!et,className:" border border-red-400 font-robot-slab font-normal text-red-400 px-3 py-2 ",children:"Stop recording"})]})]}),(0,a.jsxs)("span",{className:" w-full flex items-center justify-between ",children:[(0,a.jsx)("span",{className:"w-[45%]"}),(0,a.jsx)("button",{disabled:!Ye||!Pe,onClick:function(){if(Pe)try{var e,t=d.tO.ref("/hokkienWords/".concat(null===xe||void 0===xe?void 0:xe.id,"/").concat(null===(e=null===xe||void 0===xe?void 0:xe.data())||void 0===e?void 0:e.hokkien,".webm"));t.put(Pe).then((function(){return null===t||void 0===t?void 0:t.getDownloadURL()})).then((function(e){var t,n=null===(t=d.h.collection("hokkienWords"))||void 0===t?void 0:t.doc(null===xe||void 0===xe?void 0:xe.id);return null===n||void 0===n?void 0:n.set({pronunciation:e},{merge:!0})}))}catch(n){alert("Error in uploading audio: ",n)}Pe&&He(null),Ye&&Qe("")},className:" w-[45%] rounded-md border border-sky-400 font-robot-slab font-semibold text-sky-400 text-base hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})]})]})]}):(0,a.jsx)(a.Fragment,{})]})]}),(0,a.jsx)("div",{onClick:function(){return be(!1)},className:" h-[2%] w-full "})]}),(0,a.jsx)("div",{onClick:function(){return be(!1)},className:" h-full lg:w-[15%] md:w-[5%] w-0 "})]})]})}},7401:function(e,t,n){var o=n(5893),l=(n(7294),n(6677)),a=n(3349),i=n(541);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(e){var t=e.docId,n=e.mainDocReturn,s=(d((0,a.F_)(i.fV),1)[0],d((0,l.ky)(i.h.collection("hokkienWords").doc(t)),3)),r=s[0];return s[1],s[2],(0,o.jsxs)("div",{className:" h-[120px] w-[85%] mx-auto rounded-md flex flex-col bg-slate-800 border border-sky-400 hover:border-sky-600 hover:bg-slate-700 transform transition duration-300 ease-in-out group ",children:[(0,o.jsx)("div",{className:" h-[85%] w-full flex flex-col items-start px-3 ",children:(0,o.jsx)("h1",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:n})}),(0,o.jsx)("footer",{className:" h-[15%] w-full border-t border-sky-400 px-3 py-1 "})]},null===r||void 0===r?void 0:r.id)}},919:function(e,t,n){var o=n(5893),l=n(7294),a=n(1346),i=n(541),s=n(3349),d=n(1163);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(){var e=(0,d.useRouter)(),t=(0,l.useState)(!1),n=t[0],r=t[1],u=(0,l.useState)(!1),v=u[0],h=u[1],f=c((0,s.F_)(i.fV),1)[0],p=function(){i.fV.signInWithPopup(i.Ap).catch(alert),r(!1)};return(0,l.useEffect)((function(){f&&i.h.collection("users").doc(f.uid).set({email:f.email,displayName:f.displayName,photoURL:f.photoURL})}),[f]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("header",{className:" top-0 bg-gray-800 z-50 sticky flex items-center justify-evenly px-8 py-4 rounded-b-lg shadow-lg shadow-slate-700 ",children:[(0,o.jsx)(a.zx,{onClick:function(){return e.push("/")},color:"lightBlue",buttonType:"link",size:"regular",iconOnly:!0,block:!1,rounded:!1,ripple:"link",className:" space-x-4 hover:underline hover:animate-pulse duration-300 transform transition ease-in-out",children:(0,o.jsx)(a.JO,{name:"arrow_back_ios"})}),(0,o.jsx)("h1",{className:" font-semibold font-robot-condensed text-lg text-slate-100 underline ",children:"Search page"}),(0,o.jsx)("div",{className:"flex items-center space-x-5",children:f?(0,o.jsx)(a.zx,{onClick:function(e){return h(!0)},color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:(0,o.jsx)("img",{src:null===f||void 0===f?void 0:f.photoURL,alt:"",className:" h-10 w-10 rounded-3xl border border-blue-400"})}):(0,o.jsxs)(a.zx,{onClick:p,color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:[(0,o.jsx)(a.JO,{name:"people"}),(0,o.jsx)("h2",{className:"routerNames",children:"Sign in"})]})})]}),(0,o.jsxs)(a.u_,{active:n,size:"regular",toggler:function(){return r(!1)},children:[(0,o.jsx)(a.xB,{toggler:function(){return r(!1)},children:(0,o.jsx)("p",{className:"font-google-sans capitalize text-2xl",children:"Sign in"})}),(0,o.jsx)(a.fe,{children:(0,o.jsxs)("div",{className:" grid place-items-center space-y-4 p-16",children:[(0,o.jsxs)(a.zx,{onClick:p,color:"blue",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"flex items-center space-x-3",children:[(0,o.jsx)(a.l$,{}),(0,o.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"Google"})]}),(0,o.jsxs)(a.zx,{color:"blueGray",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",children:[(0,o.jsx)(a.PT,{}),(0,o.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"GitHub"})]})]})}),(0,o.jsx)(a.mz,{children:(0,o.jsx)(a.zx,{onClick:function(e){return r(!1)},color:"red",size:"regular",buttonType:"link",ripple:"dark",className:"capitalize",children:"Close"})})]}),(0,o.jsxs)(a.u_,{active:v,size:"regular",toggler:function(){return h(!1)},children:[(0,o.jsx)(a.fe,{children:(0,o.jsxs)("div",{className:" grid place-items-center space-y-5 p-16 ",children:[(0,o.jsx)("img",{src:null===f||void 0===f?void 0:f.photoURL,alt:"",className:" h-20 w-20 rounded-3xl border border-blue-400 "}),(0,o.jsx)("h2",{className:" text-xl font-robot-slab font-semibold text-blue-400",children:null===f||void 0===f?void 0:f.displayName}),(0,o.jsx)("p",{className:" text-lg font-google-sans font-light text-blue-400",children:null===f||void 0===f?void 0:f.email})]})}),(0,o.jsxs)(a.mz,{children:[(0,o.jsx)(a.zx,{onClick:function(e){e.preventDefault(),i.fV.signOut(),r(!1)},color:"green",buttonType:"link",size:"regular",ripple:"dark",className:"capitalize",children:"Log out"}),(0,o.jsx)(a.zx,{onClick:function(e){return h(!1)},color:"red",buttonType:"link",size:"regular",ripple:"dark",className:"capitalize",children:"Close"})]})]})]})}},1346:function(e,t,n){n.d(t,{Es:function(){return Ue},s8:function(){return x.eT8},Ei:function(){return Sn},h8:function(){return st},zz:function(){return Bn},AM:function(){return Cn},Cj:function(){return tt},zx:function(){return s.Z},YA:function(){return fn},pJ:function(){return p.YK6},G9:function(){return ce},pL:function(){return y.NWQ},Lt:function(){return r.Z},mw:function(){return qt},K3:function(){return Rn},XU:function(){return _n},tp:function(){return Dn},$:function(){return Jt},Py:function(){return Re},dY:function(){return p.dEB},Ep:function(){return Zn},l$:function(){return c.Z},PT:function(){return u.Z},Ej:function(){return Et},bo:function(){return Nt},aV:function(){return v.qAs},JO:function(){return d.Z},$h:function(){return Qe},C1:function(){return gn},cb:function(){return Ke},kt:function(){return Ut},yS:function(){return Tt},cC:function(){return P},_t:function(){return mn},KD:function(){return kn},u_:function(){return o.Z},fe:function(){return a.Z},mz:function(){return i.Z},xB:function(){return l.Z},bE:function(){return ct},VA:function(){return $t},o1:function(){return dn},pA:function(){return fe},wT:function(){return zt},Xu:function(){return Ft},Xm:function(){return h.bBz},EO:function(){return me},IT:function(){return ke},UV:function(){return y.Z1Y},PB:function(){return jn},Lf:function(){return ae},b1:function(){return Kn},ew:function(){return m.BNm},OO:function(){return xt},t0:function(){return ht},XH:function(){return f.GH},BN:function(){return un},MX:function(){return Ne}});var o=n(806),l=n(6656),a=n(7381),i=n(6779),s=n(6596),d=n(6369),r=(n(586),n(905)),c=(n(2476),n(4569),n(9535)),u=n(5449),v=(n(480),n(7735)),h=n(471),f=n(7516),p=n(8193),x=n(9352),m=n(6653),y=n(9583),b=n(5893),k=n(7294),g=n(541),j=n(3349),N=n(1163),w=n(381),S=n.n(w);var T=function(e){var t,n,o,l=e.snapshot;return(0,b.jsxs)("div",{className:" min-w-[85%] h-[210px] bg-sky-900 flex flex-col rounded ",children:[(0,b.jsxs)("span",{className:" w-full px-3 py-1 flex items-center justify-between ",children:[(0,b.jsxs)("h1",{className:" font-fira-sans font-semibold text-base text-sky-400 ",children:["Added by: ",null===(t=null===l||void 0===l?void 0:l.data())||void 0===t?void 0:t.feedbackBy," "]}),(0,b.jsxs)("h1",{className:" font-fira-sans font-normal text-sm text-sky-200 ",children:["Added on: ",S()(null===(n=null===l||void 0===l?void 0:l.data())||void 0===n?void 0:n.addedOn).format("MMM Do YY")," "]})]}),(0,b.jsx)("span",{className:" font-fira-sans font-semibold text-lg text-sky-100 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 h-full w-full ",children:null===(o=null===l||void 0===l?void 0:l.data())||void 0===o?void 0:o.feedback})]},null===l||void 0===l?void 0:l.id)},M=n(6677);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W=function(e){var t,n,o,l=e.docId,a=(new Date).toLocaleDateString(),i=F((0,j.F_)(g.fV),1)[0],s=F((0,M.ky)(g.h.collection("users").doc(l)),3),d=s[0];return s[1],s[2],(0,b.jsxs)("div",{className:" w-[90%] h-[240px] mx-auto px-4 py-3 rounded-md bg-slate-800 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out group flex items-center justify-between ",children:[(0,b.jsx)("span",{className:" w-[25%] lg:flex lg:items-center hidden ",children:(0,b.jsx)("img",{src:null===(t=null===d||void 0===d?void 0:d.data())||void 0===t?void 0:t.photoURL,alt:"",className:" rounded-full px-3 py-1 border border-sky-400 h-[100px] "})}),(0,b.jsx)("span",{className:" lg:flex lg:items-center lg:w-[50%] w-[80%] mx-auto hidden ",children:(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-lg text-sky-400 group-hover:text-sky-600 transform transition duration-300 ease-in-out ",children:null===(n=null===d||void 0===d?void 0:d.data())||void 0===n?void 0:n.displayName})}),(0,b.jsxs)("span",{className:" lg:w-[25%] w-[40%] flex flex-col items-center space-y-1 ",children:[(0,b.jsx)("h3",{className:" font-robot-slab font-bold text-sm text-sky-400 group-hover:text-sky-600 transform transition duration-300 ease-in-out overflow-x-scroll scrollbar-hide w-[80%] ",children:null===(o=null===d||void 0===d?void 0:d.data())||void 0===o?void 0:o.email}),("rumlowb@gmail.com"==(null===i||void 0===i?void 0:i.email)||"reaperiff697@gmail.com"==(null===i||void 0===i?void 0:i.email)||"sygrandkaiser@gmail.com"==(null===i||void 0===i?void 0:i.email)||"marvin_sy@dlsu.edu.ph"==(null===i||void 0===i?void 0:i.email))&&(0,b.jsxs)("span",{className:" w-full flex items-center space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){var e,t,n;g.h.collection("editors").add({editorEmail:null===(e=null===d||void 0===d?void 0:d.data())||void 0===e?void 0:e.email,editorName:null===(t=null===d||void 0===d?void 0:d.data())||void 0===t?void 0:t.displayName,editorPic:null===(n=null===d||void 0===d?void 0:d.data())||void 0===n?void 0:n.photoURL,addedBy:null===i||void 0===i?void 0:i.displayName,addedOn:a})},className:" w-[85%] mx-auto h-[55px] font-robot-slab font-semibold focus:outline-none rounded-md bg-sky-800 text-sky-400 border border-sky-400 hover:bg-slate-900 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Add to editors"}),(0,b.jsx)("button",{onClick:function(){g.h.collection("users").doc(null===d||void 0===d?void 0:d.id).delete()},className:" w-[85%] mx-auto h-[55px] font-robot-slab font-semibold focus:outline-none rounded-md bg-red-500 text-sky-50 hover:bg-red-600 hover:text-slate-100 transform transition duration-300 ease-in-out ",children:"Delete"})]})]})]})};function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var I=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,k,N,w,S,T,C,F,W,B,I,D,U,O,_,E,V,R,z=e.userName,L=e.docId,K=(A((0,j.F_)(g.fV),1)[0],A((0,M.ky)(g.h.collection("wordsByUser").doc(z).collection("inputs").doc(L)),3)),Z=K[0];return K[1],K[2],(0,b.jsxs)("div",{className:" w-[95%] mx-auto bg-inherit border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out flex flex-col items-center rounded-md ",children:[(0,b.jsxs)("span",{className:" flex items-center justify-between w-[90%] mx-auto font-robot-slab ",children:[(0,b.jsx)("h1",{className:" font-semibold text-xl text-sky-400 ",children:null===(t=null===Z||void 0===Z?void 0:Z.data())||void 0===t?void 0:t.hokkien}),(0,b.jsx)("h1",{className:" font-bold text-lg text-sky-400 ",children:null===(n=null===Z||void 0===Z?void 0:Z.data())||void 0===n?void 0:n.hanzi})]}),(0,b.jsxs)("span",{className:" flex items-center justify-evenly w-[90%] mx-auto font-robot-slab ",children:[(0,b.jsx)("h1",{className:" font-semibold text-base text-sky-400 ",children:null===(o=null===Z||void 0===Z?void 0:Z.data())||void 0===o?void 0:o.taiLo}),(0,b.jsx)("h1",{className:" font-semibold text-base text-sky-400 ",children:null===(l=null===Z||void 0===Z?void 0:Z.data())||void 0===l?void 0:l.poj}),(0,b.jsx)("h1",{className:" font-bold text-base text-sky-400 ",children:null===(a=null===Z||void 0===Z?void 0:Z.data())||void 0===a?void 0:a.lannang})]}),(0,b.jsxs)("span",{className:" bg-slate-900 rounded-md px-3 py-2 w-full h-[100px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-600 mx-auto flex flex-col space-y-3 ",children:[(null===(i=null===Z||void 0===Z?void 0:Z.data())||void 0===i?void 0:i.type)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(s=null===Z||void 0===Z?void 0:Z.data())||void 0===s?void 0:s.type}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(d=null===Z||void 0===Z?void 0:Z.data())||void 0===d?void 0:d.meaning})]}),(null===(r=null===Z||void 0===Z?void 0:Z.data())||void 0===r?void 0:r.secondType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(c=null===Z||void 0===Z?void 0:Z.data())||void 0===c?void 0:c.secondType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(u=null===Z||void 0===Z?void 0:Z.data())||void 0===u?void 0:u.secondMeaning})]}),(null===(v=null===Z||void 0===Z?void 0:Z.data())||void 0===v?void 0:v.thirdType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(h=null===Z||void 0===Z?void 0:Z.data())||void 0===h?void 0:h.thirdType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(f=null===Z||void 0===Z?void 0:Z.data())||void 0===f?void 0:f.thirdMeaning})]}),(null===(p=null===Z||void 0===Z?void 0:Z.data())||void 0===p?void 0:p.fourthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(x=null===Z||void 0===Z?void 0:Z.data())||void 0===x?void 0:x.fourthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(m=null===Z||void 0===Z?void 0:Z.data())||void 0===m?void 0:m.fourthMeaning})]}),(null===(y=null===Z||void 0===Z?void 0:Z.data())||void 0===y?void 0:y.fifthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(k=null===Z||void 0===Z?void 0:Z.data())||void 0===k?void 0:k.fifthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(N=null===Z||void 0===Z?void 0:Z.data())||void 0===N?void 0:N.fifthMeaning})]}),(null===(w=null===Z||void 0===Z?void 0:Z.data())||void 0===w?void 0:w.sixthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(S=null===Z||void 0===Z?void 0:Z.data())||void 0===S?void 0:S.sixthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(T=null===Z||void 0===Z?void 0:Z.data())||void 0===T?void 0:T.sixthMeaning})]}),(null===(C=null===Z||void 0===Z?void 0:Z.data())||void 0===C?void 0:C.seventhType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(F=null===Z||void 0===Z?void 0:Z.data())||void 0===F?void 0:F.seventhType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(W=null===Z||void 0===Z?void 0:Z.data())||void 0===W?void 0:W.seventhMeaning})]}),(null===(B=null===Z||void 0===Z?void 0:Z.data())||void 0===B?void 0:B.eighthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(I=null===Z||void 0===Z?void 0:Z.data())||void 0===I?void 0:I.eighthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(D=null===Z||void 0===Z?void 0:Z.data())||void 0===D?void 0:D.eighthMeaning})]}),(null===(U=null===Z||void 0===Z?void 0:Z.data())||void 0===U?void 0:U.ninthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(O=null===Z||void 0===Z?void 0:Z.data())||void 0===O?void 0:O.ninthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(_=null===Z||void 0===Z?void 0:Z.data())||void 0===_?void 0:_.ninthMeaning})]}),(null===(E=null===Z||void 0===Z?void 0:Z.data())||void 0===E?void 0:E.tenthType)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-500 text-base ",children:null===(V=null===Z||void 0===Z?void 0:Z.data())||void 0===V?void 0:V.tenthType}),(0,b.jsx)("p",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(R=null===Z||void 0===Z?void 0:Z.data())||void 0===R?void 0:R.tenthMeaning})]})]})]},null===Z||void 0===Z?void 0:Z.id)};function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(e){var t=e.userName,n=(0,k.useState)(null),o=n[0],l=n[1],a=(0,k.useState)(null),i=a[0],s=a[1],d=(0,k.useState)([]),r=d[0],c=d[1],u=g.h.collection("wordsByUser").doc(t).collection("inputs").orderBy("hokkien","asc").limit(10),v=U((0,M.Kx)(u),1)[0];return(0,k.useEffect)((function(){if(v&&(null===v||void 0===v?void 0:v.docs.length)>0){var e=null===v||void 0===v?void 0:v.docs;c(e),s(e[0]),l(e[(null===e||void 0===e?void 0:e.length)-1])}}),[v]),(0,b.jsxs)("div",{className:" h-[90%] py-3 w-full bg-sky-800 bg-opacity-25 rounded-md flex flex-col ",children:[(0,b.jsx)("div",{className:" h-[90%] w-full flex flex-col space-y-7 overflow-y-scroll scrollbar-default scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:null===r||void 0===r?void 0:r.map((function(e){return(0,b.jsx)(I,{userName:t,docId:null===e||void 0===e?void 0:e.id})}))}),(0,b.jsxs)("span",{className:" w-[85%] h-[10%] flex items-center mx-auto space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){g.h.collection("wordsByUser").doc(t).collection("inputs").orderBy("hokkien","asc").endBefore(i).limitToLast(10).get().then((function(e){if((null===e||void 0===e?void 0:e.docs.length)>0){var t=null===e||void 0===e?void 0:e.docs;c(t),s(t[0]),l(t[(null===t||void 0===t?void 0:t.length)-1])}}))},disabled:!i,className:" w-[80%] h-[60px] focus:outline-none bg-slate-900 rounded-md font-robot-slab font-semibold text-lg text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Back"}),(0,b.jsx)("button",{onClick:function(){g.h.collection("wordsByUser").doc(t).collection("inputs").orderBy("hokkien","asc").startAfter(o).limit(10).get().then((function(e){if((null===e||void 0===e?void 0:e.docs.length)>0){var t=null===e||void 0===e?void 0:e.docs;c(t),s(t[0]),l(t[(null===t||void 0===t?void 0:t.length)-1])}}))},disabled:!o,className:" w-[80%] h-[60px] focus:outline-none bg-slate-900 rounded-md font-robot-slab font-semibold text-lg text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Next"})]})]})};function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var V=function(e){var t=e.userName,n=(0,k.useState)(null),o=n[0],l=n[1],a=(0,k.useState)(null),i=a[0],s=a[1],d=(0,k.useState)([]),r=d[0],c=d[1],u=g.h.collection("wordsByUser").doc(t).collection("updates").orderBy("updated","asc").limit(10),v=E((0,M.Kx)(u),1)[0];return(0,k.useEffect)((function(){if(v&&(null===v||void 0===v?void 0:v.docs.length)>0){var e=null===v||void 0===v?void 0:v.docs;c(e),s(e[0]),l(e[(null===e||void 0===e?void 0:e.length)-1])}}),[v]),(0,b.jsx)("div",{className:" h-[90%] py-3 w-full bg-sky-800 bg-opacity-25 rounded-md flex flex-col ",children:(0,b.jsxs)("div",{className:" h-[90%] rounded-md w-full flex flex-col space-y-7 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[null===r||void 0===r?void 0:r.map((function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,k,g,j,N,w,S,T,M,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P;return(0,b.jsxs)("div",{className:" min-h-[180px] w-[85%] mx-auto rounded-md bg-slate-900 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:[(0,b.jsx)("header",{className:" h-[40px] w-full flex items-center px-3 py-2 border-b border-sky-400 ",children:(0,b.jsxs)("h3",{className:" font-robot-slab font-semibold text-lg text-sky-400 ",children:[null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.updatedWord," - update/s"]})}),(0,b.jsx)("div",{className:" w-full h-[90%] flex flex-col space-y-2 px-3 py-2 ",children:(0,b.jsx)("div",{className:" h-[98%] px-3 py-2 w-full rounded-md bg-sky-900 bg-opacity-30 mx-auto scrollbar-hide ",children:(0,b.jsxs)("span",{className:" flex flex-col px-3 space-y-2 items-start w-full h-full rounded-md ",children:[(null===(n=null===e||void 0===e?void 0:e.data())||void 0===n?void 0:n.updated)&&(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsxs)("h2",{className:" font-robot-slab font-semibold text-base text-sky-400 rounded-md ",children:["Updated: ",null===(o=null===e||void 0===e?void 0:e.data())||void 0===o?void 0:o.updated]}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(l=null===e||void 0===e?void 0:e.data())||void 0===l?void 0:l.valueOfUpdate})]}),((null===(a=null===e||void 0===e?void 0:e.data())||void 0===a?void 0:a.firstType)||(null===(i=null===e||void 0===e?void 0:e.data())||void 0===i?void 0:i.secondType)||(null===(s=null===e||void 0===e?void 0:e.data())||void 0===s?void 0:s.thirdType)||(null===(d=null===e||void 0===e?void 0:e.data())||void 0===d?void 0:d.fourthType)||(null===(r=null===e||void 0===e?void 0:e.data())||void 0===r?void 0:r.fifthType)||(null===(c=null===e||void 0===e?void 0:e.data())||void 0===c?void 0:c.sixthType)||(null===(u=null===e||void 0===e?void 0:e.data())||void 0===u?void 0:u.seventhType)||(null===(v=null===e||void 0===e?void 0:e.data())||void 0===v?void 0:v.eighthType)||(null===(h=null===e||void 0===e?void 0:e.data())||void 0===h?void 0:h.firstSynonym)||(null===(f=null===e||void 0===e?void 0:e.data())||void 0===f?void 0:f.secondSynonym)||(null===(p=null===e||void 0===e?void 0:e.data())||void 0===p?void 0:p.thirdSynonym)||(null===(x=null===e||void 0===e?void 0:e.data())||void 0===x?void 0:x.fourthSynonym)||(null===(m=null===e||void 0===e?void 0:e.data())||void 0===m?void 0:m.fifthSynonym)||(null===(y=null===e||void 0===e?void 0:e.data())||void 0===y?void 0:y.sixthSynonym)||(null===(k=null===e||void 0===e?void 0:e.data())||void 0===k?void 0:k.seventhSynonym)||(null===(g=null===e||void 0===e?void 0:e.data())||void 0===g?void 0:g.eighthSynonym))&&(0,b.jsxs)("div",{className:" w-full h-[80%] overflow-y-scroll scrollbar-hide ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(j=null===e||void 0===e?void 0:e.data())||void 0===j?void 0:j.firstSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(N=null===e||void 0===e?void 0:e.data())||void 0===N?void 0:N.secondSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(w=null===e||void 0===e?void 0:e.data())||void 0===w?void 0:w.thirdSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(S=null===e||void 0===e?void 0:e.data())||void 0===S?void 0:S.fourthSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(T=null===e||void 0===e?void 0:e.data())||void 0===T?void 0:T.fifthSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(M=null===e||void 0===e?void 0:e.data())||void 0===M?void 0:M.sixthSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(C=null===e||void 0===e?void 0:e.data())||void 0===C?void 0:C.seventhSynonym}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(F=null===e||void 0===e?void 0:e.data())||void 0===F?void 0:F.eighthSynonym}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(W=null===e||void 0===e?void 0:e.data())||void 0===W?void 0:W.firstType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(B=null===e||void 0===e?void 0:e.data())||void 0===B?void 0:B.firstMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(A=null===e||void 0===e?void 0:e.data())||void 0===A?void 0:A.secondType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(I=null===e||void 0===e?void 0:e.data())||void 0===I?void 0:I.secondMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(D=null===e||void 0===e?void 0:e.data())||void 0===D?void 0:D.thirdType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(U=null===e||void 0===e?void 0:e.data())||void 0===U?void 0:U.thirdMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(O=null===e||void 0===e?void 0:e.data())||void 0===O?void 0:O.fouthType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(_=null===e||void 0===e?void 0:e.data())||void 0===_?void 0:_.fourthMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(E=null===e||void 0===e?void 0:e.data())||void 0===E?void 0:E.fifthType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(V=null===e||void 0===e?void 0:e.data())||void 0===V?void 0:V.fifthMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(R=null===e||void 0===e?void 0:e.data())||void 0===R?void 0:R.sixthType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(z=null===e||void 0===e?void 0:e.data())||void 0===z?void 0:z.sixthMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(L=null===e||void 0===e?void 0:e.data())||void 0===L?void 0:L.seventhType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(K=null===e||void 0===e?void 0:e.data())||void 0===K?void 0:K.seventhMeaning})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(Z=null===e||void 0===e?void 0:e.data())||void 0===Z?void 0:Z.eighthType}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sm text-sky-600 ",children:null===(P=null===e||void 0===e?void 0:e.data())||void 0===P?void 0:P.eighthMeaning})]})]})]})})})]},null===e||void 0===e?void 0:e.id)})),(0,b.jsxs)("span",{className:" w-[85%] h-[10%] flex items-center mx-auto space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){g.h.collection("wordsByUser").doc(t).collection("updates").orderBy("updated","asc").endBefore(i).limitToLast(10).get().then((function(e){if((null===e||void 0===e?void 0:e.docs.length)>0){var t=null===e||void 0===e?void 0:e.docs;c(t),s(t[0]),l(t[(null===t||void 0===t?void 0:t.length)-1])}}))},disabled:!i,className:" w-[80%] h-[60px] focus:outline-none bg-slate-900 rounded-md font-robot-slab font-semibold text-lg text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Back"}),(0,b.jsx)("button",{onClick:function(){g.h.collection("wordsByUser").doc(t).collection("updates").orderBy("updated","asc").startAfter(o).limit(10).get().then((function(e){if((null===e||void 0===e?void 0:e.docs.length)>0){var t=null===e||void 0===e?void 0:e.docs;c(t),s(t[0]),l(t[(null===t||void 0===t?void 0:t.length)-1])}}))},disabled:!o,className:" w-[80%] h-[60px] focus:outline-none bg-slate-900 rounded-md font-robot-slab font-semibold text-lg text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Next"})]})]})})};function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=function(e){var t,n,o,l,a,i,s,d,r=e.editorId,c=z((0,j.F_)(g.fV),1)[0],u=z((0,M.ky)(g.h.collection("editors").doc(r)),3),v=u[0],h=(u[1],u[2],(0,k.useState)(!1)),f=h[0],p=h[1],x=(0,k.useState)(!1),m=x[0],y=x[1];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" min-h-[340px] max-h-[420px] flex items-center justify-between w-[95%] mx-auto bg-slate-800 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out rounded-md group px-3 py-2 ",children:[(0,b.jsxs)("span",{className:" w-[50%] h-full flex flex-col justify-center items-center space-y-1 ",children:[(0,b.jsx)("img",{src:null===(t=null===v||void 0===v?void 0:v.data())||void 0===t?void 0:t.editorPic,alt:"",className:" h-[120px] rounded-full border border-sky-400 group-hover:border-sky-600 transform transition duration-300 ease-in-out "}),(0,b.jsx)("h2",{className:" font-robot-condensed font-semibold text-sky-300 text-lg ",children:"Added by"}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sky-400 text-base ",children:null===(n=null===v||void 0===v?void 0:v.data())||void 0===n?void 0:n.addedBy})]}),(0,b.jsxs)("div",{className:" w-[50%] h-full flex flex-col items-end justify-center space-y-2 ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-sky-400 text-base ",children:null===(o=null===v||void 0===v?void 0:v.data())||void 0===o?void 0:o.editorName}),(0,b.jsx)("h2",{className:" editorEmail ",children:null===(l=null===v||void 0===v?void 0:v.data())||void 0===l?void 0:l.editorEmail}),(0,b.jsx)("span",{className:" editorBottomSpan ",children:("rumlowb@gmail.com"==(null===c||void 0===c?void 0:c.email)||"reaperiff697@gmail.com"==(null===c||void 0===c?void 0:c.email)||"sygrandkaiser@gmail.com"==(null===c||void 0===c?void 0:c.email)||"marvin_sy@dlsu.edu.ph"==(null===c||void 0===c?void 0:c.email))&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{onClick:function(){return p(!0)},className:" editorBottomBtn text-sky-400 hover:border-sky-600 hover:text-sky-600 border-sky-400 ",children:"Entries"}),(0,b.jsx)("button",{onClick:function(){return y(!0)},className:" editorBottomBtn text-emerald-500 hover:border-emerald-700 hover:text-emerald-700 border-emerald-500 ",children:"Updates"})]})}),("rumlowb@gmail.com"==(null===c||void 0===c?void 0:c.email)||"reaperiff697@gmail.com"==(null===c||void 0===c?void 0:c.email)||"sygrandkaiser@gmail.com"==(null===c||void 0===c?void 0:c.email)||"marvin_sy@dlsu.edu.ph"==(null===c||void 0===c?void 0:c.email))&&(0,b.jsx)("button",{onClick:function(){g.h.collection("editors").doc(r).delete()},className:" h-[50px] w-[40%] px-3 font-robot-slab font-semibold rounded-md bg-slate-800 text-lg border text-red-500 hover:border-red-700 hover:text-red-700 border-red-500 transform transition duration-300 ease-in-out ",children:"Remove"})]})]},null===v||void 0===v?void 0:v.id),f&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 fixed z-50 inset-0 flex flex-col items-center ",children:(0,b.jsxs)("div",{className:" h-[85%] xl:w-[50%] lg:w-[70%] w-[90%] bg-slate-800 border border-sky-400 rounded-md mx-auto ",children:[(0,b.jsxs)("header",{className:" top-0 flex items-center px-4 py-3 border-b border-sky-400 justify-between ",children:[(0,b.jsxs)("h3",{className:" font-robot-slab font-semibold text-sky-400 text-lg ",children:["Entries by ",null===(a=null===v||void 0===v?void 0:v.data())||void 0===a?void 0:a.editorName]}),(0,b.jsx)("button",{onClick:function(){return p(!1)},className:" font-fira-sans font-semibold focus:outline-none text-lg text-sky-400 rounded-3xl px-3 py-1 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsx)(O,{userName:null===(i=null===v||void 0===v?void 0:v.data())||void 0===i?void 0:i.editorName})]})}),m&&(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 fixed z-50 inset-0 flex items-center",children:[(0,b.jsx)("div",{onClick:function(){return y(!1)},className:" lg:w-[15%] w-[10%] h-full "}),(0,b.jsxs)("div",{className:" h-[80%] lg:w-[70%] w-[80%] mx-auto bg-slate-800 border border-sky-400 rounded-md ",children:[(0,b.jsxs)("header",{className:" w-full h-[60px] border-b border-sky-400 px-3 py-2 flex items-center justify-between ",children:[(0,b.jsxs)("h3",{className:" font-robot-slab font-semibold text-lg text-sky-400 ",children:["Update/s by ",null===(s=null===v||void 0===v?void 0:v.data())||void 0===s?void 0:s.editorName]}),(0,b.jsx)("button",{onClick:function(){return y(!1)},className:" font-fira-sans font-semibold focus:outline-none text-lg text-sky-400 rounded-3xl px-3 py-1 border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsx)(V,{userName:null===(d=null===v||void 0===v?void 0:v.data())||void 0===d?void 0:d.editorName})]}),(0,b.jsx)("div",{onClick:function(){return y(!1)},className:" h-full lg:w-[15%] w-[10%] "})]})]})};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var P=function(){var e=(0,N.useRouter)(),t=(0,k.useState)(!1),n=t[0],r=t[1],h=(0,k.useState)(!1),f=h[0],p=h[1],x=Z((0,j.F_)(g.fV),1)[0],m=(0,k.useState)(!1),y=m[0],w=m[1],S=(0,k.useState)(!1),C=(S[0],S[1],(new Date).toLocaleDateString()),F=function(){g.fV.signInWithPopup(g.Ap).catch(alert),r(!1)};(0,k.useEffect)((function(){x&&g.h.collection("users").doc(x.uid).set({email:x.email,displayName:x.displayName,photoURL:x.photoURL})}),[x]);var B=(0,k.useState)(!1),A=B[0],I=B[1],D=(0,k.useState)(""),U=D[0],O=D[1],_=Z((0,M.Kx)(g.h.collection("feedbackCollection")),1)[0],E=function(e){e.preventDefault(),U&&g.h.collection("feedbackCollection").add({feedback:U,feedbackBy:null===x||void 0===x?void 0:x.displayName,addedOn:C}),O("")},V=function(){U&&O(""),I(!1),p(!0)},R=(0,k.useState)(!1),z=R[0],K=R[1],P=(0,k.useState)(!1),H=P[0],$=P[1],X=Z((0,M.Kx)(g.h.collection("users").orderBy("displayName","asc")),1)[0],G=Z((0,M.Kx)(null===g.h||void 0===g.h?void 0:g.h.collection("editors").orderBy("editorName","asc")),1)[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" bg-gray-800 flex items-center justify-evenly px-8 py-4 ",children:[(0,b.jsxs)("span",{className:" space-x-2 flex items-center hover:border-b hover:border-sky-500 hover:-skew-x-2 duration-300 transform transition ease-in-out cursor-pointer ",children:[(0,b.jsx)(v.qAs,{style:{fontSize:"1.2em",color:"skyblue"}}),(0,b.jsx)("h2",{className:"font-semibold text-sky-300 font-montserr text-xl capitalize",children:"HokkienHub"})]}),(0,b.jsx)("div",{className:"flex items-center space-x-5",children:x?(0,b.jsx)(s.Z,{onClick:function(e){return p(!0)},color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:(0,b.jsx)("img",{src:null===x||void 0===x?void 0:x.photoURL,alt:"",className:" h-10 w-10 rounded-3xl border border-blue-400"})}):(0,b.jsxs)(s.Z,{onClick:F,color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:[(0,b.jsx)(d.Z,{name:"people"}),(0,b.jsx)("h2",{className:"routerNames",children:"Sign in"})]})})]}),(0,b.jsxs)(o.Z,{active:n,size:"regular",toggler:function(){return r(!1)},children:[(0,b.jsx)(l.Z,{toggler:function(){return r(!1)},children:(0,b.jsx)("p",{className:"font-google-sans capitalize text-2xl",children:"Sign in"})}),(0,b.jsx)(a.Z,{children:(0,b.jsxs)("div",{className:" grid place-items-center space-y-4 p-16",children:[(0,b.jsxs)(s.Z,{onClick:F,color:"blue",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"flex items-center space-x-3",children:[(0,b.jsx)(c.Z,{}),(0,b.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"Google"})]}),(0,b.jsxs)(s.Z,{color:"blueGray",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",children:[(0,b.jsx)(u.Z,{}),(0,b.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"GitHub"})]})]})}),(0,b.jsx)(i.Z,{children:(0,b.jsx)(s.Z,{onClick:function(e){return r(!1)},color:"red",size:"regular",buttonType:"link",ripple:"dark",className:"capitalize",children:"Close"})})]}),f&&(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 bg-opacity-70 z-50 fixed inset-0 flex items-center ",children:[(0,b.jsx)("div",{onClick:function(){return p(!1)},className:" lg:w-[25%] w-[10%] h-full "}),(0,b.jsxs)("div",{className:" h-[60%] lg:w-[50%] w-[80%] bg-slate-800 rounded-md space-y-3 flex flex-col border border-sky-400 ",children:[(0,b.jsxs)("header",{className:" h-[60px] w-full flex items-center justify-between px-3 py-2 border-b border-sky-400 ",children:[(0,b.jsx)("h1",{className:" font-path-ex font-semibold text-lg text-sky-400 ",children:"User details"}),(0,b.jsx)("button",{onClick:function(){return p(!1)},className:" border text-lg rounded-full border-sky-400 text-sky-400 grid place-items-center px-3 py-1 hover:border-sky-700 hover:text-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full flex flex-col items-center space-y-7 overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-400 pb-7 ",children:[(0,b.jsx)("img",{src:null===x||void 0===x?void 0:x.photoURL,alt:"",className:" h-24 w-24 rounded-full border border-sky-400 "}),(0,b.jsx)("h2",{className:" font-path-ex font-semibold text-sky-400 text-xl ",children:null===x||void 0===x?void 0:x.displayName}),("Reaper IFF"===(null===x||void 0===x?void 0:x.displayName)||"rumlowb@gmail.com"===(null===x||void 0===x?void 0:x.email))&&(0,b.jsx)("div",{children:(0,b.jsx)("button",{onClick:function(){return e.push("/testing_ground")},className:" font-path-ex font-normal text-emerald-500 border border-emerald-500 rounded-md hover:text-emerald-300 hover:border-2 hover:border-emerald-300 hover:rounded-lg hover:font-semibold focus:outline-none transform transition duration-200 ease-in-out px-4 py-3 text-lg ",children:"Testing ground"})}),("Reaper IFF"===(null===x||void 0===x?void 0:x.displayName)||"rumlowb@gmail.com"===(null===x||void 0===x?void 0:x.email)||"marvin_sy@dlsu.edu.ph"==(null===x||void 0===x?void 0:x.email)||"sygrandkaiser@gmail.com"==(null===x||void 0===x?void 0:x.email)||"reaperiff697@gmail.com"==(null===x||void 0===x?void 0:x.email))&&(0,b.jsx)("button",{onClick:function(){return e.push("/authorized")},className:" font-path-ex font-normal text-emerald-500 border border-emerald-500 rounded-md hover:text-emerald-300 hover:border-2 hover:border-emerald-300 hover:rounded-lg hover:font-semibold focus:outline-none transform transition duration-200 ease-in-out px-4 py-3 text-lg ",children:"Word list"}),("Reaper IFF"===(null===x||void 0===x?void 0:x.displayName)||"rumlowb@gmail.com"===(null===x||void 0===x?void 0:x.email)||"marvin_sy@dlsu.edu.ph"==(null===x||void 0===x?void 0:x.email)||"sygrandkaiser@gmail.com"==(null===x||void 0===x?void 0:x.email)||"reaperiff697@gmail.com"==(null===x||void 0===x?void 0:x.email))&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("button",{onClick:function(){return w(!0)},className:" font-path-ex font-normal text-emerald-500 border border-emerald-500 rounded-md hover:text-emerald-300 hover:border-2 hover:border-emerald-300 hover:rounded-lg hover:font-semibold focus:outline-none transform transition duration-200 ease-in-out px-4 py-3 text-lg ",children:"Editors"})}),("Reaper IFF"===(null===x||void 0===x?void 0:x.displayName)||"rumlowb@gmail.com"===(null===x||void 0===x?void 0:x.email)||"marvin_sy@dlsu.edu.ph"==(null===x||void 0===x?void 0:x.email)||"sygrandkaiser@gmail.com"==(null===x||void 0===x?void 0:x.email)||"reaperiff697@gmail.com"==(null===x||void 0===x?void 0:x.email)||""!==(null===x||void 0===x?void 0:x.email))&&(0,b.jsx)("button",{onClick:function(){I(!0),p(!1)},className:" font-path-ex font-normal text-emerald-500 border border-emerald-500 rounded-md hover:text-emerald-300 hover:border-2 hover:border-emerald-300 hover:rounded-lg hover:font-semibold focus:outline-none transform transition duration-200 ease-in-out px-4 py-3 text-lg ",children:"Create feedback"})]})]}),(0,b.jsx)("div",{onClick:function(){return p(!1)},className:" lg:w-[25%] w-[10%] h-full"})]}),A&&(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 fixed inset-0 z-50 overflow-hidden flex flex-col items-center ",children:[(0,b.jsx)("div",{onClick:V,className:" w-full h-[15%] "}),(0,b.jsxs)("div",{className:" h-[70%] lg:w-[40%] w-[80%] rounded-sm bg-slate-800 border border-sky-500 mx-auto ",children:[(0,b.jsxs)("header",{className:" top-0 w-full px-3 py-1 border-b border-sky-400 flex items-center justify-between ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:"Send a feedback"}),(0,b.jsx)("button",{onClick:V,className:" font-robot-slab font-bold border border-sky-400 text-sky-400 text-xl grid place-items-center rounded-3xl px-3 py-1 hover:border-sky-700 hover:text-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsx)("div",{className:" h-full w-full flex flex-col items-center px-4 py-3 space-y-4 ",children:"Reaper IFF"===(null===x||void 0===x?void 0:x.displayName)||"rumlowb@gmail.com"===(null===x||void 0===x?void 0:x.email)||"marvin_sy@dlsu.edu.ph"==(null===x||void 0===x?void 0:x.email)||"sygrandkaiser@gmail.com"==(null===x||void 0===x?void 0:x.email)||"reaperiff697@gmail.com"==(null===x||void 0===x?void 0:x.email)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:" top-0 w-full flex items-center justify-evenly space-x-3 ",children:[(0,b.jsx)("button",{onClick:function(){H&&$(!1),K(!0)},className:" w-[95%] h-[60px] focus:outline-none rounded-md mx-auto border text-base border-sky-500 text-sky-500 font-robot-slab font-semibold hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:"Feedback form"}),(0,b.jsx)("button",{onClick:function(){z&&K(!1),$(!0)},className:" w-[95%] h-[60px] focus:outline-none rounded-md mx-auto border text-base border-sky-500 text-sky-500 font-robot-slab font-semibold hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:"Feedbacks"})]}),z&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("h1",{className:" w-full px-4 text-base font-robot-slab font-semibold text-sky-400 ",children:["Type your feedback below, ",null===x||void 0===x?void 0:x.displayName]}),(0,b.jsx)("textarea",{value:U,onChange:function(e){return O(e.target.value)},className:" h-[60%] w-[85%] mx-auto bg-sky-800 border-0 outline-none font-robot-slab font-semibold text-sky-400 text-lg rounded-md px-3 py-2 "}),(0,b.jsxs)("div",{className:" flex items-center w-full justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:V,className:" outline-none focus:outline-none px-3 py-2 rounded-md text-red-400 border border-red-400 font-robot-slab font-semibold hover:text-red-600 hover:border-red-600 transform transition duration-300 ease-in-out ",children:"Cancel"}),(0,b.jsx)("button",{onClick:E,className:" outline-none focus:outline-none px-3 py-2 rounded-md text-sky-400 border border-sky-400 font-robot-slab font-semibold hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Send feedback"})]})]})]}),H&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("h1",{className:" w-full px-4 text-base font-robot-slab font-semibold text-sky-400 ",children:["Feedback/s below, ",null===x||void 0===x?void 0:x.displayName]}),(0,b.jsx)("div",{className:" flex flex-col bg-sky-800 bg-opacity-60 overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 px-4 py-3 max-h-[360px] min-h-[280px] w-[85%] mx-auto space-y-5 ",children:_&&(null===_||void 0===_?void 0:_.docs.map((function(e){return(0,b.jsx)(T,{snapshot:e})})))})]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("h1",{className:" w-full px-4 text-base font-robot-slab font-semibold text-sky-400 ",children:["Type your feedback below, ",null===x||void 0===x?void 0:x.displayName]}),(0,b.jsx)("textarea",{placeholder:"Feedback input here, ".concat(null===x||void 0===x?void 0:x.displayName),value:U,onChange:function(e){return O(e.target.value)},className:" h-[80%] w-[85%] mx-auto bg-sky-800 border-0 outline-none font-robot-slab font-semibold text-sky-400 text-lg rounded-lg px-3 py-2 "}),(0,b.jsxs)("div",{className:" flex items-center w-full justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:V,className:" outline-none focus:outline-none px-3 py-2 rounded-md text-red-400 border border-red-400 font-robot-slab font-semibold hover:text-red-600 hover:border-red-600 transform transition duration-300 ease-in-out ",children:"Cancel"}),(0,b.jsx)("button",{onClick:E,className:" outline-none focus:outline-none px-3 py-2 rounded-md text-sky-400 border border-sky-400 font-robot-slab font-semibold hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Send feedback"})]})]})]})})]}),(0,b.jsx)("div",{onClick:V,className:" w-full h-[15%] "})]}),y&&(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 fixed z-50 inset-0 flex flex-col overflow-hidden ",children:[(0,b.jsx)("div",{onClick:function(){return w(!1)},className:" h-[10%] w-full "}),(0,b.jsxs)("div",{className:" h-[90%] xl:w-[50%] w-[90%] mx-auto bg-slate-800 rounded-md border border-sky-400 ",children:[(0,b.jsxs)("header",{className:" flex items-center justify-between px-3 py-2 border-b border-sky-400 ",children:[(0,b.jsx)("h3",{className:" font-robot-slab font-semibold text-lg text-sky-400 ",children:"Users & editors"}),(0,b.jsx)("button",{onClick:function(){return w(!1)},className:" rounded-full font-fira-sans font-semibold text-red-500 border border-red-500 px-3 py-1 hover:text-red-600 hover:border-red-600 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("main",{className:" h-full w-full overflow-hidden space-y-1 ",children:[(0,b.jsxs)("div",{className:" h-[45%] w-full border-b border-sky-500 rounded-md ",children:[(0,b.jsx)("header",{className:" h-[10%] px-4 w-full border border-sky-400 flex items-center ",children:(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:"Logged-in users"})}),(0,b.jsx)("div",{className:" h-[85%] w-full overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex flex-col space-y-5 pb-7 ",children:X&&(null===X||void 0===X?void 0:X.docs.map((function(e){return(0,b.jsx)(W,{docId:null===e||void 0===e?void 0:e.id})})))})]}),(0,b.jsxs)("div",{className:" h-[45%] w-full border-t border-sky-500 rounded-md ",children:[(0,b.jsx)("header",{className:" h-[10%] px-4 w-full border border-sky-400 flex items-center ",children:(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-base text-sky-400 ",children:"Authorized editors"})}),(0,b.jsx)("div",{className:" h-[85%] w-full overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex flex-col space-y-5 pb-7 ",children:G&&(null===G||void 0===G?void 0:G.docs.map((function(e){return(0,b.jsx)(L,{editorId:null===e||void 0===e?void 0:e.id})})))})]})]})]}),(0,b.jsx)("div",{onClick:function(){return w(!1)},className:" h-[10%] w-full "})]})]})};var H=n(4051),$=n.n(H),X=(n(1540),n(8668));var G=function(e){var t,n,o=e.meaning,l=e.type,a=e.synSnap,i=e.labelSnap;return(0,b.jsxs)("span",{className:" w-full mx-auto h-[240px] rounded-md border border-sky-400 bg-slate-800 flex flex-col items-start px-3 my-7 space-y-4 ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-2 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sky-600 text-lg w-[140px] ",children:l}),(0,b.jsx)("span",{className:" w-[50%] mx-auto flex items-center overflow-x-scroll scrollbar-hide ",children:i&&(null===i||void 0===i?void 0:i.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h2",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:o}),a&&(null===(n=null===a||void 0===a||null===(t=a.docs)||void 0===t?void 0:t.slice(0,1))||void 0===n?void 0:n.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center w-full space-x-2 ",children:[(0,b.jsx)("h1",{className:" font-robot-slab font-semibold text-base text-sky-100 ",children:"Synonym/s"}),(0,b.jsx)("h3",{className:" font-robot-slab font-bold text-sm text-sky-200 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]})};function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Q=function(e){var t=e.parentId,n=(e.labelParent,e.meaning),o=Y((0,j.F_)(g.fV),1)[0],l=Y((0,M.ky)(g.h.doc("hokkienWords/".concat(t))),3),a=(l[0],l[1],l[2],(0,k.useState)("")),i=a[0],s=a[1],d=(new Date).toLocaleDateString(),r=Y((0,M.Kx)(g.h.collection("hokkienWords").doc(t).collection("".concat(n)).orderBy("addedOn")),1)[0];return(0,b.jsxs)("div",{className:" w-full flex flex-col items-start space-y-4 ",children:[(0,b.jsxs)("h1",{className:" font-fira-sans font-semibold text-sky-400 text-lg ",children:["Add label/s for ",n]}),(0,b.jsx)("input",{value:i,onChange:function(e){return s(e.target.value)},type:"text",placeholder:"Add label for the meaning",className:" h-[60px] w-[90%] mx-auto bg-slate-800 outline-none border border-sky-400 rounded-md font-fira-sans font-semibold text-xl text-sky-500 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center px-3 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),n&&(g.h.collection("hokkienWords").doc(t).collection("".concat(n)).add({label:i,addedBy:null===o||void 0===o?void 0:o.email,adderName:null===o||void 0===o?void 0:o.displayName,addedOn:d}),s(""))},className:" w-[50%] h-[50px] bg-slate-800 border border-sky-400 text-xl text-sky-400 focus:outline-none hover:border-sky-600 hover:text-sky-600 transform transition duration-300 ",children:"Add label"})]}),(0,b.jsx)("span",{className:" h-[240px] w-full rounded-md px-3 py-2 grid grid-cols-3 border border-sky-400 overflow-y-scroll scrollbar-hide ",children:r&&(null===r||void 0===r?void 0:r.docs.map((function(e){var t;return(0,b.jsx)("span",{className:" w-[280px] h-[60px] flex items-center justify-center hover:text-sky-700 transform transiton duration-300 ease-in-out px-4 py-3 rounded-md ",children:(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-lg text-sky-500 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})})))})]})};function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var te=function(e){var t,n=e.parentId,o=e.labelGroup,l=e.labelId,a=e.meaningTitle,i=(e.labelTitle,e.labelInput),s=e.setLabelInput,d=ee((0,j.F_)(g.fV),1)[0],r=(new Date).toLocaleDateString(),c=ee((0,M.ky)(g.h.collection("hokkienWords").doc(n)),1)[0],u=ee((0,M.ky)(g.h.doc("hokkienWords/".concat(n)).collection("".concat(o)).doc(l)),3),v=u[0],h=(u[1],u[2],(0,k.useState)("")),f=h[0],p=h[1];return(0,b.jsxs)("div",{className:" flex flex-col space-y-3 items-start w-full ",children:[(0,b.jsxs)("h1",{className:" font-robot-slab font-semibold text-xl text-sky-200 ",children:["Label/s for ",a]}),(0,b.jsx)("h2",{className:" font-robot-slab font-bold text-lg text-sky-400 place-self-center ",children:null===(t=null===v||void 0===v?void 0:v.data())||void 0===t?void 0:t.label}),(0,b.jsx)("input",{placeholder:"Updated label...",value:i,onChange:function(e){return s(e.target.value)},type:"text",className:" w-[90%] mx-auto px-3 py-2 h-[60px] outline-none font-robot-slab font-semibold text-sky-400 text-lg border border-sky-400 rounded-md focus:outline-none placeholder-sky-600 bg-slate-800 "}),(0,b.jsx)("span",{className:" w-[90%] mx-auto flex items-center justify-between ",children:(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(n,"/").concat(o,"/").concat(l)).set({label:f,addedBy:null===d||void 0===d?void 0:d.email,adderName:null===d||void 0===d?void 0:d.displayName,addedOn:r},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===d||void 0===d?void 0:d.displayName).collection("updates").add({labelInput:i,updated:"Label/s for ".concat(a),updatedWord:null===(t=null===c||void 0===c?void 0:c.data())||void 0===t?void 0:t.hokkien})})),p("")},className:" border border-sky-400 h-[60px] w-[45%] outline-none rounded-md text-lg text-sky-400 bg-slate-800 hover:border-sky-600 hover:text-sky-600 transform transition duration-300 ease-in-out focus:outline-none ",children:"Update"})})]})};function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function oe(e,t,n,o,l,a,i){try{var s=e[a](i),d=s.value}catch(r){return void n(r)}s.done?t(d):Promise.resolve(d).then(o,l)}function le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ae=function(e){var t,n,o,l,a,i,s,d,c,u,v,f,x,m,y,w,S,T,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,J,Y=e.hit,q=(0,k.useState)(!1),ee=q[0],ne=q[1],ae=(0,k.useState)(!1),ie=(ae[0],ae[1],(0,N.useRouter)()),se=le((0,j.F_)(g.fV),1)[0],de=(0,k.useState)(!1),re=de[0],ce=de[1],ue=(0,k.useState)(!1),ve=ue[0],he=ue[1],fe=(0,k.useState)(!1),pe=fe[0],xe=fe[1],me=(0,k.useState)(!1),ye=me[0],be=me[1],ke=(0,k.useState)(!1),ge=(ke[0],ke[1],(0,k.useState)(!1)),je=ge[0],Ne=ge[1],we=(0,k.useState)(!1),Se=we[0],Te=we[1],Me=(0,k.useState)(!1),Ce=Me[0],Fe=Me[1],We=(0,k.useState)(!1),Be=We[0],Ae=We[1],Ie=(0,k.useState)(""),De=Ie[0],Oe=Ie[1],_e=(0,k.useState)(!1),Ee=_e[0],Ve=_e[1],ze=(0,k.useState)(""),Le=(ze[0],ze[1],(0,k.useState)("")),Ke=Le[0],Ze=Le[1],Pe=(0,k.useState)(!1),He=(Pe[0],Pe[1],(new Date).toLocaleDateString()),$e=(0,k.useState)(!1),Xe=($e[0],$e[1],(0,k.useState)(!1)),Ge=Xe[0],Je=Xe[1],Ye=(0,k.useState)(!1),Qe=Ye[0],qe=Ye[1],et=(0,k.useState)(""),tt=et[0],nt=et[1],ot=(0,k.useState)(""),lt=ot[0],at=ot[1],it=(0,k.useState)(""),st=it[0],dt=it[1],rt=(0,k.useState)(""),ct=rt[0],ut=rt[1],vt=(0,k.useState)(""),ht=vt[0],ft=vt[1],pt=(0,k.useState)(""),xt=pt[0],mt=(pt[1],(0,k.useState)("")),yt=mt[0],bt=mt[1],kt=(0,k.useState)(""),gt=kt[0],jt=kt[1],Nt=le((0,M.ky)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id))),3),wt=Nt[0],St=(Nt[1],Nt[2],function(){ne(!0),he(!1)}),Tt=function(){xe(!0),je&&Ne(!1),ne(!1)},Mt=function(){ce(!0),je&&Ne(!1),ne(!1)},Ct=function(){Je(!0),je&&Ne(!1),ne(!1)},Ft=function(){ne(!0),0==je&&Ne(!0),Je(!1)},Wt=function(){qe(!0),Je(!1)},Bt=function(){ne(!1),je&&Ne(!1),Ve(!0)},At=(le((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("sampleSentence")),1)[0],le((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("editorNotes")),1)[0],le((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("editorUpdates").orderBy("updatedOn","desc")),1)[0]),It=le((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("commentsData")),1)[0],Dt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor1stMean").orderBy("addedOn","asc")),1)[0],Ut=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor2ndMean").orderBy("addedOn","asc")),1)[0],Ot=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor3rdMean").orderBy("addedOn","asc")),1)[0],_t=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor4thMean").orderBy("addedOn","asc")),1)[0],Et=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor5thMean").orderBy("addedOn","asc")),1)[0],Vt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor6thMean").orderBy("addedOn","asc")),1)[0],Rt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor7thMean").orderBy("addedOn","asc")),1)[0],zt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("labelFor8thMean").orderBy("addedOn","asc")),1)[0],Lt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor1stMean").orderBy("synonymNo","asc")),1)[0],Kt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor2ndMean").orderBy("synonymNo","asc")),1)[0],Zt=le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor3rdMean").orderBy("synonymNo","asc")),1)[0],Pt=(le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor4thMean").orderBy("synonymNo","asc")),1)[0],le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor5thMean").orderBy("synonymNo","asc")),1)[0],le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor6thMean").orderBy("synonymNo","asc")),1)[0],le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor7thMean").orderBy("synonymNo","asc")),1)[0],le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("synonymsFor8thMean").orderBy("synonymNo","asc")),1)[0],(0,k.useState)(!1)),Ht=Pt[0],Xt=Pt[1],Gt=function(){var e,t=(e=$().mark((function e(){var t,n;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!se){e.next=12;break}return e.prev=1,e.next=4,g.h.collection("editors").where("editorEmail","==",null===se||void 0===se?void 0:se.email).get();case 4:t=e.sent,n=(null===t||void 0===t?void 0:t.size)>0,Xt(n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.error("Error checking editor status: ",e.t0);case 12:case"end":return e.stop()}}),e,null,[[1,9]])})),function(){var t=this,n=arguments;return new Promise((function(o,l){var a=e.apply(t,n);function i(e){oe(a,o,l,i,s,"next",e)}function s(e){oe(a,o,l,i,s,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();(0,k.useEffect)((function(){Gt()}),[se]);var Jt=function(){Ke&&Ze(""),Ve(!1),ne(!0)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:" mobileSearchResDiv ",children:[(0,b.jsxs)("header",{className:" top-0 h-[50px] w-full border-b border-sky-300 flex items-center justify-between px-2 py-1 ",children:[("rumlowb@gmail.com"==(null===se||void 0===se?void 0:se.email)||"marvin_sy@dlsu.edu.ph"==(null===se||void 0===se?void 0:se.email)||"sygrandkaiser@gmail.com"==(null===se||void 0===se?void 0:se.email)||"reaperiff697@gmail.com"==(null===se||void 0===se?void 0:se.email))&&(0,b.jsxs)("h4",{className:" font-robot-slab font-semibold text-sky-100 text-base ",children:["By ",null===(t=null===wt||void 0===wt?void 0:wt.data())||void 0===t?void 0:t.addedBy]}),(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("button",{onClick:function(){return Ne(!0)},className:"mobSearchResBtn ",children:(0,b.jsx)(h.bBz,{style:{fontSize:"1.3em",color:"whitesmoke"}})}),(0,b.jsx)("button",{onClick:function(){return ne(!0)},className:"searchResBtn ",children:(0,b.jsx)(h.bBz,{style:{fontSize:"1.3em",color:"whitesmoke"}})}),se&&Ht&&(0,b.jsx)("button",{onClick:function(){return be(!0)},className:"searchResBtn ",children:(0,b.jsx)(p.dEB,{style:{fontSize:"1.3em",color:"whitesmoke"}})})]})]}),(0,b.jsxs)("div",{className:" h-full w-full py-3 flex flex-col space-y-4 ",children:[(0,b.jsxs)("div",{className:" w-full flex items-center justify-between ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-semibold text-xl underline px-4 text-sky-200 ",children:null===(n=null===wt||void 0===wt?void 0:wt.data())||void 0===n?void 0:n.hokkien}),(0,b.jsx)("h3",{className:" font-robot-slab font-semibold text-lg px-4 text-sky-100 ",children:null===(o=null===wt||void 0===wt?void 0:wt.data())||void 0===o?void 0:o.hanzi})]}),(0,b.jsxs)("span",{className:" flex flex-col w-full space-y-1 py-2 px-4 border-y bg-slate-800 bg-opacity-10 border-slate-800 h-[120px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-base text-sky-200 ",children:null===(l=null===wt||void 0===wt?void 0:wt.data())||void 0===l?void 0:l.type}),Dt&&(null===Dt||void 0===Dt||null===(a=Dt.docs)||void 0===a?void 0:a.slice(0,4).map((function(e){var t;return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-200 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})})))]}),(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sm text-sky-100 w-[90%] ",children:null===(i=null===wt||void 0===wt?void 0:wt.data())||void 0===i?void 0:i.meaning}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-base text-sky-200 ",children:null===(s=null===wt||void 0===wt?void 0:wt.data())||void 0===s?void 0:s.secondType}),Ut&&(null===Ut||void 0===Ut||null===(d=Ut.docs)||void 0===d?void 0:d.slice(0,4).map((function(e){var t;return(0,b.jsx)("span",{className:"w-[100px] truncate overflow-ellipsis",children:(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-base text-sky-200 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})})))]}),(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sm text-sky-100 w-[90%] ",children:null===(c=null===wt||void 0===wt?void 0:wt.data())||void 0===c?void 0:c.secondMeaning}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-base text-sky-200 ",children:null===(u=null===wt||void 0===wt?void 0:wt.data())||void 0===u?void 0:u.thirdType}),Ot&&(null===Ot||void 0===Ot||null===(v=Ot.docs)||void 0===v?void 0:v.slice(0,4).map((function(e){var t;return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-200 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})})))]}),(0,b.jsx)("h4",{className:" font-robot-slab font-semibold text-sm text-sky-100 w-[90%] ",children:null===(f=null===wt||void 0===wt?void 0:wt.data())||void 0===f?void 0:f.thirdMeaning})]})]})]},null===wt||void 0===wt?void 0:wt.id)}),ee&&(0,b.jsxs)("div",{className:" wordInfoBg ",children:[(0,b.jsx)("div",{onClick:function(){return ne(!1)},className:" w-[10%] h-full bg-transparent "}),(0,b.jsx)(Kn,{snapshot:wt,hit:Y,openAddMeaning:Mt,openComments:function(){ee&&ne(!1),je&&Ne(!1),Ae(!0)},openDisplayUpdates:function(){ee&&ne(!1),je&&Ne(!1),Fe(!0)},openNotesModal:function(){ee&&ne(!1),Te(!0)},openEditDetails:Tt,wordInfo:ee,setWordInfo:ne,editOption:ve,setEditOption:he,openEditOptions:function(){he(!0),je&&Ne(!1),ne(!1)},closeEditOptions:St,openFeedbackForm:Bt,openEditLabels:Ct,closeEditLabels:Ft}),(0,b.jsx)("div",{onClick:function(){return ne(!1)},className:" w-[10%] h-full bg-transparent "})]}),ve&&(0,b.jsx)("div",{className:" w-screen h-screen bg-slate-800 bg-opacity-75 fixed inset-0 z-50 grid place-items-center ",children:(0,b.jsx)(Zn,{closeEditOption:St,openAddMeaning:Mt,openEditDetails:Tt,openEditLabels:Ct,closeEditLabels:Ft})}),pe&&(0,b.jsx)("div",{className:" h-screen w-screen bg-slate-800 bg-opacity-80 grid place-items-center fixed inset-0 z-50 ",children:(0,b.jsxs)("div",{className:" h-[75vh] w-[85%] mx-auto place-items-center bg-sky-900 bg-opacity-80 flex flex-col items-center space-y-7 rounded-lg ",children:[(0,b.jsxs)("header",{className:" top-0 w-full sticky bg-slate-800 bg-opacity-70 flex items-center justify-between px-5 py-3 ",children:[(0,b.jsx)("h1",{className:" font-path-ex font-semibold text-xl text-sky-50 ",children:"Edit form"}),(0,b.jsx)("button",{onClick:function(){ne(!0),0==je&&Ne(!0),xe(!1)},className:" font-path-ex font-bold px-3 py-1 grid place-items-center rounded-3xl text-red-500 border border-red-500 hover:border-2 hover:text-red-700 hover:border-red-700 transform transition duration-200 ease-in-out ",children:"X"})]}),(0,b.jsx)(Re,{hit:Y})]})}),ye&&(0,b.jsx)("div",{className:" h-screen w-screen bg-slate-800 bg-opacity-80 grid place-items-center fixed inset-0 z-50 ",children:(0,b.jsxs)("div",{className:" h-[75vh] w-[85%] mx-auto place-items-center bg-sky-900 bg-opacity-80 flex flex-col items-center space-y-7 rounded-lg ",children:[(0,b.jsxs)("header",{className:" top-0 w-full sticky bg-slate-800 bg-opacity-70 flex items-center justify-between px-5 py-3 ",children:[(0,b.jsx)("h1",{className:" font-path-ex font-semibold text-xl text-sky-50 ",children:"Edit form"}),(0,b.jsx)("button",{onClick:function(){return be(!1)},className:" font-path-ex font-bold px-3 py-1 grid place-items-center rounded-3xl text-red-500 border border-red-500 hover:border-2 hover:text-red-700 hover:border-red-700 transform transition duration-200 ease-in-out ",children:"X"})]}),(0,b.jsx)(Re,{hit:Y})]})}),je&&(0,b.jsx)("div",{className:"mobileDisplayRedux",children:(0,b.jsxs)("div",{className:"mobileDetailsDiv",children:[(0,b.jsx)("header",{className:" top-0 px-3 h-[45px] w-full flex items-center justify-between border-b border-sky-400 ",children:(0,b.jsxs)("span",{className:" flex items-center space-x-3 w-full justify-between ",children:[(0,b.jsx)("button",{onClick:function(){return ie.push("/word/".concat(null===wt||void 0===wt?void 0:wt.id))},className:" px-3 py-1 text-sm rounded-md border text-sky-400 border-sky-400 font-robot-slab font-semibold hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out",children:"Read more"}),(0,b.jsx)(r.Z,{buttonText:"Options",size:"sm",buttonType:"link",color:"blue",children:(0,b.jsxs)("div",{className:" bg-slate-800 h-[210px] w-[260px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex flex-col items-center space-y-3 py-4 ",children:[se&&Ht&&(0,b.jsx)("button",{onClick:Tt,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Edit details"}),se&&Ht&&(0,b.jsx)("button",{onClick:Mt,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Edit meanings"}),se&&Ht&&(0,b.jsx)("button",{onClick:Wt,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Labels options"}),(null===se||void 0===se?void 0:se.email)?(0,b.jsx)("button",{onClick:Bt,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Give feedback"}):(0,b.jsx)("button",{onClick:function(){g.fV.signInWithPopup(g.Ap).catch(alert),Bt()},className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Sign in first"})]})}),(0,b.jsx)("button",{onClick:function(){return Ne(!1)},className:" px-3 py-1 grid rounded-full place-items-center text-lg border text-red-700 border-red-700 font-robot-slab font-semibold hover:text-red-500 hover:border-red-500 transform transition duration-300 ease-in-out",children:"X"})]})}),(0,b.jsxs)("div",{className:" h-[90%] w-full px-3 ",children:[(0,b.jsxs)("div",{className:"py-5 w-full flex items-center justify-between",children:[(0,b.jsxs)("div",{className:" flex flex-col items-start space-y-3 ",children:[(0,b.jsx)("h1",{className:"font-robot-slab font-semibold text-xl text-sky-300",children:null===(x=null===wt||void 0===wt?void 0:wt.data())||void 0===x?void 0:x.hokkien}),(null===(m=null===wt||void 0===wt?void 0:wt.data())||void 0===m?void 0:m.variants)?(0,b.jsx)("span",{className:" flex flex-col items-start ",children:(0,b.jsx)("h2",{className:"font-robot-slab font-semibold text-lg text-sky-300",children:null===(y=null===wt||void 0===wt?void 0:wt.data())||void 0===y?void 0:y.variants})}):(0,b.jsx)("span",{className:" flex flex-col items-start ",children:(0,b.jsx)("h2",{className:"font-robot-slab font-semibold text-lg text-sky-300",children:null===(w=null===wt||void 0===wt?void 0:wt.data())||void 0===w?void 0:w.hanzi})}),(null===(S=null===wt||void 0===wt?void 0:wt.data())||void 0===S?void 0:S.pronunciation)&&(0,b.jsx)("span",{className:" px-3 py-2 border border-sky-400 rounded ",children:(0,b.jsx)("audio",{src:null===(T=null===wt||void 0===wt?void 0:wt.data())||void 0===T?void 0:T.pronunciation,controls:!0})})]}),(0,b.jsxs)("div",{className:" flex flex-col items-end space-y-3 ",children:[(null===(C=null===wt||void 0===wt?void 0:wt.data())||void 0===C?void 0:C.variants)&&(0,b.jsxs)("span",{className:"flex items-center space-x-2",children:[(0,b.jsx)("h3",{className:"font-robot-slab font-normal text-sky-500 text-base",children:"Hanzi"}),(0,b.jsx)("h3",{className:"font-robot-slab font-semibold text-sky-500 text-lg",children:null===(F=null===wt||void 0===wt?void 0:wt.data())||void 0===F?void 0:F.hanzi})]}),(0,b.jsxs)("span",{className:"flex flex-col items-end space-y-1",children:[(0,b.jsx)("h3",{className:"font-robot-slab font-normal text-sky-500 text-sm",children:"Tai-lo (#):"}),(0,b.jsx)("h3",{className:"font-robot-slab font-semibold text-sky-400 text-base",children:null===(W=null===wt||void 0===wt?void 0:wt.data())||void 0===W?void 0:W.taiLo})]}),(0,b.jsxs)("span",{className:"flex flex-col items-end space-y-1",children:[(0,b.jsx)("h3",{className:"font-robot-slab font-normal text-sky-500 text-sm",children:"Lannang:"}),(0,b.jsx)("h3",{className:"font-robot-slab font-semibold text-sky-400 text-base",children:null===(B=null===wt||void 0===wt?void 0:wt.data())||void 0===B?void 0:B.lannang})]}),(0,b.jsxs)("span",{className:"flex flex-col items-end space-y-1",children:[(0,b.jsx)("h3",{className:"font-robot-slab font-normal text-sky-500 text-sm",children:"POJ:"}),(0,b.jsx)("h3",{className:"font-robot-slab font-semibold text-sky-500 text-base",children:null===(A=null===wt||void 0===wt?void 0:wt.data())||void 0===A?void 0:A.poj})]})]})]}),(0,b.jsxs)("div",{className:"h-[40%] w-full rounded border border-sky-400 flex flex-col items-center px-3 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500",children:[(0,b.jsx)(G,{type:null===(I=null===wt||void 0===wt?void 0:wt.data())||void 0===I?void 0:I.type,meaning:null===(D=null===wt||void 0===wt?void 0:wt.data())||void 0===D?void 0:D.meaning,synSnap:Lt,labelSnap:Dt}),(null===(U=null===wt||void 0===wt?void 0:wt.data())||void 0===U?void 0:U.secondMeaning)&&(0,b.jsx)(G,{type:null===(O=null===wt||void 0===wt?void 0:wt.data())||void 0===O?void 0:O.secondType,meaning:null===(_=null===wt||void 0===wt?void 0:wt.data())||void 0===_?void 0:_.secondMeaning,synSnap:Kt,labelSnap:Ut}),(null===(E=null===wt||void 0===wt?void 0:wt.data())||void 0===E?void 0:E.thirdMeaning)&&(0,b.jsx)(G,{type:null===(V=null===wt||void 0===wt?void 0:wt.data())||void 0===V?void 0:V.thirdType,meaning:null===(R=null===wt||void 0===wt?void 0:wt.data())||void 0===R?void 0:R.thirdMeaning,synSnap:Zt,labelSnap:Ot})]})]})]})}),re&&(0,b.jsx)("div",{className:" meanModalBg ",children:(0,b.jsxs)("div",{className:" meanModalMainDiv ",children:[(0,b.jsxs)("div",{className:" top-0 w-full z-50 sticky flex items-center justify-between px-4 py-3 border-b-2 border-sky-700 ",children:[(0,b.jsx)("h1",{className:" text-lg font-path-ex font-bold text-sky-300 ",children:"Add or edit meaning/s below"}),(0,b.jsx)("button",{onClick:function(){ne(!0),je&&Ne(!0),ce(!1)},className:" font-path-ex font-bold rounded-3xl border border-sky-300 text-sky-500 px-3 py-1 ",children:"X"})]}),(0,b.jsx)(Ue,{hit:Y})]})}),Se&&(0,b.jsx)("div",{className:" h-screen w-screen bg-slate-900 bg-opacity-70 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)($t,{hit:Y,buttonAction:function(){Te(!1),ne(!0)}})}),Ce&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-80 fixed inset-0 z-50 grid place-items-center ",children:(0,b.jsxs)("div",{className:" updatesDisplayModal ",children:[(0,b.jsxs)("header",{className:" h-[60px] w-full flex items-center justify-between px-4 py-3 border-b border-sky-400 ",children:[(0,b.jsxs)("p",{className:" text-base text-sky-400 font-robot-slab font-semibold ",children:["Updates for ",null===(z=null===wt||void 0===wt?void 0:wt.data())||void 0===z?void 0:z.hokkien]}),(0,b.jsx)("button",{onClick:function(){Fe(!1),ne(!0),Ne(!0)},className:" px-3 py-1 rounded-full grid place-items-center border border-sky-500 text-base text-sky-500 hover:border-sky-300 hover:text-sky-300 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsx)("div",{className:" h-full w-full flex flex-col space-y-5 overflow-y-scroll scrollbar-thin scrollbar-track-sky-800 scrollbar-thumb-sky-500 py-4 ",children:At&&(null===At||void 0===At?void 0:At.docs.map((function(e){return(0,b.jsx)(un,{upDocId:null===e||void 0===e?void 0:e.id,updateData:null===e||void 0===e?void 0:e.data()})})))})]})}),Be&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-75 grid place-items-center fixed inset-0 z-50 ",children:(0,b.jsx)("div",{className:" commentsModal ",children:(0,b.jsxs)("div",{className:" h-[95%] py-3 px-4 w-full flex flex-col space-y-4 ",children:[(0,b.jsxs)("div",{className:" h-[30%] w-full flex flex-col bg-transparent px-4 py-3 ",children:[(0,b.jsx)("textarea",{placeholder:"Comment here, ".concat(null===se||void 0===se?void 0:se.displayName),value:De,onChange:function(e){return Oe(e.target.value)},className:" h-[80%] w-full px-3 py-2 font-path-ex font-semibold text-base text-sky-400 overflow-y-scroll scrollbar-hide bg-slate-900 focus:outline-none rounded border border-sky-500 "}),(0,b.jsxs)("span",{className:" h-[20%] flex items-center space-x-2 px-3 py-2 place-self-end ",children:[(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),De&&Oe(""),Ae(!1),ne(!0),Ne(!0)},className:"commentModalBtn ",children:"Cancel"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),De&&Oe("")},className:"commentModalBtn ",children:"Delete"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),De?De&&g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y._firestore_id)).collection("commentsData").add({comment:De,commenter:null===se||void 0===se?void 0:se.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp()}):alert("No comment, ".concat(null===se||void 0===se?void 0:se.displayName,"! Type something")),Oe("")},className:"commentModalBtn ",children:"Comment"})]})]}),(0,b.jsx)("div",{className:" h-[70%] w-full overflow-y-scroll scrollbar-thin scrollbar-track-sky-900 scrollbar-thumb-sky-300 flex flex-col space-y-7 py-3 px-4 ",children:It&&(null===It||void 0===It?void 0:It.docs.map((function(e){return(0,b.jsx)(fn,{commentId:null===e||void 0===e?void 0:e.id,parentId:null===Y||void 0===Y?void 0:Y._firestore_id,commentData:null===e||void 0===e?void 0:e.data()})})))})]})})}),Ee&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 fixed inset-0 z-50 overflow-hidden grid place-items-center ",children:(0,b.jsxs)("div",{className:" h-[75%] w-[50%] rounded-sm bg-slate-800 border border-sky-500 mx-auto ",children:[(0,b.jsxs)("header",{className:" top-0 w-full px-3 py-1 border-b border-sky-400 flex items-center justify-between ",children:[(0,b.jsx)("h2",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:"Send a feedback"}),(0,b.jsx)("button",{onClick:Jt,className:" font-robot-slab font-bold border border-sky-400 text-sky-400 text-xl grid place-items-center rounded-3xl px-3 py-1 hover:border-sky-700 hover:text-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full flex flex-col items-center px-4 py-3 space-y-4 ",children:[(0,b.jsxs)("h1",{className:" w-full px-4 text-base font-robot-slab font-semibold text-sky-400 ",children:["Type your feedback below, ",null===se||void 0===se?void 0:se.displayName]}),(0,b.jsx)("textarea",{value:Ke,onChange:function(e){return Ze(e.target.value)},className:" h-[80%] w-[85%] mx-auto bg-sky-800 border-0 outline-none font-robot-slab font-semibold text-sky-400 text-lg rounded-md px-3 py-2 "}),(0,b.jsxs)("div",{className:" flex items-center w-full justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:Jt,className:" outline-none focus:outline-none px-3 py-2 rounded-md text-red-400 border border-red-400 font-robot-slab font-semibold hover:text-red-600 hover:border-red-600 transform transition duration-300 ease-in-out ",children:"Cancel"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),Ke&&g.h.collection("hokkienWords").doc(null===wt||void 0===wt?void 0:wt.id).collection("feedbackCollection").add({feedback:Ke,feedbackBy:null===se||void 0===se?void 0:se.displayName,addedOn:He}),Ze(""),Ve(!1),ne(!0)},className:" outline-none focus:outline-none px-3 py-2 rounded-md text-sky-400 border border-sky-400 font-robot-slab font-semibold hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Send feedback"})]})]})]})]})}),Ge&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-60 fixed inset-0 z-50 flex flex-col justify-center ",children:(0,b.jsxs)("div",{className:" h-[75%] w-[50%] flex flex-col items-center mx-auto bg-slate-900 bg-opacity-95 rounded-md border border-sky-400 ",children:[(0,b.jsxs)("header",{className:" w-full flex items-center top-0 h-[60px] px-3 py-2 justify-between border-b border-sky-400 ",children:[(0,b.jsxs)("h1",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:["Add label/s for ",null===(L=null===wt||void 0===wt?void 0:wt.data())||void 0===L?void 0:L.hokkien]}),(0,b.jsx)("button",{onClick:Ft,className:" font-robot-slab font-semibold text-sky-600 border border-sky-600 rounded-full px-3 py-1 hover:text-sky-400 hover:border-sky-400 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[80%] w-full overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 bg-sky-800 bg-opacity-30 flex flex-col items-start px-3 py-2 ",children:[(0,b.jsx)(Q,{parentId:null===wt||void 0===wt?void 0:wt.id,meaning:"labelFor1stMean"}),(null===(K=null===wt||void 0===wt?void 0:wt.data())||void 0===K?void 0:K.secondMeaning)&&(0,b.jsx)(Q,{parentId:null===wt||void 0===wt?void 0:wt.id,meaning:"labelFor2ndMean"}),(null===(Z=null===wt||void 0===wt?void 0:wt.data())||void 0===Z?void 0:Z.thirdMeaning)&&(0,b.jsx)(Q,{parentId:null===wt||void 0===wt?void 0:wt.id,meaning:"labelFor3rdMean"}),(null===(P=null===wt||void 0===wt?void 0:wt.data())||void 0===P?void 0:P.fourthMeaning)&&(0,b.jsx)(Q,{parentId:null===wt||void 0===wt?void 0:wt.id,meaning:"labelFor4thMean"}),(null===(H=null===wt||void 0===wt?void 0:wt.data())||void 0===H?void 0:H.fifthMeaning)&&(0,b.jsx)(Q,{parentId:null===wt||void 0===wt?void 0:wt.id,meaning:"labelFor5thMean"})]}),(0,b.jsxs)("footer",{className:" h-[20%] w-full flex items-center bottom-0 px-4 py-1 justify-evenly ",children:[(0,b.jsx)("button",{onClick:function(){return Je(!1)},className:" font-robot-slab font-semibold text-xl text-red-400 border border-red-400 hover:text-red-600 hover:border-red-600 focus:outline-none transform transition duration-300 ease-in-out w-[45%] px-3 py-2 rounded-md ",children:"Close"}),(0,b.jsx)("button",{onClick:Wt,className:" font-robot-slab font-semibold text-xl text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 focus:outline-none transform transition duration-300 ease-in-out w-[45%] px-3 py-2 rounde-md ",children:"Edit labels"})]})]})}),Qe&&(0,b.jsx)("div",{className:" w-full h-full bg-slate-800 bg-opacity-80 fixed inset-0 z-50 flex flex-col items-center justify-center ",children:(0,b.jsxs)("div",{className:" mx-auto h-[85%] lg:w-[50%] w-[85%] bg-slate-800 flex flex-col items-center bg-opacity-95 rounded-md border border-sky-400 ",children:[(0,b.jsxs)("header",{className:" w-full flex items-center top-0 h-[60px] px-3 py-2 justify-between border-b border-sky-400 ",children:[(0,b.jsxs)("h1",{className:" font-robot-slab font-semibold text-sky-400 text-xl ",children:["Edit label/s for ",null===(J=null===wt||void 0===wt?void 0:wt.data())||void 0===J?void 0:J.hokkien]}),(0,b.jsx)("button",{onClick:function(){qe(!1),Je(!0)},className:" font-robot-slab font-semibold text-sky-600 border border-sky-600 rounded-full px-3 py-1 hover:text-sky-400 hover:border-sky-400 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[85%] w-full overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 bg-sky-800 bg-opacity-30 flex flex-col items-start space-y-3 px-3 py-2 ",children:[Dt&&(null===Dt||void 0===Dt?void 0:Dt.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor1stMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"1st meaning",labelInput:tt,setLabelInput:nt})}))),Ut&&(null===Ut||void 0===Ut?void 0:Ut.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor2ndMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"2nd meaning",labelInput:lt,setLabelInput:at})}))),Ot&&(null===Ot||void 0===Ot?void 0:Ot.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor3rdMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"3rd meaning",labelInput:st,setLabelInput:dt})}))),_t&&(null===Ut||void 0===Ut?void 0:Ut.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor4thMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"4th meaning",labelInput:ct,setLabelInput:ut})}))),Et&&(null===Et||void 0===Et?void 0:Et.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor5thMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"5th meaning",labelInput:ht,setLabelInput:ft})}))),Vt&&(null===Vt||void 0===Vt?void 0:Vt.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor6thMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"6th meaning",labelInput:xt,setLabelInput:setLabel6th})}))),Rt&&(null===Rt||void 0===Rt?void 0:Rt.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor7thMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"7th meaning",labelInput:yt,setLabelInput:bt})}))),zt&&(null===zt||void 0===zt?void 0:zt.docs.map((function(e){return(0,b.jsx)(te,{parentId:null===wt||void 0===wt?void 0:wt.id,labelGroup:"labelFor8thMean",labelId:null===e||void 0===e?void 0:e.id,meaningTitle:"8th meaning",labelInput:gt,setLabelInput:jt})})))]}),(0,b.jsx)("footer",{className:" h-[10%] w-full flex flex-col items-center bottom-0 ",children:(0,b.jsx)("button",{onClick:function(){return qe(!1)},className:" font-robot-slab font-semibold text-xl text-red-400 border border-red-400 hover:text-red-600 hover:border-red-600 focus:outline-none transform transition duration-300 ease-in-out w-[85%] h-[60px] m-auto ",children:"Close"})})]})})]})};n(2968);function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function se(e,t,n,o,l,a,i){try{var s=e[a](i),d=s.value}catch(r){return void n(r)}s.done?t(d):Promise.resolve(d).then(o,l)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(o,l){var a=e.apply(t,n);function i(e){se(a,o,l,i,s,"next",e)}function s(e){se(a,o,l,i,s,"throw",e)}i(void 0)}))}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ce=function(){var e=re((0,j.F_)(g.fV),1)[0],t=((0,N.useRouter)(),(0,k.useState)(!1)),n=t[0],o=t[1],l=(0,k.useState)(!0),a=l[0],i=l[1],s=(0,k.useState)(""),d=s[0],r=s[1],c=(0,k.useState)(""),u=c[0],v=c[1],h=(0,k.useState)(""),f=h[0],p=h[1],x=(0,k.useState)(""),m=x[0],y=x[1],w=(0,k.useState)(""),S=w[0],T=w[1],M=(0,k.useState)(""),C=M[0],F=M[1],W=(0,k.useState)(!1),B=W[0],A=W[1],I=(0,k.useState)(""),D=I[0],U=I[1],O=(0,k.useState)(""),_=O[0],E=O[1],V=(0,k.useState)(""),R=V[0],z=V[1],L=(0,k.useState)(""),K=L[0],Z=L[1],P=(0,k.useState)(""),H=P[0],X=P[1],G=(0,k.useState)(""),J=G[0],Y=G[1],Q=(0,k.useState)(!1),q=(Q[0],Q[1],(0,k.useState)("")),ee=q[0],te=q[1],ne=(0,k.useState)(""),oe=ne[0],le=ne[1],ae=(0,k.useState)(""),ie=ae[0],se=ae[1],ce=(0,k.useState)(""),ue=ce[0],ve=ce[1],he=(0,k.useState)(""),fe=he[0],pe=he[1],xe=(0,k.useState)(""),me=xe[0],ye=xe[1],be=(0,k.useState)(null),ke=be[0],ge=be[1],je=(0,k.useState)(null),Ne=je[0],we=je[1],Se=(0,k.useState)(""),Te=Se[0],Me=Se[1],Ce=(0,k.useState)(!1),Fe=Ce[0],We=Ce[1],Be=function(){var e=de($().mark((function e(){var t,n,o;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices.getUserMedia)){e.next=19;break}return e.prev=1,e.next=5,null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia({audio:!0});case 5:n=e.sent,o=new MediaRecorder(n),we(o),o.start(),We(!0),o.ondataavailable=function(e){ge(null===e||void 0===e?void 0:e.data);var t=URL.createObjectURL(null===e||void 0===e?void 0:e.data);Me(t)},null===o||void 0===o||(o.onstop=function(){var e;null===(e=null===n||void 0===n?void 0:n.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),alert("Error accessing microphone: ",e.t0);case 17:e.next=20;break;case 19:alert("MediaDevices API not supported on this browser");case 20:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}(),Ae=function(){var e=de($().mark((function e(){var t,n,o;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ge(null),!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices.getUserMedia)){e.next=20;break}return e.prev=2,e.next=6,null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia({audio:!0});case 6:n=e.sent,o=new MediaRecorder(n),we(o),o.start(),We(!0),o.ondataavailable=function(e){ge(null===e||void 0===e?void 0:e.data);var t=URL.createObjectURL(null===e||void 0===e?void 0:e.data);Me(t)},null===o||void 0===o||(o.onstop=function(){var e;null===(e=null===n||void 0===n?void 0:n.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),alert("Error accessing microphone: ",e.t0);case 18:e.next=21;break;case 20:alert("MediaDevices API not supported on this browser");case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(){return e.apply(this,arguments)}}(),Ie=function(){a&&i(!1),A(!0)},De=function(){B&&A(!1),0==a&&i(!0)},Ue=function(e){e.preventDefault(),o(!1),(d||u||f||C||m||S||_||D||K||R||J||H||ee||oe||ie||ue||fe||me||Te||ke)&&(r("")||v("")||p("")||y("")||T("")||F("")||U("")||E("")||z("")||Z("")||X("")||Y("")||te("")||le("")||se("")||ve("")||pe("")||ye("")||ge(null)||Me(null))},Oe=((new Date).toLocaleDateString(),function(t){(t.preventDefault(),d&&f&&m&&S&&_&&D)?(g.h.collection("hokkienWords").where("hokkien","==",d).get().then((function(t){(null===t||void 0===t?void 0:t.empty)?(g.h.collection("hokkienWords").add({hokkien:d,hanzi:f,taiLo:C,lannang:m,poj:S,type:D,meaning:_,addedBy:null===e||void 0===e?void 0:e.displayName}).then((function(t){if(u&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).set({variants:u},{merge:!0}),R&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).set({secondType:R,secondMeaning:K},{merge:!0}),H&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).set({thirdType:H,thirdMeaning:J},{merge:!0}),ke)try{var n=g.tO.ref("/hokkienWords/".concat(null===t||void 0===t?void 0:t.id,"/").concat(d,".webm"));n.put(ke).then((function(){return n.getDownloadURL()})).then((function(e){return g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).set({pronunciation:e},{merge:!0})}))}catch(o){alert("Error in uploading audio: ",o)}ee&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("synonymsFor1stMean").add({synonym:ee}),oe&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("synonymsFor2ndMean").add({synonym:oe}),ie&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("synonymsFor3rdMean").add({synonym:ie}),ue&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("labelFor1stMean").add({label:ue}),fe&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("labelFor2ndMean").add({label:fe}),me&&g.h.collection("hokkienWords").doc(null===t||void 0===t?void 0:t.id).collection("labelFor3rdMean").add({label:me}),g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({hokkien:d,taiLo:C,hanzi:f,lannang:m,poj:S,type:D,meaning:_},{merge:!0}).then((function(n){u&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({variants:u},{merge:!0}),R&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({secondType:R,secondMeaning:K},{merge:!0}),H&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({thirdType:H,thirdMeaning:J},{merge:!0}),ue&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({firstLabel:ue,labelGroup:"labelFor1stMean"},{merge:!0}),fe&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({secLabel:fe,labelGroup:"labelFor2ndMean"},{merge:!0}),me&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({thirdLabel:me,labelGroup:"labelFor3rdMean"},{merge:!0}),ee&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({firstSyn:ee},{merge:!0}),oe&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({secondSyn:oe},{merge:!0}),ie&&g.h.collection("wordsByUser").doc(null===e||void 0===e?void 0:e.displayName).collection("inputs").doc(null===t||void 0===t?void 0:t.id).set({thirdSyn:ie},{merge:!0})}))})),r(""),F(""),p(""),y(""),T(""),U(""),E(""),u&&v(""),R&&z(""),K&&Z(""),H&&X(""),J&&Y(""),ue&&ve(""),fe&&pe(""),me&&ye(""),ee&&te(""),oe&&le(""),ie&&se(""),ke&&ge(""),Te&&Me("")):(null===t||void 0===t?void 0:t.empty)||alert("The word, or something synonymous, already exists. Try searching then editing the word, or adding the notes via the folder icon at the search result")})),o(!1)):(alert("Error in your input, ".concat(null===e||void 0===e?void 0:e.displayName,". Try again")),Ue())}),_e=(0,k.useState)(!1),Ee=_e[0],Ve=_e[1],Re=function(){var t=de($().mark((function t(){var n,o;return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=12;break}return t.prev=1,t.next=4,g.h.collection("editors").where("editorEmail","==",null===e||void 0===e?void 0:e.email).get();case 4:n=t.sent,o=(null===n||void 0===n?void 0:n.size)>0,Ve(o),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error checking editor status: ",t.t0);case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(){return t.apply(this,arguments)}}();return(0,k.useEffect)((function(){Re()}),[e]),(0,b.jsxs)(b.Fragment,{children:[e&&Ee&&(0,b.jsx)("button",{onClick:function(){return o(!0)},className:" h-[50px] w-[45%] mx-auto rounded-md lg:text-lg text-base bg-sky-600 text-sky-100 hover:bg-sky-400 hover:text-sky-50 focus:outline-none font-robot-slab font-semibold transform transition duration-300 ease-in-out flex items-center space-x-4 justify-center ",children:"Add word"}),n&&(0,b.jsxs)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 flex flex-col items-center fixed z-50 inset-0 ",children:[(0,b.jsxs)("div",{className:" addModalLg ",children:[(0,b.jsxs)("header",{className:" bg-slate-800 top-0 flex flex-col space-y-2 w-full border-b border-sky-400 min-h-[120px] max-h-[140px] ",children:[(0,b.jsxs)("div",{className:" w-full flex items-center justify-between px-3 py-2 border-b border-sky-400 ",children:[(0,b.jsxs)("ah1",{className:" font-robot-slab font-semibold text-xl text-sky-400 ",children:["Add a new word, ",null===e||void 0===e?void 0:e.displayName]}),(0,b.jsx)("button",{onClick:function(){return o(!1)},className:" font-robot-slab font-semibold text-xl text-sky-400 rounded-full border border-sky-400 hover:text-sky-600 hover:border-sky-600 transfrm transition duration-300 ease-in-out px-3 py-1 ",children:"X"})]}),(0,b.jsxs)("div",{className:" min-h-[60px] max-h-[100px] w-full flex items-center justify-evenly px-3 border-sky-400 overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsx)("button",{onClick:De,className:"min-w-[490px] min-h-[60px] focus:outline-none font-robot-slab font-bold text-xl text-sky-400 hover:text-sky-600 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out",children:"First Tab"}),(0,b.jsx)("button",{onClick:Ie,className:"min-w-[490px] min-h-[60px] focus:outline-none font-robot-slab font-bold text-xl text-sky-400 hover:text-sky-600 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out",children:"Second Tab"})]})]}),(0,b.jsxs)("div",{className:" h-[75%] w-full ",children:[a&&(0,b.jsxs)("div",{className:" h-full w-full flex flex-col space-y-4 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 px-4 py-3 bg-slate-900 bg-opacity-20 ",children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Hokkien"}),(0,b.jsx)("input",{placeholder:"Hokkien...",value:d,onChange:function(e){return r(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Variant/s"}),(0,b.jsx)("input",{placeholder:"Variant/s...",value:u,onChange:function(e){return v(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Numbered Tai-lo"}),(0,b.jsx)("input",{placeholder:"Numbered tai-lo...",value:C,onChange:function(e){return F(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Hanzi"}),(0,b.jsx)("input",{placeholder:"Hanzi...",value:f,onChange:function(e){return p(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Lannang"}),(0,b.jsx)("input",{placeholder:"Lannang...",value:m,onChange:function(e){return y(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"POJ"}),(0,b.jsx)("input",{placeholder:"POJ...",value:S,onChange:function(e){return T(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Audio"}),(0,b.jsxs)("span",{className:" w-full flex items-center px-4 justify-evenly border border-sky-400 py-3 ",children:[Fe&&(0,b.jsxs)("div",{className:" flex items-center text-lg text-red-500 ",children:[(0,b.jsx)("span",{className:" w-[10px] h-[10px] bg-red-500 rounded-lg mr-8 animate-pulse "}),"Recording"]}),ke||Te?(0,b.jsx)("button",{onClick:Ae,disabled:Fe,className:" border border-sky-400 text-lg font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Re-record"}):(!ke||!Te)&&(0,b.jsx)("button",{onClick:Be,disabled:Fe,className:" border border-sky-400 text-lg font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Start recording"}),ke&&Te?(ke||Te)&&(0,b.jsx)("button",{onClick:function(){ke&&ge(null),Te&&Me("")},disabled:Fe,className:" border border-red-400 font-robot-slab font-normal text-lg text-red-400 px-3 py-2 ",children:"Delete"}):(0,b.jsx)("button",{onClick:function(){Ne&&(null===Ne||void 0===Ne||Ne.stop(),We(!1))},disabled:!Fe,className:" border border-red-400 font-robot-slab font-normal text-lg text-red-400 px-3 py-2 ",children:"Stop recording"}),Te&&(0,b.jsx)("audio",{controls:!0,src:Te})]})]})]}),B&&(0,b.jsxs)("div",{className:" h-full w-full flex flex-col space-y-4 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 px-4 py-3 bg-slate-900 bg-opacity-20 ",children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"First meaning type"}),(0,b.jsx)("input",{placeholder:"First meaning type...",value:D,onChange:function(e){return U(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for first meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:ue,onChange:function(e){return ve(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"First meaning"}),(0,b.jsx)("textarea",{placeholder:"First meaning...",value:_,onChange:function(e){return E(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for first meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:ee,onChange:function(e){return te(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Second meaning type"}),(0,b.jsx)("input",{placeholder:"Second meaning type...",value:R,onChange:function(e){return z(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),R&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for second meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:fe,onChange:function(e){return pe(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Second meaning"}),(0,b.jsx)("textarea",{placeholder:"Second meaning...",value:K,onChange:function(e){return Z(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for second meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:oe,onChange:function(e){return le(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]})]}),R&&(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Third meaning type"}),(0,b.jsx)("input",{placeholder:"Third meaning type...",value:H,onChange:function(e){return X(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]})}),H&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for third meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:me,onChange:function(e){return ye(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Third meaning"}),(0,b.jsx)("textarea",{placeholder:"Third meaning...",value:J,onChange:function(e){return Y(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for third meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:ie,onChange:function(e){return se(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]})]})]})]}),(0,b.jsxs)("footer",{className:" bottom-0 sticky bg-inherit flex items-center justify-evenly border-t border-sky-600 min-h-[50px] max-h-[75px] rounded-b-lg w-full px-3 ",children:[(0,b.jsx)("button",{onClick:Ue,className:" focus:outline-none w-[45%] rounded-md border border-red-500 bg-slate-800 text-red-500 text-xl font-robot-slab font-normal hover:border-red-700 hover:text-red-700 transform transition duration-300 ease-in-out ",children:"Cancel"}),(0,b.jsx)("button",{onClick:Oe,className:" focus:outline-none w-[45%] rounded-md border border-green-500 bg-slate-800 text-green-500 text-xl font-robot-slab font-normal hover:border-green-300 hover:text-green-300 transform transition duration-300 ease-in-out ",children:"Upload"})]})]}),(0,b.jsxs)("div",{className:" addModalMb ",children:[(0,b.jsxs)("header",{className:" bg-slate-800 top-0 flex flex-col w-full border-b border-sky-400 min-h-[75px] ",children:[(0,b.jsxs)("div",{className:" h-[50%] w-full flex items-center justify-between px-3 py-2 border-b border-sky-400 ",children:[(0,b.jsxs)("h1",{className:" font-robot-slab font-semibold text-xl text-sky-400 ",children:["Add a new word, ",null===e||void 0===e?void 0:e.displayName]}),(0,b.jsx)("button",{onClick:function(){return o(!1)},className:" font-robot-slab font-semibold text-xl text-sky-400 rounded-full border border-sky-400 hover:text-sky-600 hover:border-sky-600 transfrm transition duration-300 ease-in-out px-3 py-1 ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[50%] w-full flex items-center justify-evenly px-3 py-2 border-sky-400 overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsx)("button",{onClick:De,className:"min-w-[290px] focus:outline-none font-robot-slab font-bold text-xl text-sky-400 hover:text-sky-600 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out",children:"First Tab"}),(0,b.jsx)("button",{onClick:Ie,className:"min-w-[290px] focus:outline-none font-robot-slab font-bold text-xl text-sky-400 hover:text-sky-600 border border-sky-400 hover:border-sky-600 transform transition duration-300 ease-in-out",children:"Second Tab"})]})]}),(0,b.jsxs)("div",{className:" h-[75%] w-full ",children:[a&&(0,b.jsxs)("div",{className:" h-full w-full flex flex-col space-y-4 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 px-4 py-3 ",children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Hokkien"}),(0,b.jsx)("input",{placeholder:"Hokkien...",value:d,onChange:function(e){return r(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Variant/s"}),(0,b.jsx)("input",{placeholder:"Variant/s...",value:u,onChange:function(e){return v(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Numbered Tai-lo"}),(0,b.jsx)("input",{placeholder:"Numbered tai-lo...",value:C,onChange:function(e){return F(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Hanzi"}),(0,b.jsx)("input",{placeholder:"Hanzi...",value:f,onChange:function(e){return p(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Lannang"}),(0,b.jsx)("input",{placeholder:"Lannang...",value:m,onChange:function(e){return y(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"POJ"}),(0,b.jsx)("input",{placeholder:"POJ...",value:S,onChange:function(e){return T(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]})]}),B&&(0,b.jsxs)("div",{className:" h-[90%] w-full flex flex-col space-y-4 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 px-4 py-3 ",children:[(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"First meaning type"}),(0,b.jsx)("input",{placeholder:"First meaning type...",value:D,onChange:function(e){return U(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for first meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:ue,onChange:function(e){return ve(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"First meaning"}),(0,b.jsx)("textarea",{placeholder:"First meaning...",value:_,onChange:function(e){return E(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for first meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:ee,onChange:function(e){return te(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Second meaning type"}),(0,b.jsx)("input",{placeholder:"Second meaning type...",value:R,onChange:function(e){return z(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for second meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:fe,onChange:function(e){return pe(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Second meaning"}),(0,b.jsx)("textarea",{placeholder:"Second meaning...",value:K,onChange:function(e){return Z(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for second meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:oe,onChange:function(e){return le(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Third meaning type"}),(0,b.jsx)("input",{placeholder:"Third meaning type...",value:H,onChange:function(e){return X(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Label for third meaning"}),(0,b.jsx)("input",{placeholder:"Label...",value:me,onChange:function(e){return ye(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[50px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Third meaning"}),(0,b.jsx)("textarea",{placeholder:"Third meaning...",value:J,onChange:function(e){return Y(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-2 items-start ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-black text-xl text-sky-400 ",children:"Synonym/s for third meaning"}),(0,b.jsx)("textarea",{placeholder:"Synonym/s...",value:ie,onChange:function(e){return se(e.target.value)},type:"text",className:" w-[90%] mx-auto h-[250px] rounded-md bg-slate-900 border border-sky-500 outline-none focus:outline-none font-robot-slab font-semibold text-lg text-sky-500 px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-sky-400 scrollbar-track-slate-800 "})]})]})]}),(0,b.jsxs)("footer",{className:" bottom-0 flex items-center justify-between border-t border-sky-600 min-h-[75px] bg-slate-800 w-full px-3 py-2 z-50 sticky ",children:[(0,b.jsx)("button",{onClick:Ue,className:" focus:outline-none w-[45%] rounded-md border border-red-500 bg-slate-800 text-red-500 text-xl font-robot-slab font-normal hover:border-red-700 hover:text-red-700 transform transition duration-300 ease-in-out h-[45px] ",children:"Cancel"}),(0,b.jsx)("button",{onClick:Oe,className:" focus:outline-none w-[45%] rounded-md border border-green-500 bg-slate-800 text-green-500 text-xl font-robot-slab font-normal hover:border-green-300 hover:text-green-300 transform transition duration-300 ease-in-out h-[45px] ",children:"Upload"})]})]})]})]})},ue=(n(919),n(4575));(0,ue.Z)((function(e){var t=e.currentRefinement,n=(e.isSearchStalled,e.refine);return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-800 bg-opacity-80 px-4 py-3 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search here...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-300 font-robot-slab font-normal text-lg "})})}));function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function he(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ve(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fe=function(e){var t,n,o,l,a=e.hit,i=he((0,j.F_)(g.fV),1)[0],s=((0,N.useRouter)(),(0,k.useState)(!1)),d=s[0],r=s[1],c=he((0,M.ky)(g.h.doc("hokkienWords/".concat(null===a||void 0===a?void 0:a._firestore_id))),3),u=c[0];return c[1],c[2],(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" pageResDiv ",children:[(0,b.jsxs)("header",{className:" w-full h-[60px] border-b border-sky-200 px-3 py-2 flex items-center justify-between ",children:[(0,b.jsx)("span",{children:("Reaper IFF"==(null===i||void 0===i?void 0:i.displayName)||"rumlowb@gmail.com"==(null===i||void 0===i?void 0:i.email)||"sygrandkaiser@gmail.com"==(null===i||void 0===i?void 0:i.email)||"marvin_sy@dlsu.edu.ph"==(null===i||void 0===i?void 0:i.email))&&(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-100 text-lg ",children:null===(t=null===u||void 0===u?void 0:u.data())||void 0===t?void 0:t.taiLo})}),(0,b.jsx)("button",{onClick:function(){return r(!0)},className:"mobSearchResBtn ",children:(0,b.jsx)(h.bBz,{style:{fontSize:"1.3em",color:"whitesmoke"}})})]}),(0,b.jsxs)("body",{className:" h-full w-full flex flex-col space-y-3 px-2 py-1 ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center justify-between ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-2xl text-sky-300 ",children:null===(n=null===u||void 0===u?void 0:u.data())||void 0===n?void 0:n.hokkien}),(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-2xl text-sky-400 ",children:null===(o=null===u||void 0===u?void 0:u.data())||void 0===o?void 0:o.hanzi})]}),(0,b.jsx)("h4",{className:" font-path-ex font-semibold text-lg text-sky-400 ",children:null===(l=null===u||void 0===u?void 0:u.data())||void 0===l?void 0:l.meaning})]})]},null===u||void 0===u?void 0:u.id),d&&(0,b.jsx)("div",{className:" h-full w-full z-50 inset-0 fixed bg-slate-800 bg-opacity-75 overflow-hidden flex flex-col items-center justify-center ",children:(0,b.jsx)("div",{className:" h-[85%] w-[95%] bg-slate-800 border border-sky-300 rounded mx-auto "})})]})};function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var me=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,w,S,T,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,$,X,G,J,Y,Q,q,ee,te,ne,oe,le,ae,ie,se=e.hit,de=xe((0,j.F_)(g.fV),1)[0],re=(0,N.useRouter)(),ce=(0,k.useState)(!1),ue=ce[0],ve=ce[1],he=(0,k.useState)(!1),fe=he[0],pe=he[1],me=(0,k.useState)(""),ye=me[0],be=me[1],ke=(0,k.useState)(""),ge=ke[0],je=ke[1],Ne=(0,k.useState)(""),we=Ne[0],Se=Ne[1],Te=(0,k.useState)(""),Me=Te[0],Ce=Te[1],Fe=(0,k.useState)(""),We=Fe[0],Be=Fe[1],Ae=(0,k.useState)(!1),Ie=Ae[0],De=Ae[1],Ue=(0,k.useState)(""),Oe=(Ue[0],Ue[1],(0,k.useState)("")),_e=(Oe[0],Oe[1],(0,k.useState)("")),Ee=(_e[0],_e[1],(0,k.useState)("")),Ve=(Ee[0],Ee[1],(0,k.useState)("")),Re=(Ve[0],Ve[1],(0,k.useState)("")),ze=(Re[0],Re[1],xe((0,M.ky)(g.h.doc("hokkienWords/".concat(null===se||void 0===se?void 0:se._firestore_id))),3)),Le=ze[0];return ze[1],ze[2],(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{onClick:function(){return ve(!0)},className:" pageResDesktop ",children:[("Reaper IFF"==(null===de||void 0===de?void 0:de.displayName)||"rumlowb@gmail.com"==(null===de||void 0===de?void 0:de.email)||"sygrandkaiser@gmail.com"==(null===de||void 0===de?void 0:de.email)||"marvin_sy@dlsu.edu.ph"==(null===de||void 0===de?void 0:de.email))&&(0,b.jsx)("header",{className:" border-b border-sky-100 h-[60px] w-full justify-between px-3 py-2 ",children:(0,b.jsxs)("h3",{className:" font-fira-sans font-normal text-sky-100 text-xl ",children:["Added by ",null===(t=null===Le||void 0===Le?void 0:Le.data())||void 0===t?void 0:t.addedBy]})}),(0,b.jsxs)("body",{className:" h-full w-full flex flex-col space-y-3 px-3 py-2 ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center justify-between py-2 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-2xl text-sky-300 ",children:null===(n=null===Le||void 0===Le?void 0:Le.data())||void 0===n?void 0:n.hokkien}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-2xl text-sky-500 ",children:null===(o=null===Le||void 0===Le?void 0:Le.data())||void 0===o?void 0:o.hanzi})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-4 w-full ",children:[(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-400 ",children:null===(l=null===Le||void 0===Le?void 0:Le.data())||void 0===l?void 0:l.type}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 ",children:null===(a=null===Le||void 0===Le?void 0:Le.data())||void 0===a?void 0:a.meaning})]})]})]},null===Le||void 0===Le?void 0:Le.id),ue&&(0,b.jsx)("div",{className:" spresDesktop ",children:(0,b.jsxs)("div",{className:" spresReadMoreRedux ",children:[(0,b.jsxs)("header",{className:" h-[60px] w-full border-b-2 border-sky-400 flex items-center px-3 py-1 justify-between ",children:[(0,b.jsxs)("h2",{className:" text-lg text-sky-300 font-fira-sans font-normal ",children:["Added by  ",null===(i=null===Le||void 0===Le?void 0:Le.data())||void 0===i?void 0:i.addedBy]}),(0,b.jsx)("button",{onClick:function(){return ve(!1)},className:" px-3 py-1 rounded-full grid place-items-center font-fira-sans font-bold text-xl text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 focus:outline-none focus:border-sky-300 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("body",{className:" h-[85%] w-full flex flex-col items-start px-3 py-2 space-y-3 ",children:[(0,b.jsxs)("div",{className:" w-[85%] h-[300px] mx-auto px-3 flex flex-col ",children:[(0,b.jsxs)("header",{className:" top-0 flex items-center justify-between ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ve(!1),pe(!0)},className:" w-[240px] py-2 rounded-md font-fira-sans font-semibold text-lg text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sk-600 focus:outline-none active:outline-none transform transition duration-300 ease-in-out ",children:"Edit detail/s"})]}),(0,b.jsxs)("div",{className:" h-full w-full flex items-center justify-between ",children:[(0,b.jsxs)("span",{className:" flex flex-col items-start space-y-4 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-400 text-4xl ",children:null===(s=null===Le||void 0===Le?void 0:Le.data())||void 0===s?void 0:s.hokkien}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-500 text-2xl ",children:null===(d=null===Le||void 0===Le?void 0:Le.data())||void 0===d?void 0:d.hanzi}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-500 text-xl ",children:null===(r=null===Le||void 0===Le?void 0:Le.data())||void 0===r?void 0:r.variants})]}),(0,b.jsxs)("span",{className:" flex flex-col items-end space-y-4 ",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-sky-300 text-lg ",children:"Lannang:"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-200 text-xl ",children:null===(c=null===Le||void 0===Le?void 0:Le.data())||void 0===c?void 0:c.lannang})]}),(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-sky-300 text-lg ",children:"POJ:"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-200 text-xl ",children:null===(u=null===Le||void 0===Le?void 0:Le.data())||void 0===u?void 0:u.poj})]}),("Reaper IFF"==(null===de||void 0===de?void 0:de.displayName)||"rumlowb@gmail.com"==(null===de||void 0===de?void 0:de.email)||"sygrandkaiser@gmail.com"==(null===de||void 0===de?void 0:de.email)||"marvin_sy@dlsu.edu.ph"==(null===de||void 0===de?void 0:de.email))&&(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-sky-300 text-lg ",children:"Tai-lo (#):"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-200 text-xl ",children:null===(v=null===Le||void 0===Le?void 0:Le.data())||void 0===v?void 0:v.taiLo})]})]})]})]}),(0,b.jsxs)("div",{className:" flex flex-col h-[75%] w-full ",children:[(0,b.jsxs)("header",{className:" w-full border-b border-sky-400 flex items-center justify-between px-3 py-1 ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-normal text-xl text-sky-500 ",children:"Meaning/s"}),("Reaper IFF"==(null===de||void 0===de?void 0:de.displayName)||"rumlowb@gmail.com"==(null===de||void 0===de?void 0:de.email)||"sygrandkaiser@gmail.com"==(null===de||void 0===de?void 0:de.email)||"marvin_sy@dlsu.edu.ph"==(null===de||void 0===de?void 0:de.email))&&(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ve(!1),De(!0)},className:" rounded border font-fira-sans font-normal border-sky-400 text-sky-400 px-3 py-1 grid place-items-center hover:border-sky-600 hover:text-sky-600 transform transition duration-300 ease-in-out ",children:"Edit meaning/s"})]}),(0,b.jsxs)("div",{className:" h-[85%] w-full space-y-8 px-3 py-4 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-700 ",children:[(0,b.jsx)(jn,{type:null===(h=null===Le||void 0===Le?void 0:Le.data())||void 0===h?void 0:h.type,meaning:null===(f=null===Le||void 0===Le?void 0:Le.data())||void 0===f?void 0:f.meaning}),(null===(p=null===Le||void 0===Le?void 0:Le.data())||void 0===p?void 0:p.secondType)&&(0,b.jsx)(jn,{type:null===(x=null===Le||void 0===Le?void 0:Le.data())||void 0===x?void 0:x.secondType,meaning:null===(m=null===Le||void 0===Le?void 0:Le.data())||void 0===m?void 0:m.secondMeaning}),(null===(y=null===Le||void 0===Le?void 0:Le.data())||void 0===y?void 0:y.thirdType)&&(0,b.jsx)(jn,{type:null===(w=null===Le||void 0===Le?void 0:Le.data())||void 0===w?void 0:w.thirdType,meaning:null===(S=null===Le||void 0===Le?void 0:Le.data())||void 0===S?void 0:S.thirdMeaning}),(null===(T=null===Le||void 0===Le?void 0:Le.data())||void 0===T?void 0:T.fourthType)&&(0,b.jsx)(jn,{type:null===(C=null===Le||void 0===Le?void 0:Le.data())||void 0===C?void 0:C.fourthType,meaning:null===(F=null===Le||void 0===Le?void 0:Le.data())||void 0===F?void 0:F.fourthMeaning}),(null===(W=null===Le||void 0===Le?void 0:Le.data())||void 0===W?void 0:W.fifthType)&&(0,b.jsx)(jn,{type:null===(B=null===Le||void 0===Le?void 0:Le.data())||void 0===B?void 0:B.fifthType,meaning:null===(A=null===Le||void 0===Le?void 0:Le.data())||void 0===A?void 0:A.fifthMeaning}),(null===(I=null===Le||void 0===Le?void 0:Le.data())||void 0===I?void 0:I.sixthType)&&(0,b.jsx)(jn,{type:null===(D=null===Le||void 0===Le?void 0:Le.data())||void 0===D?void 0:D.sixthType,meaning:null===(U=null===Le||void 0===Le?void 0:Le.data())||void 0===U?void 0:U.sixthMeaning}),(null===(O=null===Le||void 0===Le?void 0:Le.data())||void 0===O?void 0:O.seventhType)&&(0,b.jsx)(jn,{type:null===(_=null===Le||void 0===Le?void 0:Le.data())||void 0===_?void 0:_.seventhType,meaning:null===(E=null===Le||void 0===Le?void 0:Le.data())||void 0===E?void 0:E.seventhMeaning}),(null===(V=null===Le||void 0===Le?void 0:Le.data())||void 0===V?void 0:V.eighthType)&&(0,b.jsx)(jn,{type:null===(R=null===Le||void 0===Le?void 0:Le.data())||void 0===R?void 0:R.eighthType,meaning:null===(z=null===Le||void 0===Le?void 0:Le.data())||void 0===z?void 0:z.eighthMeaning}),(null===(L=null===Le||void 0===Le?void 0:Le.data())||void 0===L?void 0:L.ninthType)&&(0,b.jsx)(jn,{type:null===(K=null===Le||void 0===Le?void 0:Le.data())||void 0===K?void 0:K.ninthType,meaning:null===(Z=null===Le||void 0===Le?void 0:Le.data())||void 0===Z?void 0:Z.ninthMeaning}),(null===(P=null===Le||void 0===Le?void 0:Le.data())||void 0===P?void 0:P.tenthType)&&(0,b.jsx)(jn,{type:null===(H=null===Le||void 0===Le?void 0:Le.data())||void 0===H?void 0:H.tenthType,meaning:null===($=null===Le||void 0===Le?void 0:Le.data())||void 0===$?void 0:$.tenthMeaning})]})]})]}),(0,b.jsxs)("footer",{className:" h-[60px] w-full border-t-2 bottom-0 z-50 sticky border-sky-400 flex items-center px-3 py-1 justify-between",children:[(0,b.jsx)("h1",{}),(0,b.jsx)("button",{onClick:function(){return re.push("/word/".concat(null===Le||void 0===Le?void 0:Le.id))},className:" px-3 py-1 rounded grid place-items-center font-fira-sans font-semibold text-xl text-sky-400 border border-sky-400 hover:text-sky-600 hover:border-sky-600 focus:outline-none focus:border-sky-300 transform transition duration-300 ease-in-out ",children:"Read more"})]})]})}),fe&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 grid z-50 place-items-center fixed inset-0 ",children:(0,b.jsxs)("main",{className:" h-[80%] w-[65%] bg-sky-900 bg-opacity-90 flex flex-col rounded border border-sky-100 ",children:[(0,b.jsxs)("header",{className:" w-full flex items-center justify-between border-b border-sky-100 px-3 py-2 h-[60px] ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-600 text-xl ",children:"Edit word detail"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ve(!0),pe(!1)},className:" rounded-full border font-fira-sans font-normal border-sky-600 text-sky-600 px-3 py-1 grid place-items-center hover:border-sky-800 hover:text-sky-800 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("body",{className:" h-full w-full flex flex-col items-center space-y-7 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 ",children:[(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsxs)("span",{className:" flex items-center justify-center w-[50%] mx-auto space-x-14 ",children:[(0,b.jsx)("h2",{className:"spresEditTitle",children:"Hokkien:"}),(0,b.jsx)("h1",{className:"spresDataReturn",children:null===(X=null===Le||void 0===Le?void 0:Le.data())||void 0===X?void 0:X.hokkien})]}),(0,b.jsx)("input",{value:ye,onChange:function(e){return be(e.target.value)},type:"text",className:"spresDataInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ye?g.h.collection("hokkienWords").doc(null===Le||void 0===Le?void 0:Le.id).set({hokkien:ye},{merge:!0}):alert("No hokkien data detected. Retype again"),be("")},className:"spresDataEditBtn",children:"Edit"})]})]}),(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsxs)("span",{className:" flex items-center justify-center w-[50%] mx-auto space-x-14 ",children:[(0,b.jsx)("h2",{className:"spresEditTitle",children:"Hanzi"}),(0,b.jsx)("h1",{className:"spresDataReturn",children:null===(G=null===Le||void 0===Le?void 0:Le.data())||void 0===G?void 0:G.hanzi})]}),(0,b.jsx)("input",{value:ge,onChange:function(e){return je(e.target.value)},type:"text",className:"spresDataInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ge?g.h.collection("hokkienWords").doc(null===Le||void 0===Le?void 0:Le.id).set({hanzi:ge},{merge:!0}):alert("No hanzi data detected. Retype again"),je("")},className:"spresDataEditBtn",children:"Edit"})]})]}),(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsxs)("span",{className:" flex items-center justify-center w-[50%] mx-auto space-x-14 ",children:[(0,b.jsx)("h2",{className:"spresEditTitle",children:"Lannang"}),(0,b.jsx)("h1",{className:"spresDataReturn",children:null===(J=null===Le||void 0===Le?void 0:Le.data())||void 0===J?void 0:J.lannang})]}),(0,b.jsx)("input",{type:"text",value:we,onChange:function(e){return Se(e.target.value)},className:"spresDataInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),we?g.h.collection("hokkienWords").doc(null===Le||void 0===Le?void 0:Le.id).set({lannang:we},{merge:!0}):alert("No lannang data detected. Retype again"),Se("")},className:"spresDataEditBtn",children:"Edit"})]})]}),(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsxs)("span",{className:" flex items-center justify-center w-[50%] mx-auto space-x-14 ",children:[(0,b.jsx)("h2",{className:"spresEditTitle",children:"POJ"}),(0,b.jsx)("h1",{className:"spresDataReturn",children:null===(Y=null===Le||void 0===Le?void 0:Le.data())||void 0===Y?void 0:Y.poj})]}),(0,b.jsx)("input",{type:"text",className:"spresDataInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),Me?g.h.collection("hokkienWords").doc(null===Le||void 0===Le?void 0:Le.id).set({poj:Me},{merge:!0}):alert("No POJ detected. Retype again"),Ce("")},className:"spresDataEditBtn",children:"Edit"})]})]}),(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsxs)("span",{className:" flex items-center justify-center w-[50%] mx-auto space-x-14 ",children:[(0,b.jsx)("h2",{className:"spresEditTitle",children:"Tai-lo"}),(0,b.jsx)("h1",{className:"spresDataReturn",children:null===(Q=null===Le||void 0===Le?void 0:Le.data())||void 0===Q?void 0:Q.taiLo})]}),(0,b.jsx)("input",{type:"text",value:We,onChange:function(e){return Be(e.target.value)},className:"spresDataInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),We?taiLo&&(g.h.collection("hokkienWords").doc(null===Le||void 0===Le?void 0:Le.id).set({taiLo:We},{merge:!0}),Be("")):alert("No Tai-lo detected. Retype again")},className:"spresDataEditBtn",children:"Edit"})]})]})]})]})}),Ie&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-80 grid place-items-center fixed inset-0 z-50 ",children:(0,b.jsxs)("main",{className:" h-[80%] w-[85%] bg-sky-900 bg-opacity-90 flex flex-col rounded border border-sky-100 mx-auto ",children:[(0,b.jsxs)("header",{className:" w-full flex items-center justify-between border-b border-sky-100 px-3 py-2 h-[60px] ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-600 text-xl ",children:"Edit word meaning/s"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),ve(!0),De(!1)},className:" rounded-full border font-fira-sans font-normal border-sky-600 text-sky-600 px-3 py-1 grid place-items-center hover:border-sky-800 hover:text-sky-800 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("body",{className:" h-full w-full flex flex-col items-center space-y-7 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 ",children:[(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-3xl text-sky-500 ",children:null===(q=null===Le||void 0===Le?void 0:Le.data())||void 0===q?void 0:q.type}),(0,b.jsx)("h3",{className:" font-fira-sans font-bold text-2xl text-sky-600 ",children:null===(ee=null===Le||void 0===Le?void 0:Le.data())||void 0===ee?void 0:ee.meaning}),(0,b.jsx)("textarea",{className:" h-[240px] w-[90%] mx-auto bg-slate-800 rounded-md border border-sky-500 overflow-y-scroll scrollbar-hide px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full justify-between flex items-center px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{className:"spresDataEditBtn",children:"Edit"})]})]}),(null===(te=null===Le||void 0===Le?void 0:Le.data())||void 0===te?void 0:te.secondType)&&(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-3xl text-sky-500 ",children:null===(ne=null===Le||void 0===Le?void 0:Le.data())||void 0===ne?void 0:ne.secondType}),(0,b.jsx)("h3",{className:" font-fira-sans font-bold text-2xl text-sky-600 ",children:null===(oe=null===Le||void 0===Le?void 0:Le.data())||void 0===oe?void 0:oe.secondMeaning}),(0,b.jsx)("textarea",{className:" h-[240px] w-[90%] mx-auto bg-slate-800 rounded-md border border-sky-500 overflow-y-scroll scrollbar-hide px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full justify-between flex items-center px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{className:"spresDataEditBtn",children:"Edit"})]})]}),(null===(le=null===Le||void 0===Le?void 0:Le.data())||void 0===le?void 0:le.thirdType)&&(0,b.jsxs)("span",{className:"spresEditSpan",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-3xl text-sky-500 ",children:null===(ae=null===Le||void 0===Le?void 0:Le.data())||void 0===ae?void 0:ae.thirdType}),(0,b.jsx)("h3",{className:" font-fira-sans font-bold text-2xl text-sky-600 ",children:null===(ie=null===Le||void 0===Le?void 0:Le.data())||void 0===ie?void 0:ie.thirdMeaning}),(0,b.jsx)("textarea",{className:" h-[240px] w-[90%] mx-auto bg-slate-800 rounded-md border border-sky-500 overflow-y-scroll scrollbar-hide px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full justify-between flex items-center px-3 py-2 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{className:"spresDataEditBtn",children:"Edit"})]})]})]})]})})]})};function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ye(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ke=function(){var e=(0,N.useRouter)(),t=(0,k.useState)(!1),n=t[0],r=t[1],v=(0,k.useState)(!1),h=v[0],f=v[1],p=be((0,j.F_)(g.fV),1)[0],x=function(){g.fV.signInWithPopup(g.Ap).catch(alert),r(!1)};return(0,k.useEffect)((function(){p&&g.h.collection("users").doc(p.uid).set({email:p.email,displayName:p.displayName,photoURL:p.photoURL})}),[p]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:" top-0 bg-gray-800 z-50 sticky flex items-center justify-between px-8 py-4 rounded-b-lg shadow-lg shadow-slate-700 ",children:[(0,b.jsx)(s.Z,{onClick:function(){return e.push("/")},color:"lightBlue",buttonType:"link",size:"regular",iconOnly:!0,block:!1,rounded:!1,ripple:"link",className:" space-x-4 flex items-center group ",children:(0,b.jsx)(d.Z,{name:"gite"})}),(0,b.jsx)("div",{className:"flex items-center space-x-5",children:p?(0,b.jsx)(s.Z,{onClick:function(e){return f(!0)},color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:(0,b.jsx)("img",{src:null===p||void 0===p?void 0:p.photoURL,alt:"",className:" h-10 w-10 rounded-3xl border border-blue-400"})}):(0,b.jsxs)(s.Z,{onClick:x,color:"blue",buttonType:"link",size:"regular",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"grid",children:[(0,b.jsx)(d.Z,{name:"people"}),(0,b.jsx)("h2",{className:"routerNames",children:"Sign in"})]})})]}),(0,b.jsxs)(o.Z,{active:n,size:"regular",toggler:function(){return r(!1)},children:[(0,b.jsx)(l.Z,{toggler:function(){return r(!1)},children:(0,b.jsx)("p",{className:"font-google-sans capitalize text-2xl",children:"Sign in"})}),(0,b.jsx)(a.Z,{children:(0,b.jsxs)("div",{className:" grid place-items-center space-y-4 p-16",children:[(0,b.jsxs)(s.Z,{onClick:x,color:"blue",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",className:"flex items-center space-x-3",children:[(0,b.jsx)(c.Z,{}),(0,b.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"Google"})]}),(0,b.jsxs)(s.Z,{color:"blueGray",size:"lg",buttonType:"filled",iconOnly:!1,rounded:!1,block:!1,ripple:"light",children:[(0,b.jsx)(u.Z,{}),(0,b.jsx)("h2",{className:"text-xl font-google-sans font-normal capitalize",children:"GitHub"})]})]})}),(0,b.jsx)(i.Z,{children:(0,b.jsx)(s.Z,{onClick:function(e){return r(!1)},color:"red",size:"regular",buttonType:"link",ripple:"dark",className:"capitalize",children:"Close"})})]}),(0,b.jsxs)(o.Z,{active:h,size:"regular",toggler:function(){return f(!1)},children:[(0,b.jsx)(a.Z,{children:(0,b.jsxs)("div",{className:" grid place-items-center space-y-5 p-16 ",children:[(0,b.jsx)("img",{src:null===p||void 0===p?void 0:p.photoURL,alt:"",className:" h-20 w-20 rounded-3xl border border-blue-400 "}),(0,b.jsx)("h2",{className:" text-xl font-robot-slab font-semibold text-blue-400",children:null===p||void 0===p?void 0:p.displayName}),(0,b.jsx)("p",{className:" text-lg font-google-sans font-light text-blue-400",children:null===p||void 0===p?void 0:p.email})]})}),(0,b.jsxs)(i.Z,{children:[(0,b.jsx)(s.Z,{onClick:function(e){e.preventDefault(),g.fV.signOut(),r(!1)},color:"green",buttonType:"link",size:"regular",ripple:"dark",className:"capitalize",children:"Log out"}),(0,b.jsx)(s.Z,{onClick:function(e){return f(!1)},color:"red",buttonType:"link",size:"regular",ripple:"dark",className:"capitalize",children:"Close"})]})]})]})};function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function je(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ge(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ne=function(e){var t,n=e.id,o=e.hokkien,l=e.hanzi,a=e.lannang,i=e.poj,s=(e.pronunciation,e.taiLo),d=e.modalTest,r=je((0,j.F_)(g.fV),1)[0],c=(0,k.useState)(""),u=c[0],v=c[1],h=(0,k.useState)(""),f=h[0],p=h[1],x=(0,k.useState)(""),m=x[0],y=x[1],N=(0,k.useState)(""),w=N[0],S=N[1],T=(0,k.useState)(""),C=T[0],F=T[1],W=(0,k.useState)(""),B=(W[0],W[1],(0,k.useState)("")),A=(B[0],B[1],(0,k.useState)("")),I=A[0],D=A[1],U=(new Date).toLocaleDateString(),O=((0,k.useRef)(null),(0,k.useState)(null)),_=(O[0],O[1],je((0,M.ky)(g.h.doc("hokkienWords/".concat(n))),3)),E=_[0];return _[1],_[2],(0,b.jsx)("div",{className:" h-screen w-screen bg-slate-800 bg-opacity-80 grid place-items-center fixed inset-0 z-50 ",children:(0,b.jsxs)("div",{className:" updateModalDiv ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full border-b border-sky-500 px-4 py-3 flex items-center justify-between ",children:[(0,b.jsx)("h1",{className:" font-robot-slab font-semibold text-sky-100 text-lg ",children:"Modify word details"}),(0,b.jsx)("button",{onClick:d,className:" border border-red-500 text-red-500 px-3 py-1 rounded-3xl font-fira-sans font-normal hover:border-red-400 hover:text-red-400 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" bg-sky-800 bg-opacity-75 h-full w-full grid place-items-start px-4 py-3 space-y-5 overflow-y-scroll scrollbar-thin scrollbar-track-slate-700 scrollbar-thumb-sky-800 ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[50%] mx-auto justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"Hokkien:"}),(0,b.jsx)("h2",{className:"updateFormData",children:o})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{value:u,onChange:function(e){return v(e.target.value)},className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold placeholder-sky-500 text-lg text-sky-400 outline-none ",placeholder:"Hokkien"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),u&&(g.h.doc("hokkienWords/".concat(n)).set({hokkien:u},{merge:!0}).then((function(e){g.h.collection("wordsByUser").docs(null===r||void 0===r?void 0:r.displayName).collection("updates").doc(null===e||void 0===e?void 0:e.id).set({hokkien:u},{merge:!0})})),v(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"hokkien",updatedBy:null===r||void 0===r?void 0:r.displayName,timestamp:U,updateText:u}))},className:"updateFormBtn",children:"Update"})]}),(0,b.jsxs)("span",{className:" flex items-center w-[50%] mx-auto justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"Variant/s:"}),(0,b.jsx)("h2",{className:"updateFormData",children:null===(t=null===E||void 0===E?void 0:E.data())||void 0===t?void 0:t.variants})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{value:f,onChange:function(e){return p(e.target.value)},className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold placeholder-sky-500 text-lg text-sky-400 outline-none ",placeholder:"Variant/s"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),f&&(g.h.doc("hokkienWords/".concat(n)).set({variants:f},{merge:!0}),p(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"variants",updatedBy:null===r||void 0===r?void 0:r.displayName,timestamp:U,updateText:u}))},className:"updateFormBtn",children:"Update"})]}),(0,b.jsxs)("span",{className:" flex items-center w-[50%] mx-auto justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"Hanzi:"}),(0,b.jsx)("h2",{className:"updateFormData",children:l})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{value:m,onChange:function(e){return y(e.target.value)},className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold text-sky-400 placeholder-sky-500 text-lg outline-none ",placeholder:"Hanzi"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),m&&(g.h.doc("hokkienWords/".concat(n)).set({hanzi:m},{merge:!0}),y(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"hanzi",updatedBy:null===r||void 0===r?void 0:r.displayName,updatedOn:U,updateText:m}))},className:" updateFormBtn ",children:"Update"})]}),(0,b.jsxs)("span",{className:" flex items-center mx-auto w-[50%] justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"Lannang:"}),(0,b.jsx)("h2",{className:"updateFormData",children:a})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold text-sky-400 placeholder-sky-500 text-lg outline-none ",placeholder:"Lannang"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),w&&(g.h.doc("hokkienWords/".concat(n)).set({lannang:w},{merge:!0}),S(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"lannang",updatedBy:null===r||void 0===r?void 0:r.displayName,updatedOn:U,updateText:w}))},className:"updateFormBtn",children:"Update"})]}),(0,b.jsxs)("span",{className:" flex items-center w-[50%] mx-auto justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"POJ:"}),(0,b.jsx)("h2",{className:"updateFormData",children:i})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold text-sky-400 placeholder-sky-500 text-lg outline-none ",placeholder:"POJ"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),C&&(g.h.doc("hokkienWords/".concat(n)).set({poj:C},{merge:!0}),F(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"poj",updatedBy:null===r||void 0===r?void 0:r.displayName,updatedOn:U,updateText:C}))},className:"updateFormBtn",children:"Update"})]}),(0,b.jsxs)("span",{className:" flex items-center w-[50%] mx-auto justify-evenly px-2 ",children:[(0,b.jsx)("h4",{className:"updateFormTitle",children:"Tai-lo:"}),(0,b.jsx)("h2",{className:"updateFormData",children:s})]}),(0,b.jsxs)("div",{className:" h-[270px] w-full px-4 py-3 space-y-2 grid place-items-end bg-slate-800 rounded-lg ",children:[(0,b.jsx)("textarea",{className:" h-[90%] w-full bg-slate-700 rounded px-3 font-fira-sans font-semibold text-sky-400 placeholder-sky-500 text-lg outline-none ",placeholder:"Tai-lo"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),I&&I&&(g.h.doc("hokkienWords/".concat(n)).set({taiLo:I},{merge:!0}),D(""),g.h.doc("hokkienWords/".concat(n)).collection("editorUpdates").add({updated:"numbered tai-lo",updatedBy:null===r||void 0===r?void 0:r.displayName,updatedOn:U,updateText:I}))},className:"updateFormBtn",children:"Update"})]})]})]})})};function we(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return we(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Te=function(e){var t=e.parentId,n=e.synColl,o=e.synId,l=(Se((0,j.F_)(g.fV),1)[0],Se((0,M.ky)(g.h.doc("hokkienWords/".concat(t)).collection("".concat(n)).doc(o)),3)),a=l[0];return l[1],l[2],(0,b.jsx)("button",{onClick:function(){g.h.collection("hokkienWords").doc(t).collection("".concat(n)).doc(null===a||void 0===a?void 0:a.id).delete()},className:" font-robot-slab w-[45%] py-2 mx-auto font-semibold text-red-400 border border-red-400 hover:text-red-600 hover:border-red-600 active:outline-none focus:outline-none transform transition duration-300 ease-in-out outline-none ",children:"Delete synonym"})};function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Fe=function(e){var t=e.docId,n=e.synonymValue,o=e.setSynonymValue,l=e.addSynonym,a=e.synNo,i=(e.synSliceNo,e.synColl),s=(Ce((0,j.F_)(g.fV),1)[0],Ce((0,M.Kx)(g.h.doc("hokkienWords/".concat(t)).collection("".concat(i))),1)[0]);return(0,b.jsxs)("span",{className:" flex flex-col items-start w-full space-y-4 ",children:[s&&(null===s||void 0===s?void 0:s.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-4 px-3 py-2 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-300 text-lg ",children:"Synonym/s"}),(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-100 text-xl ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})}))),(0,b.jsx)("textarea",{placeholder:"Synonym # ".concat(a),value:n,onChange:function(e){return o(e.target.value)},className:" h-[180px] w-[85%] mx-auto border border-sky-400 rounded-md text-lg font-fira-sans font-semibold text-sky-400 outline-none focus:outline-none bg-slate-900 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between ",children:[(0,b.jsx)("span",{className:" w-[50%] "}),(0,b.jsxs)("button",{onClick:l,className:" w-[50%] px-3 py-2 rounded border border-sky-400 font-fira-sans font-semibold text-lg text-sky-400 hover:border-sky-600 hover:text-sky-600 active:outline-none focus:outline-none transform transition duration-300 ease-in-out ",children:["Add synonym for ",a]})]})]})};function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return We(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return We(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ae=function(e){var t=e.docId,n=(e.synAtDbValue,e.synonymValue,e.setSynonymValue,e.addSynonym,e.synNo),o=(e.synSliceNo,e.synColl),l=e.synId,a=Be((0,j.F_)(g.fV),1)[0],i=(0,k.useState)(""),s=i[0],d=i[1],r=Be((0,M.ky)(g.h.collection("hokkienWords").doc(t)),3),c=r[0],u=(r[1],r[2],Be((0,M.Kx)(g.h.collection("hokkienWords").doc(t).collection("".concat(o))),1)[0]);return(0,b.jsxs)("span",{className:" flex flex-col items-start w-full space-y-4 ",children:[u&&(null===u||void 0===u?void 0:u.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-4 px-3 py-2 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-300 text-lg ",children:"Synonym/s"}),(0,b.jsx)("h3",{className:"font-fira-sans font-semibold text-sky-100 text-xl",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})}))),(0,b.jsx)("textarea",{placeholder:"Update synonym, ".concat(null===a||void 0===a?void 0:a.displayName),value:s,onChange:function(e){return d(e.target.value)},className:" h-[180px] w-[85%] mx-auto border border-sky-400 rounded-md text-lg font-fira-sans font-semibold text-sky-400 outline-none focus:outline-none bg-slate-900 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between ",children:[(0,b.jsx)(Te,{parentId:t,synColl:o,synId:l}),(0,b.jsx)("span",{className:" w-[50%] ",children:s&&(0,b.jsxs)("button",{onClick:function(e){e.preventDefault(),s?(g.h.collection("hokkienWords").doc(t).collection("".concat(o)).doc(l).set({synonym:s},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===a||void 0===a?void 0:a.displayName).collection("updates").add({synonym:s,updatedValue:"synonym for ".concat(n),updatedWord:null===(t=null===c||void 0===c?void 0:c.data())||void 0===t?void 0:t.hokkien})})),d("")):alert("Error in updating, ".concat(null===a||void 0===a?void 0:a.displayName,". Check your inputs again"))},className:" w-full px-3 py-2 rounded border border-sky-400 font-fira-sans font-semibold text-lg text-sky-400 hover:border-sky-600 hover:text-sky-600 active:outline-none focus:outline-none transform transition duration-300 ease-in-out ",children:["Set synonym for ",n]})})]})]})};function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ie(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ue=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,N,w,S,T,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,$,X,G,J,Y,Q,q,ee,te,ne,oe,le,ae,ie,se,de,re,ce,ue,ve,he,fe,pe,xe,me,ye,be,ke,ge,je,Ne=e.hit,we=De((0,j.F_)(g.fV),1)[0],Se=(0,k.useState)(""),Te=Se[0],Me=Se[1],Ce=(0,k.useState)(""),We=Ce[0],Be=Ce[1],Ie=(0,k.useState)(""),Ue=Ie[0],Oe=Ie[1],_e=(0,k.useState)(""),Ee=_e[0],Ve=_e[1],Re=(0,k.useState)(""),ze=Re[0],Le=Re[1],Ke=(0,k.useState)(""),Ze=Ke[0],Pe=Ke[1],He=(0,k.useState)(""),$e=He[0],Xe=He[1],Ge=(0,k.useState)(""),Je=Ge[0],Ye=Ge[1],Qe=(0,k.useState)(""),qe=Qe[0],et=Qe[1],tt=(0,k.useState)(""),nt=tt[0],ot=tt[1],lt=(0,k.useState)(""),at=lt[0],it=lt[1],st=(0,k.useState)(""),dt=st[0],rt=st[1],ct=(0,k.useState)(""),ut=ct[0],vt=ct[1],ht=(0,k.useState)(""),ft=ht[0],pt=ht[1],xt=(0,k.useState)(""),mt=xt[0],yt=xt[1],bt=(0,k.useState)(""),kt=bt[0],gt=bt[1],jt=(0,k.useState)(""),Nt=(jt[0],jt[1],(0,k.useState)("")),wt=(Nt[0],Nt[1],(0,k.useState)("")),St=(wt[0],wt[1],(0,k.useState)("")),Tt=(St[0],St[1],(0,k.useState)("")),Mt=(Tt[0],Tt[1],(0,k.useState)("")),Ct=(Mt[0],Mt[1],(0,k.useState)("")),Ft=(Ct[0],Ct[1],(0,k.useState)("")),Wt=(Ft[0],Ft[1],(0,k.useState)("")),Bt=(Wt[0],Wt[1],(0,k.useState)("")),At=(Bt[0],Bt[1],(0,k.useState)("")),It=(At[0],At[1],(0,k.useState)("")),Dt=(It[0],It[1],(0,k.useState)("")),Ut=(Dt[0],Dt[1],(0,k.useState)("")),Ot=(Ut[0],Ut[1],(0,k.useState)("")),_t=(Ot[0],Ot[1],(0,k.useState)("")),Et=(_t[0],_t[1],(0,k.useState)("")),Vt=Et[0],Rt=Et[1],zt=(0,k.useState)(""),Lt=zt[0],Kt=zt[1],Zt=(0,k.useState)(""),Pt=Zt[0],Ht=Zt[1],$t=(0,k.useState)(""),Xt=$t[0],Gt=$t[1],Jt=(0,k.useState)(""),Yt=Jt[0],Qt=Jt[1],qt=(0,k.useState)(""),en=qt[0],tn=qt[1],nn=(0,k.useState)(""),on=nn[0],ln=nn[1],an=(0,k.useState)(""),sn=an[0],dn=an[1],rn=(0,k.useState)(""),cn=(rn[0],rn[1],(0,k.useState)("")),un=(cn[0],cn[1],(new Date).toLocaleDateString()),vn=De((0,M.ky)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id))),3),hn=vn[0],fn=(vn[1],vn[2],De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor1stMean")),1)[0]),pn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor2ndMean")),1)[0],xn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor3rdMean")),1)[0],yn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor4thMean")),1)[0],bn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor5thMean")),1)[0],gn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor6thMean")),1)[0],jn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor7thMean")),1)[0],Nn=De((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor8thMean")),1)[0],wn=function(e){var t,n,o;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.fifthType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({fifthMeaning:"",fifthType:""},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fifthMeaning:"",fifthType:"",updated:"Type & meaning #5 (deleted)",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),g.h.collection("hokkienWords").doc(null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))};return(0,b.jsx)("div",{className:" addMeaningModal ",children:(0,b.jsxs)("div",{className:" bg-slate-500 bg-opacity-30 h-full w-full overflow-y-scroll scrollbar-thin scrollbar-track-slate-700 scrollbar-thumb-sky-500 space-y-6 px-5 py-7 grid place-items-center ",children:[(null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.type)&&(0,b.jsx)(mn,{type:null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.type,meaning:null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.meaning}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(l=null===hn||void 0===hn?void 0:hn.data())||void 0===l?void 0:l.type,priorMeanType:Te,snapshotForCurrent:null===(a=null===hn||void 0===hn?void 0:hn.data())||void 0===a?void 0:a.type,firstType:null===(i=null===hn||void 0===hn?void 0:hn.data())||void 0===i?void 0:i.type,meanType:null===(s=null===hn||void 0===hn?void 0:hn.data())||void 0===s?void 0:s.type,inputValue:Te,setInputValue:Me,textAreaValue:We,setTextAreaValue:Be,addBtnFunc:function(e){e.preventDefault(),Te&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({meaning:We,type:Te},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({firstType:Te,firstMeaning:We,updated:"Type & meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Me(""),Be(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(Te," & ").concat(We)}))}}),(null===fn||void 0===fn?void 0:fn.empty)?(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:Vt,setSynonymValue:Rt,synNo:"1",addSynonym:function(e){e.preventDefault(),Vt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor1stMean").add({synonymNo:1,synonym:Vt}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({firstSynonym:Vt,updated:"Synonym/s for 1st meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Rt(""))},synColl:"synonymsFor1stMean"}):null===fn||void 0===fn?void 0:fn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"1",synColl:"synonymsFor1stMean",synId:null===e||void 0===e?void 0:e.id})})),((null===(d=null===hn||void 0===hn?void 0:hn.data())||void 0===d?void 0:d.secondType)||(null===(r=null===hn||void 0===hn?void 0:hn.data())||void 0===r?void 0:r.type))&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(c=null===hn||void 0===hn?void 0:hn.data())||void 0===c?void 0:c.secondType,meaning:null===(u=null===hn||void 0===hn?void 0:hn.data())||void 0===u?void 0:u.secondMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(v=null===hn||void 0===hn?void 0:hn.data())||void 0===v?void 0:v.type,priorMeanType:Te,snapshotForCurrent:null===(h=null===hn||void 0===hn?void 0:hn.data())||void 0===h?void 0:h.secondType,inputValue:Ee,setInputValue:Ve,textAreaValue:Ue,setTextAreaValue:Oe,addBtnFunc:function(e){e.preventDefault(),Ee&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({secondMeaning:Ue,secondType:Ee},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({secondType:Ee,secondMeaning:Ue,updated:"Type & meaning #2",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Ve(""),Oe(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(Ee," & ").concat(Ue)}))},delBtnFunc:function(e){var t,n,o;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.secondType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({secondMeaning:"",secondType:""},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").doc(null===e||void 0===e?void 0:e.id).add({secondMeaning:"",secondType:"",updated:"Type & meaning #2",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien}),Lt&&g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").doc(null===e||void 0===e?void 0:e.id).set({secondSynonym:""},{merge:!0})})),g.h.collection("hokkienWords").doc(null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))},meanType:null===(f=null===hn||void 0===hn?void 0:hn.data())||void 0===f?void 0:f.secondType,firstType:null===(p=null===hn||void 0===hn?void 0:hn.data())||void 0===p?void 0:p.type}),((null===(x=null===hn||void 0===hn?void 0:hn.data())||void 0===x?void 0:x.secondMeaning)||Ue)&&(null===pn||void 0===pn?void 0:pn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:Lt,setSynonymValue:Kt,synNo:"2",addSynonym:function(e){e.preventDefault(),Lt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor2ndMean").add({synonymNo:2,synonym:Lt}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({secondSynonym:Lt,updated:"Synonym/s for 2nd meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Kt(""))},synColl:"synonymsFor2ndMean"}),((null===(m=null===hn||void 0===hn?void 0:hn.data())||void 0===m?void 0:m.secondMeaning)||Ue)&&!(null===pn||void 0===pn?void 0:pn.empty)&&(null===pn||void 0===pn?void 0:pn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"2",synColl:"synonymsFor2ndMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(y=null===hn||void 0===hn?void 0:hn.data())||void 0===y?void 0:y.thirdType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(N=null===hn||void 0===hn?void 0:hn.data())||void 0===N?void 0:N.thirdType,meaning:null===(w=null===hn||void 0===hn?void 0:hn.data())||void 0===w?void 0:w.thirdMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(S=null===hn||void 0===hn?void 0:hn.data())||void 0===S?void 0:S.secondType,priorMeanType:Ee,snapshotForCurrent:null===(T=null===hn||void 0===hn?void 0:hn.data())||void 0===T?void 0:T.thirdType,inputValue:Ze,setInputValue:Pe,textAreaValue:ze,setTextAreaValue:Le,addBtnFunc:function(e){e.preventDefault(),Ze&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({thirdMeaning:ze,thirdType:Ze},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({thirdMeaning:ze,thirdType:Ze,updated:"Type & meaning #4",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Le(""),Pe(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(Ze," & ").concat(ze)}))},delBtnFunc:function(e){var t,n,o;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.thirdType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({thirdMeaning:"",thirdType:""},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({thirdMeaning:"",thirdType:"",updated:"Type & meaning #3",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),g.h.collection("hokkienWords").doc(null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))},meanType:null===(C=null===hn||void 0===hn?void 0:hn.data())||void 0===C?void 0:C.thirdType,firstType:null===(F=null===hn||void 0===hn?void 0:hn.data())||void 0===F?void 0:F.type}),((null===(W=null===hn||void 0===hn?void 0:hn.data())||void 0===W?void 0:W.thirdMeaning)||ze)&&(null===xn||void 0===xn?void 0:xn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:Pt,setSynonymValue:Ht,synNo:"3",addSynonym:function(e){e.preventDefault(),Pt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor3rdMean").add({synonymNo:3,synonym:Pt}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({thirdSynonym:Pt,updated:"Synonym/s for 3rd meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Ht(""))},synColl:"synonymsFor3rdMean"}),((null===(B=null===hn||void 0===hn?void 0:hn.data())||void 0===B?void 0:B.thirdMeaning)||ze)&&!(null===xn||void 0===xn?void 0:xn.empty)&&(null===xn||void 0===xn?void 0:xn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"3",synColl:"synonymsFor3rdMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(A=null===hn||void 0===hn?void 0:hn.data())||void 0===A?void 0:A.fourthType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(I=null===hn||void 0===hn?void 0:hn.data())||void 0===I?void 0:I.fourthType,meaning:null===(D=null===hn||void 0===hn?void 0:hn.data())||void 0===D?void 0:D.fourthMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(U=null===hn||void 0===hn?void 0:hn.data())||void 0===U?void 0:U.thirdType,priorMeanType:Ze,snapshotForCurrent:null===(O=null===hn||void 0===hn?void 0:hn.data())||void 0===O?void 0:O.fourthType,inputValue:Je,setInputValue:Ye,textAreaValue:$e,setTextAreaValue:Xe,addBtnFunc:function(e){e.preventDefault(),Je&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({fourthMeaning:$e,fourthType:Je},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fourthMeaning:$e,fourthType:Je,updated:"Type & meaning #4",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien},{merge:!0})})),Xe(""),Ye(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(Je," & ").concat($e)}))},delBtnFunc:function(e){var t,n,o;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.fourthType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({fourthMeaning:"",fourthType:""},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fourthMeaning:"",fourthType:"",updated:"Type & meaning #4 (deleted)",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),g.h.collection("hokkienWords").doc(null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))},meanType:null===(_=null===hn||void 0===hn?void 0:hn.data())||void 0===_?void 0:_.fourthType,firstType:null===(E=null===hn||void 0===hn?void 0:hn.data())||void 0===E?void 0:E.type}),((null===(V=null===hn||void 0===hn?void 0:hn.data())||void 0===V?void 0:V.fourthMeaning)||$e)&&(null===yn||void 0===yn?void 0:yn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:Xt,setSynonymValue:Gt,synNo:"4",addSynonym:function(e){e.preventDefault(),Xt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor4thMean").add({synonymNo:4,synonym:Xt}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fourthSynonym:Xt,updated:"Synonym/s for 4th meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Gt(""))},synColl:"synonymsFor4thMean"}),((null===(R=null===hn||void 0===hn?void 0:hn.data())||void 0===R?void 0:R.fourthMeaning)||$e)&&!(null===yn||void 0===yn?void 0:yn.empty)&&(null===yn||void 0===yn?void 0:yn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"4",synColl:"synonymsFor4thMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(z=null===hn||void 0===hn?void 0:hn.data())||void 0===z?void 0:z.fifthType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(L=null===hn||void 0===hn?void 0:hn.data())||void 0===L?void 0:L.fifthType,meaning:null===(K=null===hn||void 0===hn?void 0:hn.data())||void 0===K?void 0:K.fifthMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(Z=null===hn||void 0===hn?void 0:hn.data())||void 0===Z?void 0:Z.fourthType,priorMeanType:Je,snapshotForCurrent:null===(P=null===hn||void 0===hn?void 0:hn.data())||void 0===P?void 0:P.fifthType,inputValue:nt,setInputValue:ot,textAreaValue:qe,setTextAreaValue:et,addBtnFunc:function(e){e.preventDefault(),nt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({fifthMeaning:qe,fifthType:nt},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fifthMeaning:qe,fifthType:nt,updated:"Type & meaning #5",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien},{merge:!0})})),et(""),ot(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(nt," & ").concat(qe)}))},delBtnFunc:wn,meanType:null===(H=null===hn||void 0===hn?void 0:hn.data())||void 0===H?void 0:H.fifthType,firstType:null===($=null===hn||void 0===hn?void 0:hn.data())||void 0===$?void 0:$.type}),((null===(X=null===hn||void 0===hn?void 0:hn.data())||void 0===X?void 0:X.fifthMeaning)||qe)&&(null===bn||void 0===bn?void 0:bn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:Yt,setSynonymValue:Qt,synNo:"5",addSynonym:function(e){e.preventDefault(),Yt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).collection("synonymsFor5thMean").add({synonymNo:5,synonym:Yt}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({fifthSynonym:Yt,updated:"Synonym/s for 5th meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),Qt(""))},synColl:"synonymsFor5thMean"}),((null===(G=null===hn||void 0===hn?void 0:hn.data())||void 0===G?void 0:G.fifthMeaning)||qe)&&!(null===bn||void 0===bn?void 0:bn.empty)&&(null===bn||void 0===bn?void 0:bn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"5",synColl:"synonymsFor5thMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(J=null===hn||void 0===hn?void 0:hn.data())||void 0===J?void 0:J.sixthType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(Y=null===hn||void 0===hn?void 0:hn.data())||void 0===Y?void 0:Y.sixthType,meaning:null===(Q=null===hn||void 0===hn?void 0:hn.data())||void 0===Q?void 0:Q.sixthMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(q=null===hn||void 0===hn?void 0:hn.data())||void 0===q?void 0:q.fifthType,priorMeanType:nt,snapshotForCurrent:null===(ee=null===hn||void 0===hn?void 0:hn.data())||void 0===ee?void 0:ee.sixthType,inputValue:dt,setInputValue:rt,textAreaValue:at,setTextAreaValue:it,addBtnFunc:function(e){e.preventDefault(),dt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({sixthMeaning:at,sixthType:dt},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({sixthMeaning:at,sixthType:dt,updated:"Type & meaning #6",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),it(""),rt(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"sixth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(dt," & ").concat(at)}))},delBtnFunc:wn,meanType:null===(te=null===hn||void 0===hn?void 0:hn.data())||void 0===te?void 0:te.sixthType,firstType:null===(ne=null===hn||void 0===hn?void 0:hn.data())||void 0===ne?void 0:ne.type}),((null===(oe=null===hn||void 0===hn?void 0:hn.data())||void 0===oe?void 0:oe.sixthMeaning)||at)&&(null===gn||void 0===gn?void 0:gn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:en,setSynonymValue:tn,synNo:"6",addSynonym:function(e){var t;e.preventDefault(),g.h.collection("hokkienWords").doc(null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien).collection("synonymsFor6thMean").add({synonymNo:6,synonym:en}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({sixthSynonym:en,updated:"Synonym/s for 6th meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),tn("")},synColl:"synonymsFor6thMean"}),((null===(le=null===hn||void 0===hn?void 0:hn.data())||void 0===le?void 0:le.sixthMeaning)||at)&&!(null===gn||void 0===gn?void 0:gn.empty)&&(null===gn||void 0===gn?void 0:gn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"6",synColl:"synonymsFor6thMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(ae=null===hn||void 0===hn?void 0:hn.data())||void 0===ae?void 0:ae.seventhType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(ie=null===hn||void 0===hn?void 0:hn.data())||void 0===ie?void 0:ie.seventhType,meaning:null===(se=null===hn||void 0===hn?void 0:hn.data())||void 0===se?void 0:se.seventhMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(de=null===hn||void 0===hn?void 0:hn.data())||void 0===de?void 0:de.sixthType,priorMeanType:dt,snapshotForCurrent:null===(re=null===hn||void 0===hn?void 0:hn.data())||void 0===re?void 0:re.seventhType,inputValue:ft,setInputValue:pt,textAreaValue:ut,setTextAreaValue:vt,addBtnFunc:function(e){e.preventDefault(),ft&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({seventhMeaning:ut,seventhType:ft},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({seventhMeaning:ut,seventhType:ft,updated:"Type & meaning #7",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),vt(""),pt(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(ft," & ").concat(ut)}))},delBtnFunc:function(e){var t,n,o,l;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.seventhType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({seventhMeaning:"",seventhType:"",updated:"Type & meaning #7",updatedWord:null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({sevenethMeaning:"",seventhType:"",updated:"Type & meaning #7 (deleted)",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),g.h.collection("hokkienWords").doc(null===(l=null===hn||void 0===hn?void 0:hn.data())||void 0===l?void 0:l.hokkien).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))},meanType:null===(ce=null===hn||void 0===hn?void 0:hn.data())||void 0===ce?void 0:ce.seventhType,firstType:null===(ue=null===hn||void 0===hn?void 0:hn.data())||void 0===ue?void 0:ue.seventhType}),((null===(ve=null===hn||void 0===hn?void 0:hn.data())||void 0===ve?void 0:ve.seventhMeaning)||ut)&&(null===jn||void 0===jn?void 0:jn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:on,setSynonymValue:ln,synNo:"7",addSynonym:function(e){var t;e.preventDefault(),g.h.collection("hokkienWords").doc(null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien).collection("synonymsFor7thMean").add({synonymNo:7,synonym:on}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({seventhSynonym:on,updated:"Synonym/s for 7th meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),ln("")},synColl:"synonymsFor7thMean"}),((null===(he=null===hn||void 0===hn?void 0:hn.data())||void 0===he?void 0:he.seventhMeaning)||ut)&&!(null===jn||void 0===jn?void 0:jn.empty)&&(null===jn||void 0===jn?void 0:jn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"7",synColl:"synonymsFor7thMean",synId:null===e||void 0===e?void 0:e.id})}))),(null===(fe=null===hn||void 0===hn?void 0:hn.data())||void 0===fe?void 0:fe.eighthType)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(mn,{type:null===(pe=null===hn||void 0===hn?void 0:hn.data())||void 0===pe?void 0:pe.eighthType,meaning:null===(xe=null===hn||void 0===hn?void 0:hn.data())||void 0===xe?void 0:xe.eighthMeaning})}),(0,b.jsx)(kn,{snapshot:hn,priorData:null===(me=null===hn||void 0===hn?void 0:hn.data())||void 0===me?void 0:me.seventhType,priorMeanType:ft,snapshotForCurrent:null===(ye=null===hn||void 0===hn?void 0:hn.data())||void 0===ye?void 0:ye.eighthType,inputValue:kt,setInputValue:gt,textAreaValue:mt,setTextAreaValue:yt,addBtnFunc:function(e){e.preventDefault(),kt&&(g.h.doc("/hokkienWords/".concat(null===Ne||void 0===Ne?void 0:Ne._firestore_id)).set({eighthMeaning:mt,eighthType:kt},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({eighthMeaning:mt,eighthType:kt,updated:"Type & meaning #8",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),yt(""),gt(""),g.h.collection("hokkienWords").doc(null===Ne||void 0===Ne?void 0:Ne._firestore_id).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"".concat(kt," & ").concat(mt)}))},delBtnFunc:function(e){var t,n,o;(e.preventDefault(),null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.eighthType)&&(g.h.collection("hokkienWords").doc(null===(n=null===hn||void 0===hn?void 0:hn.data())||void 0===n?void 0:n.hokkien).set({eighthMeaning:"",eighthType:""}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({eighthMeaning:"",eighthType:"",updated:"Type & meaning #8 (deleted)",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),g.h.collection("hokkienWords").doc(null===(o=null===hn||void 0===hn?void 0:hn.data())||void 0===o?void 0:o.hokkien).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===we||void 0===we?void 0:we.displayName,updatedOn:un,updateText:"none (deleted)"}))},meanType:null===(be=null===hn||void 0===hn?void 0:hn.data())||void 0===be?void 0:be.eighthType,firstType:null===(ke=null===hn||void 0===hn?void 0:hn.data())||void 0===ke?void 0:ke.eighthType}),((null===(ge=null===hn||void 0===hn?void 0:hn.data())||void 0===ge?void 0:ge.eighthMeaning)||mt)&&(null===Nn||void 0===Nn?void 0:Nn.empty)&&(0,b.jsx)(Fe,{docId:null===hn||void 0===hn?void 0:hn.id,synonymValue:sn,setSynonymValue:dn,synNo:"8",addSynonym:function(e){var t;e.preventDefault(),g.h.collection("hokkienWords").doc(null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien).collection("synonymsFor8thMean").add({synonymNo:8,synonym:sn}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===we||void 0===we?void 0:we.displayName).collection("updates").add({eighthSynonym:sn,updated:"Synonym/s for 8th meaning",updatedWord:null===(t=null===hn||void 0===hn?void 0:hn.data())||void 0===t?void 0:t.hokkien})})),dn("")},synColl:"synonymsFor8thMean"}),((null===(je=null===hn||void 0===hn?void 0:hn.data())||void 0===je?void 0:je.eighthMeaning)||mt)&&!(null===Nn||void 0===Nn?void 0:Nn.empty)&&(null===Nn||void 0===Nn?void 0:Nn.docs.map((function(e){return(0,b.jsx)(Ae,{docId:null===hn||void 0===hn?void 0:hn.id,synNo:"8",synColl:"synonymsFor8thMean",synId:null===e||void 0===e?void 0:e.id})})))]})})};function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _e(e,t,n,o,l,a,i){try{var s=e[a](i),d=s.value}catch(r){return void n(r)}s.done?t(d):Promise.resolve(d).then(o,l)}function Ee(e){return function(){var t=this,n=arguments;return new Promise((function(o,l){var a=e.apply(t,n);function i(e){_e(a,o,l,i,s,"next",e)}function s(e){_e(a,o,l,i,s,"throw",e)}i(void 0)}))}}function Ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Re=function(e){var t,n,o,l,a,i,s,d,r=e.hit,c=Ve((0,j.F_)(g.fV),1)[0],u=(0,k.useState)(""),v=u[0],h=u[1],f=(0,k.useState)(""),p=f[0],x=f[1],m=(0,k.useState)(""),y=m[0],N=m[1],w=(0,k.useState)(""),S=w[0],T=w[1],C=(0,k.useState)(""),F=(C[0],C[1],(0,k.useState)("")),W=(F[0],F[1],(0,k.useState)("")),B=W[0],A=W[1],I=(0,k.useState)(""),D=I[0],U=I[1],O=(0,k.useState)(null),_=O[0],E=O[1],V=(0,k.useState)(null),R=V[0],z=V[1],L=(0,k.useState)(""),K=L[0],Z=L[1],P=(0,k.useState)(!1),H=P[0],X=P[1],G=(new Date).toLocaleDateString(),J=Ve((0,M.ky)(g.h.doc("hokkienWords/".concat(null===r||void 0===r?void 0:r._firestore_id))),3),Y=J[0],Q=(J[1],J[2],function(){var e=Ee($().mark((function e(){var t,n,o;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices.getUserMedia)){e.next=19;break}return e.prev=1,e.next=5,null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia({audio:!0});case 5:n=e.sent,o=new MediaRecorder(n),z(o),o.start(),X(!0),o.ondataavailable=function(e){E(null===e||void 0===e?void 0:e.data);var t=URL.createObjectURL(null===e||void 0===e?void 0:e.data);Z(t)},null===o||void 0===o||(o.onstop=function(){var e;null===(e=n.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),alert("Error accessing microphone: ",e.t0);case 17:e.next=20;break;case 19:alert("MediaDevices API not supported on this browser");case 20:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}()),q=function(){var e=Ee($().mark((function e(){var t,n,o;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E(null),!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||!(null===navigator||void 0===navigator?void 0:navigator.mediaDevices.getUserMedia)){e.next=20;break}return e.prev=2,e.next=6,null===navigator||void 0===navigator||null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia({audio:!0});case 6:n=e.sent,o=new MediaRecorder(n),z(o),o.start(),X(!0),o.ondataavailable=function(e){E(null===e||void 0===e?void 0:e.data);var t=URL.createObjectURL(null===e||void 0===e?void 0:e.data);Z(t)},null===o||void 0===o||(o.onstop=function(){var e;null===(e=n.getTracks())||void 0===e||e.forEach((function(e){return null===e||void 0===e?void 0:e.stop()}))}),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),alert("Error accessing microphone: ",e.t0);case 18:e.next=21;break;case 20:alert("MediaDevices API not supported on this browser");case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(){return e.apply(this,arguments)}}();return(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"editFormModal scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsx)("h1",{className:" font-robot-slab font-normal text-lg text-slate-50 w-[95%] py-5 mx-auto ",children:'The meanings can be modified by pressing the "meanings" button back at the word modal.'}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:" editDetailsTitle ",children:"Hokkien"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien}),(0,b.jsx)("input",{placeholder:"Updated value for Hokkien here, ".concat(null===c||void 0===c?void 0:c.displayName),value:v,onChange:function(e){return h(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),v?(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({hokkien:v},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).collection("updates").add({updated:"Hokkien",valueOfUpdate:v,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),h(""),g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").add({updated:"hokkien",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:v})):alert("Try again, ".concat(null===c||void 0===c?void 0:c.displayName,". \n        There seems to be an error in your input"))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update hokkien"})]}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:"editDetailsTitle",children:"Variant/s"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(n=null===Y||void 0===Y?void 0:Y.data())||void 0===n?void 0:n.variants}),(0,b.jsx)("input",{placeholder:"Updated value for variant/s",value:D,onChange:function(e){return U(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),D&&(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({variants:D},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).add({updated:"Variant/s",valueOfUpdate:D,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),U(""),g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").collection("updates").add({updated:"Variant/s",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:D}))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update variant/s"})]}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:"editDetailsTitle",children:"Hanzi"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(o=null===Y||void 0===Y?void 0:Y.data())||void 0===o?void 0:o.hanzi}),(0,b.jsx)("input",{placeholder:"Updated value for Hanzi",value:p,onChange:function(e){return x(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),p?(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({hanzi:p},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).collection("updates").add({updated:"hanzi",valueOfUpdate:p,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),x(""),g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").add({updated:"hanzi",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:p})):alert("Try again, ".concat(null===c||void 0===c?void 0:c.displayName,". \n        There seems to be an error in your input"))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update hanzi"})]}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:"editDetailsTitle",children:"Lannang"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(l=null===Y||void 0===Y?void 0:Y.data())||void 0===l?void 0:l.lannang}),(0,b.jsx)("input",{placeholder:"Updated value for Lannang",value:y,onChange:function(e){return N(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),y?(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({lannang:y},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).collection("updates").add({updated:"Lannang",valueOfUpdate:y,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),N(""),g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").add({updated:"lannang",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:y})):alert("Try again, ".concat(null===c||void 0===c?void 0:c.displayName,",\n        There seems to be an error in your input"))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update lannang"})]}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:"editDetailsTitle",children:"POJ"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(a=null===Y||void 0===Y?void 0:Y.data())||void 0===a?void 0:a.poj}),(0,b.jsx)("input",{placeholder:"Updated value for POJ",value:S,onChange:function(e){return T(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),S?(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({poj:S},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).collection("updates").add({updated:"POJ",valueOfUpdate:S,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),T(""),g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").add({updated:"poj",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:S})):alert("Try again, ".concat(null===c||void 0===c?void 0:c.displayName,". \n        There seems to be an error in your input"))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update POJ"})]}),(0,b.jsxs)("span",{className:" editDetailsSpan ",children:[(0,b.jsx)("h2",{className:"editDetailsTitle",children:"Numbered Tai-lo"}),(0,b.jsx)("h1",{className:"editDetailsWord",children:null===(i=null===Y||void 0===Y?void 0:Y.data())||void 0===i?void 0:i.taiLo}),(0,b.jsx)("input",{placeholder:"Updated value for Numbered tai-lo",value:B,onChange:function(e){return A(e.target.value)},type:"text",className:" w-[90%] h-[45px] rounded-lg bg-sky-600 text-slate-50 text-base font-path-ex font-semibold px-3 placeholder-slate-50 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),B&&(g.h.doc("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).set({taiLo:B},{merge:!0}).then((function(e){var t;g.h.collection("wordsByUser").doc(null===c||void 0===c?void 0:c.displayName).add({updated:"Tai-lo (#)",valueOfUpdate:B,updatedWord:null===(t=null===Y||void 0===Y?void 0:Y.data())||void 0===t?void 0:t.hokkien})})),A(""),g.h.doc("hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id)).collection("editorUpdates").collection("updates").add({updated:"Tai-lo (#)",updatedBy:null===c||void 0===c?void 0:c.displayName,updatedOn:G,updateText:B}))},className:"font-robot-slab w-[60%] mx-auto font-semibold text-sky-400 border border-sky-500 hover:border-sky-600 hover:border-2 focus:border-sky-300 focus:border-4 rounded-md focus:rounded-lg transform transition duration-200 ease-in-out",children:"Update Tai-lo"})]}),(0,b.jsxs)("span",{className:"editDetailsSpan",children:[(0,b.jsx)("p",{className:"editDetailsTitle",children:"Audio"}),(null===(s=null===Y||void 0===Y?void 0:Y.data())||void 0===s?void 0:s.pronunciation)&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("audio",{src:null===(d=null===Y||void 0===Y?void 0:Y.data())||void 0===d?void 0:d.pronunciation,controls:!0,className:" w-full border-sky-400 border px-3 py-2 rounded "})}),H&&(0,b.jsxs)("div",{className:" flex items-center text-lg text-red-500 font-robot-slab font-normal ",children:[(0,b.jsx)("span",{className:" w-[10px] h-[10px] bg-red-500 rounded-lg animate-pulse "}),"Recording"]}),(0,b.jsxs)("div",{className:" flex items-center space-x-4 ",children:[_||K?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{onClick:q,disabled:H,className:" border border-sky-400 font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Re-record"}),(0,b.jsx)("button",{onClick:function(){if(_)try{var e,t=g.tO.ref("/hokkienWords/".concat(null===Y||void 0===Y?void 0:Y.id,"/").concat(null===(e=null===Y||void 0===Y?void 0:Y.data())||void 0===e?void 0:e.hokkien,".webm"));t.put(_).then((function(){return null===t||void 0===t?void 0:t.getDownloadURL()})).then((function(e){return g.h.collection("hokkienWords").doc(null===Y||void 0===Y?void 0:Y.id).set({pronunciation:e},{merge:!0})}))}catch(n){alert("Error in uploading audio: ",n)}_&&E(null),K&&Z("")},disabled:H,className:" border border-sky-400 font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Add audio"})]}):(!_||!K)&&(0,b.jsx)("button",{onClick:Q,disabled:H,className:" border border-sky-400 font-robot-slab font-normal text-sky-400 px-3 py-2 ",children:"Start recording"}),_&&K?(_||K)&&(0,b.jsx)("button",{onClick:function(){_&&E(null),K&&Z("")},disabled:H,className:" border border-red-400 font-robot-slab font-normal text-red-400 px-3 py-2 ",children:"Delete"}):(0,b.jsx)("button",{onClick:function(){R&&(null===R||void 0===R||R.stop(),X(!1))},disabled:!H,className:" border border-red-400 font-robot-slab font-normal text-red-400 px-3 py-2 ",children:"Stop recording"})]})]})]})})};function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ke=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,k,N,w,S,T,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,$,X,G,J=e.hit,Y=(Le((0,j.F_)(g.fV),1)[0],Le((0,M.ky)(g.h.doc("hokkienWords/".concat(J))),3)),Q=Y[0],q=(Y[1],Y[2],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor1stMean").orderBy("addedOn","asc")),1)[0]),ee=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor2ndMean").orderBy("addedOn","asc")),1)[0],te=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor3rdMean").orderBy("addedOn","asc")),1)[0],ne=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor4thMean").orderBy("addedOn","asc")),1)[0],oe=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor5thMean").orderBy("addedOn","asc")),1)[0],le=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor6thMean").orderBy("addedOn","asc")),1)[0],ae=Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor7thMean").orderBy("addedOn","asc")),1)[0],ie=(Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor8thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor9thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor10thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor11thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor12thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor13thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor14thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("labelFor15thMean").orderBy("addedOn","asc")),1)[0],Le((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===Q||void 0===Q?void 0:Q.id)).collection("synonyms").orderBy("synonymNo","asc")),1)[0]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(t=null===Q||void 0===Q?void 0:Q.data())||void 0===t?void 0:t.type}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:q&&(null===q||void 0===q?void 0:q.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsxs)("span",{className:" flex flex-col space-y-3 items-center ",children:[(0,b.jsx)("h3",{className:" idMeaning ",children:null===(n=null===Q||void 0===Q?void 0:Q.data())||void 0===n?void 0:n.meaning}),null===ie||void 0===ie||null===(o=ie.docs)||void 0===o?void 0:o.slice(0,1).map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sky-300 text-sm ",children:"Synonym/s:"}),(0,b.jsx)("h4",{className:" font-robot-slab font-bold text-sky-100 text-base ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})}))]})]}),(null===(l=null===Q||void 0===Q?void 0:Q.data())||void 0===l?void 0:l.secondType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(a=null===Q||void 0===Q?void 0:Q.data())||void 0===a?void 0:a.secondType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:ee&&(null===ee||void 0===ee?void 0:ee.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(i=null===Q||void 0===Q?void 0:Q.data())||void 0===i?void 0:i.secondMeaning})]}),(null===(s=null===Q||void 0===Q?void 0:Q.data())||void 0===s?void 0:s.thirdType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(d=null===Q||void 0===Q?void 0:Q.data())||void 0===d?void 0:d.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(r=null===Q||void 0===Q?void 0:Q.data())||void 0===r?void 0:r.thirdMeaning})]}),(null===(c=null===Q||void 0===Q?void 0:Q.data())||void 0===c?void 0:c.fourthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(u=null===Q||void 0===Q?void 0:Q.data())||void 0===u?void 0:u.fourthType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:ne&&(null===ne||void 0===ne?void 0:ne.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(v=null===Q||void 0===Q?void 0:Q.data())||void 0===v?void 0:v.fourthMeaning})]}),(null===(h=null===Q||void 0===Q?void 0:Q.data())||void 0===h?void 0:h.fifthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(f=null===Q||void 0===Q?void 0:Q.data())||void 0===f?void 0:f.fifthType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:oe&&(null===oe||void 0===oe?void 0:oe.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(p=null===Q||void 0===Q?void 0:Q.data())||void 0===p?void 0:p.fifthMeaning})]}),(null===(x=null===Q||void 0===Q?void 0:Q.data())||void 0===x?void 0:x.sixthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(m=null===Q||void 0===Q?void 0:Q.data())||void 0===m?void 0:m.sixthType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:le&&(null===le||void 0===le?void 0:le.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(y=null===Q||void 0===Q?void 0:Q.data())||void 0===y?void 0:y.sixthMeaning})]}),(null===(k=null===Q||void 0===Q?void 0:Q.data())||void 0===k?void 0:k.seventhType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(N=null===Q||void 0===Q?void 0:Q.data())||void 0===N?void 0:N.seventhType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:ae&&(null===ae||void 0===ae?void 0:ae.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(w=null===Q||void 0===Q?void 0:Q.data())||void 0===w?void 0:w.seventhMeaning})]}),(null===(S=null===Q||void 0===Q?void 0:Q.data())||void 0===S?void 0:S.eighthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(T=null===Q||void 0===Q?void 0:Q.data())||void 0===T?void 0:T.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(C=null===Q||void 0===Q?void 0:Q.data())||void 0===C?void 0:C.eighthMeaning})]}),(null===(F=null===Q||void 0===Q?void 0:Q.data())||void 0===F?void 0:F.ninthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(W=null===Q||void 0===Q?void 0:Q.data())||void 0===W?void 0:W.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(B=null===Q||void 0===Q?void 0:Q.data())||void 0===B?void 0:B.ninthMeaning})]}),(null===(A=null===Q||void 0===Q?void 0:Q.data())||void 0===A?void 0:A.tenthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(I=null===Q||void 0===Q?void 0:Q.data())||void 0===I?void 0:I.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(D=null===Q||void 0===Q?void 0:Q.data())||void 0===D?void 0:D.tenthMeaning})]}),(null===(U=null===Q||void 0===Q?void 0:Q.data())||void 0===U?void 0:U.eleventhType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(O=null===Q||void 0===Q?void 0:Q.data())||void 0===O?void 0:O.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(_=null===Q||void 0===Q?void 0:Q.data())||void 0===_?void 0:_.eleventhMeaning})]}),(null===(E=null===Q||void 0===Q?void 0:Q.data())||void 0===E?void 0:E.twelfthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(V=null===Q||void 0===Q?void 0:Q.data())||void 0===V?void 0:V.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(R=null===Q||void 0===Q?void 0:Q.data())||void 0===R?void 0:R.twelfthMeaning})]}),(null===(z=null===Q||void 0===Q?void 0:Q.data())||void 0===z?void 0:z.thirteenthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(L=null===Q||void 0===Q?void 0:Q.data())||void 0===L?void 0:L.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(K=null===Q||void 0===Q?void 0:Q.data())||void 0===K?void 0:K.thirteenthMeaning})]}),(null===(Z=null===Q||void 0===Q?void 0:Q.data())||void 0===Z?void 0:Z.fourteenthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(P=null===Q||void 0===Q?void 0:Q.data())||void 0===P?void 0:P.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(H=null===Q||void 0===Q?void 0:Q.data())||void 0===H?void 0:H.fourteenthMeaning})]}),(null===($=null===Q||void 0===Q?void 0:Q.data())||void 0===$?void 0:$.fifteenthType)&&(0,b.jsxs)("span",{className:" idMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" w-full flex items-center space-x-3 ",children:[(0,b.jsx)("p",{className:"idMeaningsType",children:null===(X=null===Q||void 0===Q?void 0:Q.data())||void 0===X?void 0:X.thirdType}),(0,b.jsx)("span",{className:" w-[80%] flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:te&&(null===te||void 0===te?void 0:te.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-robot-slab font-semibold text-sm text-sky-400 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h3",{className:" idMeaning ",children:null===(G=null===Q||void 0===Q?void 0:Q.data())||void 0===G?void 0:G.fifteenthMeaning})]})]})};function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var He=function(e){var t=e.typeTitle,n=e.meaningTitle,o=e.inputValue,l=e.setInputValue,a=e.textAreaValue,i=e.setTextAreaValue,s=(e.synValue,e.setSynValue,e.synCollection,e.labelValue,e.setLabelValue,e.labelCollection,e.addBtnFunc),d=(e.addSynFunc,e.delSynFunc,e.addlabelFunc,e.delLabelFunc,e.delBtnFunc),r=e.meanType,c=e.firstType,u=Pe((0,j.F_)(g.fV),1)[0];return(0,b.jsxs)("div",{className:" flex items-center w-full ",children:[(0,b.jsxs)("div",{className:" w-[85%] flex flex-col items-start px-4 space-y-4 ",children:[(0,b.jsxs)("div",{className:" flex flex-col items-start w-full mx-auto space-y-3 ",children:[(0,b.jsx)("h1",{className:" font-robot-slab font-semibold text-xl text-sky-50 ",children:t}),(0,b.jsx)("input",{value:o,onChange:function(e){return l(e.target.value)},placeholder:"Type",type:"text",className:" border-0 outline-none bg-sky-800 rounded text-xl text-sky-100 font-robot-slab font-semibold w-full h-[50px] px-3 placeholder-sky-200 "})]}),(0,b.jsxs)("div",{className:" flex flex-col items-start w-full mx-auto space-y-3 ",children:[(0,b.jsx)("h1",{className:" font-robot-slab font-semibold text-xl text-sky-50 ",children:n}),(0,b.jsx)("textarea",{value:a,onChange:function(e){return i(e.target.value)},type:"text",placeholder:"Meaning",className:" border-0 outline-none bg-sky-800 rounded text-lg font-robot-slab font-normal text-sky-100 w-full h-[85px] px-3 placeholder-sky-200 overflow-y-scroll scrollbar-hide "})]})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-2 items-start px-2 w-[15%] ",children:[(0,b.jsx)("button",{onClick:s,className:" bg-transparent px-3 py-1 rounded border border-green-600 text-xl font-path-ex font-bold text-green-600 hover:border-green-500 hover:text-green-500 transform transition duration-300 ease-in-out w-full ",children:"Set"}),(r&&r!=c||"rumlowb@gmail.com"==(null===u||void 0===u?void 0:u.email)||"sygrandkaiser@gmail.com"==(null===u||void 0===u?void 0:u.email))&&(0,b.jsx)("button",{onClick:d,className:" bg-transparent px-3 py-1 rounded border border-red-600 text-xl font-path-ex font-bold text-red-600 hover:border-red-400 hover:text-red-400 transform transition duration-300 ease-in-out w-full ",children:"Delete"})]})]})};function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ge=function(e){var t=e.docId,n=e.synNo,o=e.synSliceNo,l=e.synColl,a=(0,k.useState)(""),i=a[0],s=a[1],d=Xe((0,j.F_)(g.fV),1)[0],r=(new Date).toLocaleDateString();return(0,b.jsxs)("div",{className:" w-full flex flex-col space-y-3 ",children:[(0,b.jsxs)("h3",{className:" font-robot-slab font-semibold text-sky-300 text-xl ",children:["Synonym/s for meaning #",n]}),(0,b.jsx)("input",{placeholder:"Input new synonym here, ".concat(null===d||void 0===d?void 0:d.displayName),type:"text",value:i,onChange:function(e){return s(e.target.value)},className:" outline-none focus:outline-none w-full px-3 py-2 text-lg font-robot-slab font-semibold text-sky-400 bg-sky-800 rounded-md h-[50px] placeholder-sky-200 "}),(0,b.jsxs)("span",{className:" w-full flex items-center space-x-2 justify-between ",children:[(0,b.jsx)("span",{className:" w-[45%] "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),i?g.h.collection("hokkienWords").doc(t).collection("".concat(l)).add({synonym:i}):alert("No synonym input found, ".concat(null===d||void 0===d?void 0:d.displayName)),g.h.collection("hokkienWords").doc(t).collection("editorUpdates").add({update:i,updateText:"set synonym # ".concat(o," to ").concat(i),setBy:null===d||void 0===d?void 0:d.displayName,setOn:r}),s("")},className:" bg-transparent px-3 py-1 rounded border border-green-600 text-xl font-path-ex font-bold text-green-600 hover:border-green-500 hover:text-green-500 transform transition duration-300 ease-in-out w-full ",children:"Add synonym"})]})]})};function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Qe=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,N,w,S,T,C,F,W,B,A,I,D,U,O,_,E,V,R,z,L,K,Z,P,H,$,G,J,Y,Q,q,ee,te,ne,oe,le,ae,ie,se,de,re,ce,ue,ve,he,fe,pe,xe,me,ye,be,ke,ge=e.hit,je=e.id,Ne=Ye((0,j.F_)(g.fV),1)[0],we=(0,k.useState)(""),Se=we[0],Te=we[1],Me=(0,k.useState)(""),Ce=Me[0],Fe=Me[1],We=(0,k.useState)(""),Be=We[0],Ae=We[1],Ie=(0,k.useState)(""),De=Ie[0],Ue=Ie[1],Oe=(0,k.useState)(""),_e=Oe[0],Ee=Oe[1],Ve=(0,k.useState)(""),Re=Ve[0],ze=Ve[1],Le=(0,k.useState)(""),Ke=Le[0],Ze=Le[1],Pe=(0,k.useState)(""),$e=Pe[0],Xe=Pe[1],Je=(0,k.useState)(""),Qe=Je[0],qe=Je[1],et=(0,k.useState)(""),tt=et[0],nt=et[1],ot=(0,k.useState)(""),lt=ot[0],at=ot[1],it=(0,k.useState)(""),st=it[0],dt=it[1],rt=(0,k.useState)(""),ct=rt[0],ut=rt[1],vt=(0,k.useState)(""),ht=vt[0],ft=vt[1],pt=(0,k.useState)(""),xt=pt[0],mt=pt[1],yt=(0,k.useState)(""),bt=yt[0],kt=yt[1],gt=(0,k.useState)(""),jt=gt[0],Nt=gt[1],wt=(0,k.useState)(""),St=wt[0],Tt=wt[1],Mt=(0,k.useState)(""),Ct=Mt[0],Ft=Mt[1],Wt=(0,k.useState)(""),Bt=Wt[0],At=Wt[1],It=(0,k.useState)(""),Dt=It[0],Ut=It[1],Ot=(0,k.useState)(""),_t=Ot[0],Et=Ot[1],Vt=(0,k.useState)(""),Rt=Vt[0],zt=Vt[1],Lt=(0,k.useState)(""),Kt=Lt[0],Zt=Lt[1],Pt=(0,k.useState)(""),Ht=Pt[0],$t=Pt[1],Xt=(0,k.useState)(""),Gt=Xt[0],Jt=Xt[1],Yt=(0,k.useState)(""),Qt=Yt[0],qt=Yt[1],en=(0,k.useState)(""),tn=en[0],nn=en[1],on=(0,k.useState)(""),ln=on[0],an=on[1],sn=(0,k.useState)(""),dn=sn[0],rn=sn[1],cn=(0,k.useState)(""),un=(cn[0],cn[1],(0,k.useState)("")),vn=(un[0],un[1],(0,k.useState)("")),hn=(vn[0],vn[1],(0,k.useState)("")),fn=(hn[0],hn[1],(0,k.useState)("")),pn=(fn[0],fn[1],(0,k.useState)("")),xn=(pn[0],pn[1],(0,k.useState)("")),mn=(xn[0],xn[1],(0,k.useState)("")),yn=(mn[0],mn[1],(0,k.useState)("")),bn=(yn[0],yn[1],(0,k.useState)("")),kn=(bn[0],bn[1],(0,k.useState)("")),jn=(kn[0],kn[1],(0,k.useState)("")),Nn=(jn[0],jn[1],(0,k.useState)("")),wn=(Nn[0],Nn[1],(0,k.useState)("")),Sn=(wn[0],wn[1],(0,k.useState)("")),Tn=(Sn[0],Sn[1],(0,k.useState)("")),Mn=(Tn[0],Tn[1],(0,k.useState)("")),Cn=(Mn[0],Mn[1],(0,k.useState)("")),Fn=(Cn[0],Cn[1],(0,k.useState)("")),Wn=(Fn[0],Fn[1],(0,k.useState)("")),Bn=(Wn[0],Wn[1],(0,k.useState)("")),An=(Bn[0],Bn[1],(0,k.useState)("")),In=(An[0],An[1],(0,k.useState)("")),Dn=(In[0],In[1],(0,k.useState)("")),Un=(Dn[0],Dn[1],(0,k.useState)("")),On=(Un[0],Un[1],(0,k.useState)("")),_n=(On[0],On[1],(0,k.useState)("")),En=(_n[0],_n[1],(0,k.useState)("")),Vn=(En[0],En[1],(0,k.useState)("")),Rn=(Vn[0],Vn[1],(0,k.useState)("")),zn=(Rn[0],Rn[1],(0,k.useState)("")),Ln=(zn[0],zn[1],(0,k.useState)("")),Kn=(Ln[0],Ln[1],(new Date).toLocaleDateString(),Ye((0,M.ky)(g.h.doc("hokkienWords/".concat(je))),3)),Zn=Kn[0];return Kn[1],Kn[2],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor1stMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor2ndMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor3rdMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor4thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor5thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor6thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor7thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor8thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor9thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor10thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor11thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor12thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor13thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor14thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("synonymsFor15thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor1stMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor2ndMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor3rdMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor4thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor5thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor6thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor7thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor8thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor9thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor10thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor11thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor12thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor13thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor14thMean")),1)[0],Ye((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===ge||void 0===ge?void 0:ge._firestore_id)).collection("labelFor15thMean")),1)[0],(0,b.jsxs)("div",{className:" px-4 py-3 space-y-6 h-[98%] w-full overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500",children:[(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.type,meaning:null===(n=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===n?void 0:n.meaning}),(0,b.jsx)(He,{typeTitle:"type #1",meaningTitle:"meaning #1",inputValue:Se,setInputValue:Te,textAreaValue:Ce,setTextAreaValue:Fe,addBtnFunc:function(e){e.preventDefault(),Se&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({meaning:Ce,type:Se},{merge:!0}),Te(""),Fe(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Se," & ").concat(Ce)}))},meanType:null===(o=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===o?void 0:o.type,firstType:null===(l=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===l?void 0:l.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"1",synColl:"synonymsFor1stMean"})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3 ",children:[(0,b.jsx)(gn,{type:null===(a=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===a?void 0:a.secondType,meaning:null===(i=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===i?void 0:i.secondMeaning}),(0,b.jsx)(He,{typeTitle:"type #2",meaningTitle:"meaning #2",inputValue:De,setInputValue:Ue,textAreaValue:Be,setTextAreaValue:Ae,addBtnFunc:function(e){e.preventDefault(),De&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({secondMeaning:Be,secondType:De},{merge:!0}),Ue(""),Ae(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(De," & ").concat(Be)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.secondType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({secondMeaning:"",secondType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(s=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===s?void 0:s.secondType,firstType:null===(d=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===d?void 0:d.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"2",synColl:"synonymsFor2ndMean"})]}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:((null===(r=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===r?void 0:r.secondType)||Be)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(c=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===c?void 0:c.thirdType,meaning:null===(u=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===u?void 0:u.thirdMeaning}),(0,b.jsx)(He,{typeTitle:"type #3",meaningTitle:"meaning #3",inputValue:Re,setInputValue:ze,textAreaValue:_e,setTextAreaValue:Ee,addBtnFunc:function(e){e.preventDefault(),Re&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({thirdMeaning:_e,thirdType:Re},{merge:!0}),Ee(""),ze(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Re," & ").concat(_e)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.thirdType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({thirdMeaning:"",thirdType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(v=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===v?void 0:v.thirdType,firstType:null===(h=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===h?void 0:h.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"3",synColl:"synonymsFor3rdMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:((null===(f=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===f?void 0:f.thirdType)||_e)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(p=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===p?void 0:p.fourthType,meaning:null===(x=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===x?void 0:x.fourthMeaning}),(0,b.jsx)(He,{typeTitle:"type #4",meaningTitle:"meaning #4",inputValue:$e,setInputValue:Xe,textAreaValue:Ke,setTextAreaValue:Ze,addBtnFunc:function(e){e.preventDefault(),$e&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({fourthMeaning:Ke,fourthType:$e},{merge:!0}),Ze(""),Xe(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat($e," & ").concat(Ke)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.fourthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({fourthMeaning:"",fourthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(m=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===m?void 0:m.fourthType,firstType:null===(y=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===y?void 0:y.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"4",synColl:"synonymsFor4thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:((null===(N=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===N?void 0:N.fourthType)||Ke)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(w=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===w?void 0:w.fifthType,meaning:null===(S=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===S?void 0:S.fifthMeaning}),(0,b.jsx)(He,{typeTitle:"type #5",meaningTitle:"meaning #5",inputValue:tt,setInputValue:nt,textAreaValue:Qe,setTextAreaValue:qe,addBtnFunc:function(e){e.preventDefault(),tt&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({fifthMeaning:Qe,fifthType:tt},{merge:!0}),qe(""),nt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(tt," & ").concat(Qe)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.fifthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({fifthMeaning:"",fifthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(T=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===T?void 0:T.fifthType,firstType:null===(C=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===C?void 0:C.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"5",synColl:"synonymsFor5thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:(null===(F=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===F?void 0:F.fifthType)||Qe&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(W=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===W?void 0:W.sixthType,meaning:null===(B=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===B?void 0:B.sixthMeaning}),(0,b.jsx)(He,{typeTitle:"type #6",meaningTitle:"meaning #6",inputValue:st,setInputValue:dt,textAreaValue:lt,setTextAreaValue:at,addBtnFunc:function(e){e.preventDefault(),st&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({sixthMeaning:lt,sixthType:st},{merge:!0}),at(""),dt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"sixth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(st," & ").concat(lt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.sixthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({sixthMeaning:"",sixthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"sixth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(A=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===A?void 0:A.sixthType,firstType:null===(I=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===I?void 0:I.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"6",synColl:"synonymsFor6thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:(null===(D=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===D?void 0:D.sixthType)||lt&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(U=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===U?void 0:U.seventhType,meaning:null===(O=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===O?void 0:O.seventhMeaning}),(0,b.jsx)(He,{typeTitle:"type #7",meaningTitle:"meaning #7",inputValue:ht,setInputValue:ft,textAreaValue:ct,setTextAreaValue:ut,addBtnFunc:function(e){e.preventDefault(),ht&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({seventhMeaning:ct,seventhType:ht},{merge:!0}),ut(""),ft(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(ht," & ").concat(ct)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.seventhType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({seventhMeaning:"",seventhType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(_=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===_?void 0:_.seventhType,firstType:null===(E=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===E?void 0:E.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"7",synColl:"synonymsFor7thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:(null===(V=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===V?void 0:V.seventhType)||ct&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(R=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===R?void 0:R.eighthType,meaning:null===(z=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===z?void 0:z.eighthMeaning}),(0,b.jsx)(He,{typeTitle:"type #8",meaningTitle:"meaning #8",inputValue:bt,setInputValue:kt,textAreaValue:xt,setTextAreaValue:mt,addBtnFunc:function(e){e.preventDefault(),bt&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({eighthMeaning:xt,eighthType:bt},{merge:!0}),mt(""),kt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(bt," & ").concat(xt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.eighthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({eighthMeaning:"",eighthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(L=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===L?void 0:L.eighthType,firstType:null===(K=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===K?void 0:K.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"8",synColl:"synonymsFor8thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:(null===(Z=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===Z?void 0:Z.eighthType)||xt&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(P=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===P?void 0:P.ninthType,meaning:null===(H=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===H?void 0:H.ninthMeaning}),(0,b.jsx)(He,{typeTitle:"type #9",meaningTitle:"meaning #9",inputValue:St,setInputValue:Tt,textAreaValue:jt,setTextAreaValue:Nt,addBtnFunc:function(e){e.preventDefault(),St&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({ninthMeaning:jt,ninthType:St},{merge:!0}),Nt(""),Tt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"ninth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(St," & ").concat(jt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.ninthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({nintheaning:"",ninthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"ninth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===($=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===$?void 0:$.ninthType,firstType:null===(G=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===G?void 0:G.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"9",synColl:"synonymsFor9thMean"})]})}),(0,b.jsx)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:(null===(J=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===J?void 0:J.ninthType)||jt&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(gn,{type:null===(Y=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===Y?void 0:Y.tenthType,meaning:null===(Q=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===Q?void 0:Q.tenthMeaning}),(0,b.jsx)(He,{typeTitle:"type #10",meaningTitle:"meaning #10",inputValue:Bt,setInputValue:At,textAreaValue:Ct,setTextAreaValue:Ft,addBtnFunc:function(e){e.preventDefault(),Bt&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({tenthMeaning:Ct,tenthType:Bt},{merge:!0}),Ft(""),At(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"tenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Bt," & ").concat(Ct)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.tenthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({tenthMeaning:"",tenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"tenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(q=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===q?void 0:q.tenthType,firstType:null===(ee=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ee?void 0:ee.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"10",synColl:"synonymsFor10thMean"})]})}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(te=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===te?void 0:te.eleventhType,meaning:null===(ne=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ne?void 0:ne.elventhMeaning}),(0,b.jsx)(He,{typeTitle:"type #11",meaningTitle:"meaning #11",inputValue:_t,setInputValue:Et,textAreaValue:Dt,setTextAreaValue:Ut,addBtnFunc:function(e){e.preventDefault(),_t&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({eleventhMeaning:Dt,eleventhType:_t},{merge:!0}),Ut(""),Et(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"eleventh meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(_t," & ").concat(Dt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.eleventhType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({eleventhMeaning:"",eleventhType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"eleventh meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(oe=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===oe?void 0:oe.eleventhType,firstType:null===(le=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===le?void 0:le.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"11",synColl:"synonymsFor11thMean"})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(ae=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ae?void 0:ae.twelfthType,meaning:null===(ie=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ie?void 0:ie.twelfthMeaning}),(0,b.jsx)(He,{typeTitle:"type #12",meaningTitle:"meaning #12",inputValue:Kt,setInputValue:Zt,textAreaValue:Rt,setTextAreaValue:zt,addBtnFunc:function(e){e.preventDefault(),Kt&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({twelfthMeaning:Rt,twelfthType:Kt},{merge:!0}),zt(""),Zt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"twelfth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Kt," & ").concat(Rt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.twelfthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({twelfthMeaning:"",twelfthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"twelfth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(se=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===se?void 0:se.twelfthType,firstType:null===(de=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===de?void 0:de.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"12",synColl:"synonymsFor12thMean"})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(re=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===re?void 0:re.thirteenthType,meaning:null===(ce=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ce?void 0:ce.thirteenthMeaning}),(0,b.jsx)(He,{typeTitle:"type #13",meaningTitle:"meaning #13",inputValue:Gt,setInputValue:Jt,textAreaValue:Ht,setTextAreaValue:$t,addBtnFunc:function(e){e.preventDefault(),Gt&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({thirteenthMeaning:Ht,thirteenthType:Gt},{merge:!0}),$t(""),Jt(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"thirteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Gt," & ").concat(Ht)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.thirteenthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({secondMeaning:"",secondType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"thirteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(ue=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ue?void 0:ue.thirteenthType,firstType:null===(ve=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ve?void 0:ve.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"13",synColl:"synonymsFor13thMean"})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(he=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===he?void 0:he.fourteenthType,meaning:null===(fe=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===fe?void 0:fe.fourteenthMeaning}),(0,b.jsx)(He,{typeTitle:"type #14",meaningTitle:"meaning #14",inputValue:tn,setInputValue:nn,textAreaValue:Qt,setTextAreaValue:qt,addBtnFunc:function(e){e.preventDefault(),tn&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({fourteenthMeaning:Qt,fourteenthType:tn},{merge:!0}),qt(""),nn(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fourteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(tn," & ").concat(Qt)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.fourteenthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({fourteenthMeaning:"",fourteenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fourteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(pe=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===pe?void 0:pe.fourteenthType,firstType:null===(xe=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===xe?void 0:xe.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"14",synColl:"synonymsFor14thMean"})]}),(0,b.jsxs)("div",{className:" flex flex-col space-y-3 w-full my-4 shadow-lg shadow-sky-600 py-3",children:[(0,b.jsx)(gn,{type:null===(me=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===me?void 0:me.fifteenthType,meaning:null===(ye=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ye?void 0:ye.fifteenthMeaning}),(0,b.jsx)(He,{typeTitle:"type #15",meaningTitle:"meaning #15",inputValue:dn,setInputValue:rn,textAreaValue:ln,setTextAreaValue:an,addBtnFunc:function(e){e.preventDefault(),dn&&(g.h.doc("/hokkienWords/".concat(null===Zn||void 0===Zn?void 0:Zn.id)).set({fifteenthMeaning:ln,fifteenthType:dn},{merge:!0}),an(""),rn(""),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fifteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"".concat(dn," & ").concat(ln)}))},delBtnFunc:function(e){var t;e.preventDefault(),(null===(t=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===t?void 0:t.fifteenthType)&&(g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).set({fifteenthMeaning:"",fifteenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===Zn||void 0===Zn?void 0:Zn.id).collection("editorUpdates").add({updated:"fifteenth meaning & type",updatedBy:null===Ne||void 0===Ne?void 0:Ne.displayName,updatedOn:X.Z.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))},meanType:null===(be=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===be?void 0:be.fifteenthType,firstType:null===(ke=null===Zn||void 0===Zn?void 0:Zn.data())||void 0===ke?void 0:ke.type}),(0,b.jsx)(Ge,{docId:null===Zn||void 0===Zn?void 0:Zn.id,synNo:"15",synColl:"synonymsFor15thMean"})]})]})};function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tt=function(){var e=(0,N.useRouter)(),t=et((0,j.F_)(g.fV),1)[0];return(0,b.jsxs)("header",{className:" top-0 z-50 sticky w-full h-[60px] rounded bg-slate-700 bg-opacity-80 flex items-center justify-evenly px-4 py-3 ",children:[(0,b.jsx)(s.Z,{onClick:function(){return e.push("/")},color:"lightBlue",buttonType:"link",iconOnly:!0,ripple:"light",className:"px-2",children:(0,b.jsx)(d.Z,{name:"home"})}),(0,b.jsx)("img",{src:null===t||void 0===t?void 0:t.displayName,alt:"",className:" h-12 w-12 rounded-full border border-emerald-400 "})]})};function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var lt=function(e){var t,n=e.id,o=e.meanNumber,l=e.type,a=e.meaning,i=e.typeInput,s=e.meaningInput,d=e.setTypeInput,r=e.setMeaningInput,c=e.addBtn,u=e.delBtn,v=ot((0,M.ky)(g.h.doc("hokkienWords/".concat(n))),3),h=v[0];return v[1],v[2],console.log("Data return for type",l),(0,b.jsxs)("div",{className:" flex flex-col items-start w-full px-3 py-2 space-y-2 ",children:[(0,b.jsxs)("span",{className:" flex flex-col w-full ",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authMeaningsListNo",children:o}),(0,b.jsx)("h3",{className:"authMeaningsListType",children:l})]}),(0,b.jsx)("h5",{className:"authMeaningsListMean",children:a})]}),(0,b.jsxs)("span",{className:" flex flex-col w-full space-y-2 ",children:[(0,b.jsx)("input",{placeholder:"Updated type",type:"text",value:i,onChange:function(e){return d(e.target.value)},className:" w-full h-[60px] rounded bg-transparent border border-sky-500 px-3 py-2 text-sky-400 placeholder-sky-600 font-fira-sans font-semibold text-lg outline-none "}),(0,b.jsx)("textarea",{placeholder:"Updated meaning",value:s,onChange:function(e){return r(e.target.value)},className:" w-full h-[240px] rounded bg-transparent border border-sky-500 px-3 py-2 text-sky-400 placeholder-sky-600 font-fira-sans font-semibold text-lg outline-none "})]}),(0,b.jsxs)("span",{className:" w-full flex items-center px-3 py-2 justify-between ",children:[(0,b.jsx)("span",{className:"w-[50%]"}),(0,b.jsxs)("span",{className:" w-[50%] flex items-center space-x-2 px-2 ",children:[(null===(t=null===h||void 0===h?void 0:h.data())||void 0===t?void 0:t.meaning)!==a&&(0,b.jsx)("button",{onClick:u,className:" w-full h-[55px] px-3 py-2 rounded text-lg text-red-500 border border-red-500 hover:border-red-600 hover:text-red-600 outline-none transform transition duration-300 ease-in-out ",children:"Delete"}),l?(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("button",{onClick:c,className:" w-full h-[55px] px-3 py-2 rounded text-lg text-sky-500 border border-sky-500 hover:border-sky-600 hover:text-sky-600 outline-none transform transition duration-300 ease-in-out ",children:"Update"})}):(0,b.jsx)("button",{onClick:c,className:" w-full h-[55px] px-3 py-2 rounded text-lg text-sky-500 border border-sky-500 hover:border-sky-600 hover:text-sky-600 outline-none transform transition duration-300 ease-in-out ",children:"Add"})]})]})]})};function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function it(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return at(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return at(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var st=function(e){var t,n,o,l,a,i,s,d,r,c=e.hit,u=(e.id,e.primeDataReturn),v=((0,N.useRouter)(),it((0,j.F_)(g.fV),1)[0],(0,k.useState)(!1)),h=v[0],f=v[1],p=(0,k.useState)(!1),x=p[0],m=p[1],y=(0,k.useState)(!1),w=y[0],S=y[1],T=it((0,M.ky)(g.h.doc("/hokkienWords/".concat(null===c||void 0===c?void 0:c.id))),3),C=T[0];return T[1],T[2],(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" flex items-center space-x-2 w-[90%] mx-auto max-h-[160px] min-h-[160px] rounded-md border border-sky-700 bg-opacity-90 px-3 py-2 cursor-pointer hover:border-sky-800 hover:shadow-xl transform transition-all delay-150 duration-200 ease-in-out my-6 justify-between ",children:[(0,b.jsx)("h1",{className:"authSearchHokkien ",children:u}),(0,b.jsx)("h1",{className:"authSearchHanzi",children:null===(t=null===C||void 0===C?void 0:C.data())||void 0===t?void 0:t.hanzi}),(0,b.jsxs)("span",{className:" flex flex-col w-[30%] space-y-2 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-500 text-lg ",children:null===(n=null===C||void 0===C?void 0:C.data())||void 0===n?void 0:n.type}),(0,b.jsx)("p",{className:"authSearchMeaning ",children:null===(o=null===C||void 0===C?void 0:C.data())||void 0===o?void 0:o.meaning})]}),(0,b.jsxs)("span",{className:"authSearchBtns",children:[(null===(l=null===C||void 0===C?void 0:C.data())||void 0===l?void 0:l.secondType)&&(0,b.jsx)("button",{onClick:function(){(x||w)&&(m(!1)||S(!1)),f(!0)},className:" w-full border border-sky-500 text-base text-sky-500 font-fira-sans font-semibold hover:border-sky-400 hover:text-sky-400 transform transition duration-300 rounded ease-in-out ",children:"Meaning/s"}),(0,b.jsx)("button",{onClick:function(){(h||w)&&(f(!1)||S(!1)),m(!0)},className:" w-full border border-sky-500 text-base text-sky-500 font-fira-sans font-semibold hover:border-sky-400 hover:text-sky-400 transform transition duration-300 rounded ease-in-out ",children:"Details"}),(0,b.jsx)("button",{onClick:function(){(h||x)&&(f(!1)||m(!1)),S(!0)},className:" w-full border border-sky-500 text-base text-sky-500 font-fira-sans font-semibold hover:border-sky-400 hover:text-sky-400 transform transition duration-300 rounded ease-in-out ",children:"Edit"})]})]},null===C||void 0===C?void 0:C.id),h&&(0,b.jsx)("div",{className:" h-screen w-screen bg-slate-900 bg-opacity-90 z-50 fixed inset-0 grid place-items-center ",children:(0,b.jsxs)("main",{className:"authSearchModalMain",children:[(0,b.jsxs)("header",{className:"authSearchModalHeader",children:[(0,b.jsx)("h3",{className:"authSearchModalHeaderTitle",children:"Meanings list"}),(0,b.jsx)("button",{onClick:function(){return f(!1)},className:"authSearchModalHeaderBtn",children:"X"})]}),(0,b.jsx)(Sn,{docId:null===c||void 0===c?void 0:c.id})]})}),x&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-800 bg-opacity-90 z-50 fixed inset-0 grid place-items-center ",children:(0,b.jsxs)("main",{className:"authSearchModalMain",children:[(0,b.jsxs)("header",{className:"authSearchModalHeader",children:[(0,b.jsx)("h3",{className:"authSearchModalHeaderTitle",children:"Word details"}),(0,b.jsx)("button",{onClick:function(){return m(!1)},className:"authSearchModalHeaderBtn",children:"X"})]}),(0,b.jsx)(Bn,{docId:null===c||void 0===c?void 0:c.id})]})}),w&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 z-50 fixed inset-0 grid place-items-center ",children:(0,b.jsxs)("main",{className:"authSearchModalMain",children:[(0,b.jsxs)("header",{className:"authSearchModalHeader",children:[(0,b.jsx)("h3",{className:"authSearchModalHeaderTitle",children:"Edit word details"}),(0,b.jsx)("button",{onClick:function(){return S(!1)},className:"authSearchModalHeaderBtn",children:"X"})]}),(0,b.jsx)(Cn,{id:null===C||void 0===C?void 0:C.id,hokkienValue:null===(a=null===C||void 0===C?void 0:C.data())||void 0===a?void 0:a.hokkien,taiLoValue:null===(i=null===C||void 0===C?void 0:C.data())||void 0===i?void 0:i.taiLo,hanziValue:null===(s=null===C||void 0===C?void 0:C.data())||void 0===s?void 0:s.hanzi,lannangValue:null===(d=null===C||void 0===C?void 0:C.data())||void 0===d?void 0:d.lannang,pojValue:null===(r=null===C||void 0===C?void 0:C.data())||void 0===r?void 0:r.poj})]})})]})};function dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return dt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ct=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,k,j,N,w,S,T=e.hit,C=rt((0,M.ky)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id))),3),F=C[0],W=(C[1],C[2],rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor1stMean").orderBy("synonymNo","asc")),1)[0]),B=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor2ndMean").orderBy("synonymNo","asc")),1)[0],A=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor3rdMean").orderBy("synonymNo","asc")),1)[0],I=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor4thMean").orderBy("synonymNo","asc")),1)[0],D=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor5thMean").orderBy("synonymNo","asc")),1)[0],U=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor6thMean").orderBy("synonymNo","asc")),1)[0],O=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor7thMean").orderBy("synonymNo","asc")),1)[0],_=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("synonymsFor8thMean").orderBy("synonymNo","asc")),1)[0],E=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor1stMean").orderBy("addedOn","asc")),1)[0],V=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor2ndMean").orderBy("addedOn","asc")),1)[0],R=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor3rdMean").orderBy("addedOn","asc")),1)[0],z=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor4thMean").orderBy("addedOn","asc")),1)[0],L=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor5thMean").orderBy("addedOn","asc")),1)[0],K=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor6thMean").orderBy("addedOn","asc")),1)[0],Z=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor7thMean").orderBy("addedOn","asc")),1)[0],P=rt((0,M.Kx)(g.h.doc("hokkienWords/".concat(null===T||void 0===T?void 0:T._firestore_id)).collection("labelFor8thMean").orderBy("addedOn","asc")),1)[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" modalMeaningsSpanTop ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(t=null===F||void 0===F?void 0:F.data())||void 0===t?void 0:t.type}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:E&&(null===E||void 0===E?void 0:E.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:"modalMeaningsMeaning place-self-center ",children:null===(n=null===F||void 0===F?void 0:F.data())||void 0===n?void 0:n.meaning})]}),W&&(null===W||void 0===W?void 0:W.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(o=null===F||void 0===F?void 0:F.data())||void 0===o?void 0:o.secondType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(l=null===F||void 0===F?void 0:F.data())||void 0===l?void 0:l.secondType}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:V&&(null===V||void 0===V?void 0:V.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(a=null===F||void 0===F?void 0:F.data())||void 0===a?void 0:a.secondMeaning}),B&&(null===B||void 0===B?void 0:B.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(i=null===F||void 0===F?void 0:F.data())||void 0===i?void 0:i.thirdType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(s=null===F||void 0===F?void 0:F.data())||void 0===s?void 0:s.thirdType}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:R&&(null===R||void 0===R?void 0:R.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(d=null===F||void 0===F?void 0:F.data())||void 0===d?void 0:d.thirdMeaning}),""!==A&&(null===A||void 0===A?void 0:A.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(r=null===F||void 0===F?void 0:F.data())||void 0===r?void 0:r.fourthType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(c=null===F||void 0===F?void 0:F.data())||void 0===c?void 0:c.fourthType}),(0,b.jsx)("span",{className:" h-[60px] min-min-w-[448px] max-w-[540px] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:z&&(null===z||void 0===z?void 0:z.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(u=null===F||void 0===F?void 0:F.data())||void 0===u?void 0:u.fourthMeaning}),I&&(null===I||void 0===I?void 0:I.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(v=null===F||void 0===F?void 0:F.data())||void 0===v?void 0:v.fifthType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(h=null===F||void 0===F?void 0:F.data())||void 0===h?void 0:h.fifthType}),L&&(null===L||void 0===L?void 0:L.docs.map((function(e){var t;return(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})})))]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(f=null===F||void 0===F?void 0:F.data())||void 0===f?void 0:f.fifthMeaning}),D&&(null===D||void 0===D?void 0:D.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(p=null===F||void 0===F?void 0:F.data())||void 0===p?void 0:p.sixthType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(x=null===F||void 0===F?void 0:F.data())||void 0===x?void 0:x.sixthType}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:K&&(null===K||void 0===K?void 0:K.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(m=null===F||void 0===F?void 0:F.data())||void 0===m?void 0:m.sixthMeaning}),""!==U&&(null===U||void 0===U?void 0:U.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(y=null===F||void 0===F?void 0:F.data())||void 0===y?void 0:y.seventhType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(k=null===F||void 0===F?void 0:F.data())||void 0===k?void 0:k.seventhType}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:Z&&(null===Z||void 0===Z?void 0:Z.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(j=null===F||void 0===F?void 0:F.data())||void 0===j?void 0:j.seventhMeaning}),""!==O&&(null===O||void 0===O?void 0:O.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]}),(null===(N=null===F||void 0===F?void 0:F.data())||void 0===N?void 0:N.eighthType)&&(0,b.jsxs)("span",{className:" modalMeaningsSpan ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[80%] mx-auto ",children:[(0,b.jsx)("h3",{className:"modalMeaningsType ",children:null===(w=null===F||void 0===F?void 0:F.data())||void 0===w?void 0:w.eighthType}),(0,b.jsx)("span",{className:" h-[60px] w-[80%] overflow-x-scroll space-x-7 scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex items-center px-3 ",children:P&&(null===P||void 0===P?void 0:P.docs.map((function(e){var t;return(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-lg text-sky-300 px-3 py-1 min-w-[240px] rounded-md ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.label})})))})]}),(0,b.jsx)("h1",{className:" modalMeaningsMeaning ",children:null===(S=null===F||void 0===F?void 0:F.data())||void 0===S?void 0:S.eighthMeaning}),""!==_&&(null===_||void 0===_?void 0:_.docs.map((function(e){var t;return(0,b.jsxs)("span",{className:" flex items-center space-x-3 px-3 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sm text-sky-50 ",children:"Synonym/s:"}),(0,b.jsx)("p",{className:" font-fira-sans font-semibold text-base text-sky-300 ",children:null===(t=null===e||void 0===e?void 0:e.data())||void 0===t?void 0:t.synonym})]})})))]})]})};function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function vt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ut(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ht=function(){var e=(0,N.useRouter)(),t=vt((0,j.F_)(g.fV),1)[0];return(0,b.jsxs)("header",{className:" top-0 z-50 sticky flex items-center justify-between px-7 py-5 h-[70px] bg-slate-800 ",children:[(0,b.jsx)("button",{onClick:function(){return e.push("/")},className:" border-sky-500 border rounded-3xl px-3 py-2 hover:border-2 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(x.eT8,{style:{color:"lightblue",fontSize:"1.4em"}})}),(0,b.jsx)("h1",{className:" font-black font-path-ex text-base text-sky-50 ",children:null===t||void 0===t?void 0:t.displayName})]})};function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function pt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ft(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var xt=function(e){var t=e.mainButtonAction,n=(e.buttonAction,pt((0,j.F_)(g.fV),1)[0]),o=(0,k.useState)(!1),l=o[0],a=o[1],i=(0,k.useState)(!1),s=i[0],d=i[1],r=(0,k.useState)(!1),c=r[0],u=r[1],v=(0,k.useState)(!1),h=v[0],f=v[1],p=(0,k.useState)(!1),x=p[0],m=p[1];return(0,b.jsx)("div",{className:" bg-slate-900 bg-opacity-80 inset-0 z-50 fixed grid place-items-center ",children:(0,b.jsxs)("div",{className:" specificSearchModal ",children:[(0,b.jsxs)("header",{className:" top-0 z-50 sticky flex items-center justify-between border-b border-sky-500 px-4 py-3 h-[10%] ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-lg text-sky-200 ",children:"Specific search"}),(0,b.jsx)("button",{onClick:t,className:" text-xl text-sky-200 font-path-ex font-bold border border-sky-200 rounded-full px-3 py-1 hover:border-sky-500 hover:text-sky-500 transform transition delay-75 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[90%] w-full py-2 flex flex-col items-center space-x-2 ",children:[(0,b.jsxs)("span",{className:" h-[85px] w-[98%] bg-transparent rounded-lg flex items-center overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-700 px-5 mx-5 space-x-5 ",children:[(0,b.jsx)("button",{onClick:function(){a(!0),(s||c||x||h)&&(d(!1)||u(!1)||m(!1)||f(!1))},className:" specificSearchBtn ",children:"Hanzi"}),(0,b.jsx)("button",{onClick:function(){d(!0),(c||l||x||h)&&(u(!1)||a(!1)||m(!1)||f(!1))},className:" specificSearchBtn ",children:"Lannang"}),(0,b.jsx)("button",{onClick:function(){u(!0),(s||l||x||h)&&(d(!1)||a(!1)||m(!1)||f(!1))},className:" specificSearchBtn ",children:"POJ"}),("rumlowb@gmail.com"==(null===n||void 0===n?void 0:n.email)||"marvin_sy@dlsu.edu.ph"==(null===n||void 0===n?void 0:n.email)||"sygrandkaiser@gmail.com"==(null===n||void 0===n?void 0:n.email)||"reaperiff697@gmail.com"==(null===n||void 0===n?void 0:n.email))&&(0,b.jsx)("button",{onClick:function(){m(!0),(s||l||c||h)&&(d(!1)||a(!1)||u(!1)||f(!1))},className:" specificSearchBtn ",children:"Duplicate"})]}),(0,b.jsxs)("div",{className:" h-[90%] w-full bg-gradient-to-br from-slate-900 to-sky-900 bg-opacity-80 ",children:[l&&(0,b.jsx)(Nt,{}),s&&(0,b.jsx)(Tt,{}),c&&(0,b.jsx)(Ft,{}),x&&(0,b.jsx)(Jt,{}),(!l||!s||!c||!x)&&(0,b.jsxs)("div",{className:" h-full w-full flex flex-col justify-center items-center space-y-5 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Welcome to the specfic search"}),(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"To start, press any of the tabs at the top"})]})]})]})]})})},mt=n(2608),yt=n(4793),bt=n(4606),kt=n(4859),gt=(0,mt.instantMeiliSearch)("https://ms-f7385f37fa20-3740.sfo.meilisearch.io","90cfa7394bf3c968b8d66f6868817717c6f6f33a"),jt=(0,ue.Z)((function(e){var t=e.currentRefinement,n=e.refine;return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-600 border-4 border-slate-500 bg-opacity-80 px-4 py-3 mx-auto mt-2 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search hanzi...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-100 font-path-ex font-normal text-lg "})})}));var Nt=function(){return(0,b.jsxs)(yt.Z,{indexName:"hokkienWords",searchClient:gt,stalledSearchDelay:150,children:[(0,b.jsx)(jt,{}),(0,b.jsx)("div",{className:" h-[75%] w-[90%] mx-auto my-auto place-self-center grid place-items-center overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-600 ",children:(0,b.jsx)(bt.Z,{hitComponent:Et})}),(0,b.jsx)(kt.Z,{hitsPerPage:12,attributesToHighlight:["hanzi","_firestore_id"],atrributesToRetrieve:["_firestore_id","hanzi"],attributesToSnippet:["hanzi","*:80"],searchableAttributes:["hanzi"],restrictSearchableAttributes:["hanzi"],attributeForDistinct:["hanzi"],distinct:1,relevanyStrictness:100,ranking:["asc(hanzi)","hokkien","lannang","poj","meaning","type","secondMeaning","secondType","thirdMeaning","thirdType","fourthMeaning","fourthType","fifthMeaning","fifthType","sixthMeaning","sixthType","seventhMeaning","seventhType","eighthMeaning","eighthType","ninthMeaning","ninthType","tenthMeaning","tenthType","eleventhMeaning","eleventhType","twelfthMeaning","twelfthType","thirteenthMeaning","thirteenthType","fourteenthMeaning","fourteenthType","fifteenthMeaning","fifteenthType"]})]})},wt=(0,mt.instantMeiliSearch)("https://ms-f7385f37fa20-3740.sfo.meilisearch.io","90cfa7394bf3c968b8d66f6868817717c6f6f33a"),St=(0,ue.Z)((function(e){var t=e.currentRefinement,n=e.refine;return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-600 border-4 border-slate-500 bg-opacity-80 px-4 py-3 mx-auto mt-2 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search lannang...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-100 font-path-ex font-normal text-lg "})})}));var Tt=function(){return(0,b.jsxs)(yt.Z,{indexName:"hokkienWords",stalledSearchDelay:150,searchClient:wt,children:[(0,b.jsx)(St,{}),(0,b.jsxs)("div",{className:" h-[75%] w-[90%] mx-auto my-auto place-self-center grid place-items-center overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-600 ",children:[(0,b.jsx)(bt.Z,{hitComponent:Ut}),(0,b.jsx)(kt.Z,{hitsPerPage:12,restrictSearchableAttributes:["lannang"],atrributesToRetrieve:["_firestore_id","lannang","type","meaning"],attributeForDistinct:"lannang",distinct:1,attributesToHighlight:["lannang","_firestore_id"],attributesToSnippet:["lannang","*:80"],searchableAttributes:["lannang"]})]})]})},Mt=(0,mt.instantMeiliSearch)("https://ms-f7385f37fa20-3740.sfo.meilisearch.io","90cfa7394bf3c968b8d66f6868817717c6f6f33a"),Ct=(0,ue.Z)((function(e){var t=e.currentRefinement,n=e.refine;return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-600 border-4 border-slate-500 bg-opacity-80 px-4 py-3 mx-auto mt-2 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search POJ...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-100 font-path-ex font-normal text-lg "})})}));var Ft=function(){return(0,b.jsxs)(yt.Z,{indexName:"hokkienWords",stalledSearchDelay:150,searchClient:Mt,children:[(0,b.jsx)(Ct,{}),(0,b.jsxs)("div",{className:" h-[75%] w-[90%] mx-auto my-auto place-self-center grid place-items-center overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-600 ",children:[(0,b.jsx)(bt.Z,{hitComponent:zt}),(0,b.jsx)(kt.Z,{hitsPerPage:12,atrributesToRetrieve:["_firestore_id","poj","type","meaning"],restrictSearchableAttributes:["poj"],enablePersonalization:!0,distinct:1})]})]})};function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var At=function(e){var t=e.hit,n=e.buttonAction,o=Bt((0,j.F_)(g.fV),1)[0],l=(0,k.useState)(""),a=l[0],i=(l[1],Bt((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===t||void 0===t?void 0:t._firestore_id)).collection("comments")),1)[0]);return(0,b.jsxs)("div",{className:" specSearchModal ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full border-b border-sky-500 flex items-center justify-between px-3 py-2 ",children:[(0,b.jsxs)("h4",{className:" specSearchModalHeader ",children:["Comments for ",null===t||void 0===t?void 0:t.hokkien]}),(0,b.jsx)("button",{onClick:n,className:" rounded-full py-1 px-3 font-path-ex font-bold text-sky-500 border border-sky-500 hover:text-sky-300 hover:border-2 hover:border-sky-300 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full bg-gradient-to-br from-sky-900 to-slate-900 overflow-hidden ",children:[((null===t||void 0===t?void 0:t.addedBy)==(null===o||void 0===o?void 0:o.displayName)||"rumlowb@gmail.com"==(null===o||void 0===o?void 0:o.email)||"marvin_sy@dlsu.edu.ph"==(null===o||void 0===o?void 0:o.email))&&o&&(0,b.jsxs)("div",{className:" specSearchForm ",children:[(0,b.jsx)("textarea",{value:a,onChange:function(e){return setNote(e.target.value)},placeholder:"Add a comment, ".concat(null===o||void 0===o?void 0:o.displayName),className:" specSearchModalTextArea overflow-y-scroll scrollbar-hide "}),(0,b.jsxs)("span",{className:" flex w-full h-[35%] justify-between px-3 py-2 ",children:[(0,b.jsx)("h1",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),!note&&alert("You seem to have forgotten your comment. Try again"),g.h.doc("/hokkienWords/".concat(null===t||void 0===t?void 0:t._firestore_id)).collection("comments").add({comment:a,commentAdder:null===o||void 0===o?void 0:o.displayName,commentTimestamp:X.Z.firestore.FieldValue.serverTimestamp()}),setNote("")},className:"specSearchModalAddNoteBtn ",children:"add comment"})]})]}),(0,b.jsx)("div",{className:" specSearchData overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 ",children:i&&(null===i||void 0===i?void 0:i.docs.map((function(e){return(0,b.jsx)(b.Fragment,{})})))})]}),(0,b.jsx)("footer",{className:" h-[10%] w-full flex items-center justify-evenly px-4 py-3 border-t-2 border-sky-500 "})]})};function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return It(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ut=function(e){var t,n,o,l,a=e.hit,i=(0,N.useRouter)(),s=Dt((0,j.F_)(g.fV),1)[0],d=(0,k.useState)(!1),r=d[0],c=d[1],u=Dt((0,M.ky)(g.h.doc("hokkienWords/".concat(null===a||void 0===a?void 0:a._firestore_id))),3),v=u[0],p=(u[1],u[2],(0,k.useState)(!1)),x=p[0],m=p[1],y=(0,k.useState)(!1),w=y[0],S=y[1];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" specificResultsDiv group ",children:[(0,b.jsx)("span",{className:" w-full px-3 ",children:(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-lg text-sky-500 group-hover:text-sky-300 transform transition duration-200 ease-in ",children:null===(t=null===v||void 0===v?void 0:v.data())||void 0===t?void 0:t.lannang})}),(0,b.jsxs)("span",{className:" px-3 flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:function(){return c(!0)},className:" rounded-full p-3 border text-sky-600 border-sky-600 hover:border-sky-500 hover:text-sky-500 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(h.bBz,{style:{color:"whitesmoke",fontSize:"1.4em"}})}),("rumlowb@gmail.com"==(null===s||void 0===s?void 0:s.email)||"marvin_sy@dlsu.edu.ph"==(null===s||void 0===s?void 0:s.email)||(null===s||void 0===s?void 0:s.displayName)==(null===a||void 0===a?void 0:a.addedBy))&&(0,b.jsx)("button",{onClick:function(){return setDeleteModal(!0)},className:" rounded-full p-3 border text-red-600 border-red-600 hover:border-red-500 hover:text-red-500 focus:outline-red-400 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(f.GH,{style:{color:"whitesmoke",fontSize:"1.4em"}})})]})]}),r&&(0,b.jsx)("div",{className:" w-full h-full fixed z-50 inset-0 grid place-items-center bg-slate-900 bg-opacity-100 overflow-hidden ",children:(0,b.jsxs)("div",{className:" specificSearchInnerModal ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full px-4 py-2 flex items-center justify-between border-b border-sky-500 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-200 ",children:"Info about lannang:"}),(0,b.jsx)("button",{onClick:function(){return c(!1)},className:" rounded-full px-3 py-1 font-path-ex font-black text-sky-500 border-sky-500 hover:text-sky-700 hover:border-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[90%] w-full grid place-items-start space-y-2 px-4 py-2 ",children:[(0,b.jsx)("h3",{className:" text-lg text-sky-400 font-path-ex font-semibold ",children:"lannang:"}),(0,b.jsx)("h1",{className:" place-self-center text-xl text-sky-600 font-fira-sans font-bold ",children:null===(n=null===v||void 0===v?void 0:v.data())||void 0===n?void 0:n.lannang}),(0,b.jsxs)("span",{className:" flex flex-col items-start space-y-2 w-full ",children:[(0,b.jsx)("h4",{className:" font-path-ex font-semibold text-sky-700 text-base ",children:null===(o=null===v||void 0===v?void 0:v.data())||void 0===o?void 0:o.type}),(0,b.jsx)("h5",{className:" font-path-ex font-bold text-sky-600 text-lg ",children:null===(l=null===v||void 0===v?void 0:v.data())||void 0===l?void 0:l.meaning})]})]}),(0,b.jsx)("footer",{className:" bottom-0 z-50 sticky flex items-center space-x-3 px-4 py-2 ",children:(0,b.jsxs)("span",{className:" w-full flex justify-evenly items-center space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){1==w&&S(!1),c(!1),m(!0)},className:" specSearchBtn text-sky-300 border border-sky-300 hover:text-sky-500 hover:border-sky-500 hover:border-2 focus:outline-none ",children:"Notes"}),(0,b.jsx)("button",{onClick:function(){1==x&&m(!1),c(!1),S(!0)},className:" specSearchBtn text-slate-500 border border-slate-500 hover:text-slate-300 hover:border-slate-300 hover:border-2 focus:outline-none ",children:"Comments"}),(0,b.jsx)("button",{onClick:function(){return i.push("/word/".concat(null===a||void 0===a?void 0:a._firestore_id))},className:" specSearchBtn text-emerald-300 border border-emerald-300 hover:text-emerald-500 hover:border-emerald-500 hover:border-2 focus:outline-none ",children:"Info"})]})})]})}),x&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)($t,{hit:a,buttonAction:function(){m(!1),c(!0)}})}),w&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)(At,{hit:a,buttonAction:function(){S(!1),c(!0)}})})]})};function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Et=function(e){var t,n,o,l,a=e.hit,i=_t((0,j.F_)(g.fV),1)[0],s=(0,k.useState)(!1),d=s[0],r=s[1],c=_t((0,M.ky)(g.h.doc("hokkienWords/".concat(null===a||void 0===a?void 0:a._firestore_id))),3),u=c[0],v=(c[1],c[2],(0,k.useState)(!1)),p=v[0],x=v[1],m=(0,k.useState)(!1),y=m[0],w=m[1],S=(0,N.useRouter)();return _t((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===a||void 0===a?void 0:a._firestore_id)).collection("editorNotes").orderBy("noteTimestamp","asc")),1)[0],(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" specificResultsDiv group ",children:[(0,b.jsx)("span",{className:" w-full px-3 ",children:(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-lg text-sky-500 group-hover:text-sky-300 transform transition duration-200 ease-in ",children:null===(t=null===u||void 0===u?void 0:u.data())||void 0===t?void 0:t.hanzi})}),(0,b.jsxs)("span",{className:" px-3 flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:function(){return r(!0)},className:" rounded-full p-3 border text-sky-600 border-sky-600 hover:border-sky-500 hover:text-sky-500 focus:outline-sky-400 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(h.bBz,{style:{color:"whitesmoke",fontSize:"1.4em"}})}),("rumlowb@gmail.com"==(null===i||void 0===i?void 0:i.email)||"marvin_sy@dlsu.edu.ph"==(null===i||void 0===i?void 0:i.email)||(null===i||void 0===i?void 0:i.displayName)==(null===a||void 0===a?void 0:a.addedBy))&&(0,b.jsx)("button",{onClick:function(){return setDeleteModal(!0)},className:" rounded-full p-3 border text-red-600 border-red-600 hover:border-red-500 hover:text-red-500 focus:outline-red-400 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(f.GH,{style:{color:"whitesmoke",fontSize:"1.4em"}})})]})]}),d&&(0,b.jsx)("div",{className:" w-full h-full fixed z-50 inset-0 grid place-items-center bg-slate-900 bg-opacity-100 overflow-hidden ",children:(0,b.jsxs)("div",{className:" specificSearchInnerModal ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full px-4 py-2 flex items-center justify-between border-b border-sky-500 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-200 ",children:"Info about hanzi:"}),(0,b.jsx)("button",{onClick:function(){return r(!1)},className:" rounded-full px-3 py-1 font-path-ex font-black text-sky-500 border-sky-500 hover:text-sky-700 hover:border-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[80%] w-full grid place-items-start space-y-2 px-4 py-2 ",children:[(0,b.jsx)("h3",{className:" text-lg text-sky-400 font-path-ex font-semibold ",children:"hanzi:"}),(0,b.jsx)("h1",{className:" place-self-center text-2xl text-sky-600 font-fira-sans font-bold ",children:null===(n=null===u||void 0===u?void 0:u.data())||void 0===n?void 0:n.hanzi}),(0,b.jsxs)("span",{className:" flex flex-col items-start space-y-2 w-full ",children:[(0,b.jsx)("h4",{className:" font-path-ex font-semibold text-sky-700 text-base ",children:null===(o=null===u||void 0===u?void 0:u.data())||void 0===o?void 0:o.type}),(0,b.jsx)("h5",{className:" font-path-ex font-bold text-sky-600 text-lg ",children:null===(l=null===u||void 0===u?void 0:u.data())||void 0===l?void 0:l.meaning})]})]}),(0,b.jsx)("footer",{className:" bottom-0 z-50 sticky flex items-center space-x-3 px-4 py-2 ",children:(0,b.jsxs)("span",{className:" w-full justify-evenly flex items-center space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){1==y&&w(!1),r(!1),x(!0)},className:" specSearchBtn text-sky-300 border border-sky-300 hover:text-sky-500 hover:border-sky-500 hover:border-2 focus:outline-none ",children:"Notes"}),(0,b.jsx)("button",{onClick:function(){1==p&&x(!1),r(!1),w(!0)},className:" specSearchBtn text-slate-500 border border-slate-500 hover:text-slate-300 hover:border-slate-300 hover:border-2 focus:outline-none ",children:"Comments"}),(0,b.jsx)("button",{onClick:function(){return S.push("/word/".concat(null===a||void 0===a?void 0:a._firestore_id))},className:" specSearchBtn text-emerald-300 border border-emerald-300 hover:text-emerald-500 hover:border-emerald-500 hover:border-2 focus:outline-none ",children:"Info"})]})})]})}),p&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)($t,{hit:a,buttonAction:function(){x(!1),r(!0)}})}),y&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)(At,{hit:a,buttonAction:function(){w(!1),r(!0)}})})]})};function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var zt=function(e){var t,n,o,l,a=e.hit,i=(0,N.useRouter)(),s=Rt((0,j.F_)(g.fV),1)[0],d=(0,k.useState)(!1),r=d[0],c=d[1],u=Rt((0,M.ky)(g.h.doc("hokkienWords/".concat(null===a||void 0===a?void 0:a._firestore_id))),3),v=u[0],p=(u[1],u[2],(0,k.useState)(!1)),x=p[0],m=p[1],y=(0,k.useState)(!1),w=y[0],S=y[1];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:" specificResultsDiv group ",children:[(0,b.jsx)("span",{className:" w-full px-3 ",children:(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-lg text-sky-500 group-hover:text-sky-300 transform transition duration-200 ease-in ",children:null===(t=null===v||void 0===v?void 0:v.data())||void 0===t?void 0:t.poj})}),(0,b.jsxs)("span",{className:" px-3 flex items-center space-x-3 ",children:[(0,b.jsx)("button",{onClick:function(){return c(!0)},className:" rounded-full p-3 border text-sky-600 border-sky-600 hover:border-sky-500 hover:text-sky-500 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(h.bBz,{style:{color:"whitesmoke",fontSize:"1.4em"}})}),("rumlowb@gmail.com"==(null===s||void 0===s?void 0:s.email)||"marvin_sy@dlsu.edu.ph"==(null===s||void 0===s?void 0:s.email)||(null===s||void 0===s?void 0:s.displayName)==(null===a||void 0===a?void 0:a.addedBy))&&(0,b.jsx)("button",{onClick:function(){return setDeleteModal(!0)},className:" rounded-full p-3 border text-red-600 border-red-600 hover:border-red-500 hover:text-red-500 focus:outline-red-400 transform transition duration-200 ease-in-out ",children:(0,b.jsx)(f.GH,{style:{color:"whitesmoke",fontSize:"1.4em"}})})]})]}),r&&(0,b.jsx)("div",{className:" w-full h-full fixed z-50 inset-0 grid place-items-center bg-slate-900 bg-opacity-100 overflow-hidden ",children:(0,b.jsxs)("div",{className:" specificSearchInnerModal ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full px-4 py-2 flex items-center justify-between border-b border-sky-500 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-200 ",children:"Info about poj:"}),(0,b.jsx)("button",{onClick:function(){return c(!1)},className:" rounded-full px-3 py-1 font-path-ex font-black text-sky-500 border-sky-500 hover:text-sky-700 hover:border-sky-700 focus:outline-none transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[90%] w-full grid place-items-start space-y-2 px-4 py-2 ",children:[(0,b.jsx)("h3",{className:" text-lg text-sky-400 font-path-ex font-semibold ",children:"poj:"}),(0,b.jsx)("h1",{className:" place-self-center text-xl text-sky-600 font-fira-sans font-bold ",children:null===(n=null===v||void 0===v?void 0:v.data())||void 0===n?void 0:n.poj}),(0,b.jsxs)("span",{className:" flex flex-col items-start space-y-2 w-full ",children:[(0,b.jsx)("h4",{className:" font-path-ex font-semibold text-sky-700 text-base ",children:null===(o=null===v||void 0===v?void 0:v.data())||void 0===o?void 0:o.type}),(0,b.jsx)("h5",{className:" font-path-ex font-bold text-sky-600 text-lg ",children:null===(l=null===v||void 0===v?void 0:v.data())||void 0===l?void 0:l.meaning})]})]}),(0,b.jsx)("footer",{className:" bottom-0 z-50 sticky flex items-center space-x-3 px-4 py-2 ",children:(0,b.jsxs)("span",{className:" w-full flex items-center justify-evenly space-x-2 ",children:[(0,b.jsx)("button",{onClick:function(){1==w&&S(!1),c(!1),m(!0)},className:" specSearchBtn text-sky-300 border border-sky-300 hover:text-sky-500 hover:border-sky-500 hover:border-2 focus:outline-none ",children:"Notes"}),(0,b.jsx)("button",{onClick:function(){1==x&&m(!1),c(!1),S(!0)},className:" specSearchBtn text-slate-500 border border-slate-500 hover:text-slate-300 hover:border-slate-300 hover:border-2 focus:outline-none ",children:"Comments"}),(0,b.jsx)("button",{onClick:function(){return i.push("/word/".concat(null===a||void 0===a?void 0:a._firestore_id))},className:" specSearchBtn text-emerald-300 border border-emerald-300 hover:text-emerald-500 hover:border-emerald-500 hover:border-2 focus:outline-none ",children:"Info"})]})})]})}),x&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)($t,{hit:a,buttonAction:function(){m(!1),c(!0)}})}),w&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-90 fixed inset-0 z-50 grid place-items-center overflow-hidden ",children:(0,b.jsx)(At,{hit:a,buttonAction:function(){S(!1),c(!0)}})})]})};function Lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Zt=function(e){var t,n=e.parentId,o=e.data,l=e.docId,a=Kt((0,j.F_)(g.fV),1)[0],i=(0,k.useState)(!1),s=i[0],d=i[1],r=(0,k.useState)(""),c=r[0],u=r[1],v=(0,k.useState)(!1),h=(v[0],v[1],Kt((0,M.ky)(g.h.doc("hokkienWords/".concat(n)).collection("editorNotes").doc(l)),3)),f=h[0];return h[1],h[2],(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{id:l,className:" notesMainModal group ",children:[(0,b.jsx)("span",{className:" noteText w-full bg-slate-800 bg-opacity-40 px-3 rounded-md text-sky-500 group-hover:text-sky-300 transform transition ease-in-out overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-900 ",children:null===o||void 0===o?void 0:o.note}),((null===a||void 0===a?void 0:a.displayName)==(null===o||void 0===o?void 0:o.noteAdder)||"rumlowb@gmail.com"==(null===a||void 0===a?void 0:a.email)||"marvin_sy@dlsu.edu.ph"==(null===a||void 0===a?void 0:a.email))&&(0,b.jsx)("span",{className:" flex items-center space-x-4 px-3 ",children:(0,b.jsx)("button",{onClick:function(){return d(!0)},className:" rounded-full p-3 border border-sky-500 hover:border-2 hover:border-sky-200 focus:outline-none transform transition duration-300 ease-in-out ",children:(0,b.jsx)(m.BNm,{style:{color:"skyblue",fontSize:"1.2em"}})})})]}),s&&(0,b.jsx)("div",{className:" h-full w-full bg-slate-900 bg-opacity-75 fixed inset-0 z-50 ",children:(0,b.jsxs)("div",{className:" noteInfoModal ",children:[(0,b.jsxs)("header",{className:" noteInfoModalHeader ",children:[(0,b.jsxs)("h1",{className:"text-lg text-sky-500 font-fira-sans font-semibold",children:["By ",null===o||void 0===o?void 0:o.noteAdder]}),(0,b.jsx)("button",{onClick:function(){return d(!1)},className:"text-lg text-sky-500 border border-sky-500 font-fira-sans font-semibold grid place-items-center px-3 py-1 rounded-full hover:text-sky-300 hover:border-sky-300 focus:outline-none transform transition duration-300 ease-in-out",children:"X"})]}),(0,b.jsxs)("div",{className:" noteInfoMainDiv ",children:[(0,b.jsxs)("div",{className:" h-[40%] w-full flex flex-col space-y-2 px-3 ",children:[(0,b.jsx)("h1",{className:" place-self-start font-fira-sans font-semibold text-lg text-sky-500 ",children:"Note:"}),(0,b.jsx)("div",{className:" h-[90%] w-full px-4 py-3 overflow-y-scroll scrollbar-hide border border-sky-600 rounded font-path-ex font-normal text-sky-300 text-base ",children:null===(t=null===f||void 0===f?void 0:f.data())||void 0===t?void 0:t.note})]}),(0,b.jsxs)("div",{className:" h-[45%] w-full flex flex-col space-y-2 px-3 ",children:[(0,b.jsx)("h1",{className:" place-self-start font-fira-sans font-semibold text-lg text-sky-500 ",children:"Updated note"}),(0,b.jsx)("textarea",{value:c,onChange:function(e){return u(e.target.value)},placeholder:"Note to add below, ".concat(null===a||void 0===a?void 0:a.displayName),className:" h-[90%] w-full px-4 py-3 overflow-y-scroll scrollbar-hide border bg-transparent border-sky-600 rounded font-path-ex font-normal text-sky-300 text-base placeholder-sky-600 focus:outline-none "}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),c?c&&g.h.doc("/hokkienWords/".concat(n)).collection("editorNotes").doc(l).set({note:c,noteTimestamp:X.Z.firestore.FieldValue.serverTimestamp()},{merge:!0}):alert("You forgot your note, ".concat(null===a||void 0===a?void 0:a.displayName)),c&&u("")},className:" place-self-end w-[80px] px-3 py-2 border border-sky-600 text-sky-600 text-base font-fira-sans font-semibold rounded-md hover:border-sky-400 hover:text-sky-400 focus:outline-none transform transition duration-300 ease-in-out ",children:"Update"}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("/hokkienWords/".concat(n)).collection("editorNotes").doc(l).delete(),d(!1)},className:" w-[50%] h-[60px] rounded text-base border border-red-700 text-red-700 font-fira-sans font-normal hover:border-red-900 hover:text-red-900 transform transition duration-300 ease-in-out place-self-center ",children:"Delete note"})]})]}),(0,b.jsx)("span",{className:" noteInfoBottom ",children:(0,b.jsx)("button",{onClick:function(){return d(!1)},className:" noteInfoBtmBtn ",children:"Close"})})]})})]})};function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var $t=function(e){var t=e.hit,n=e.buttonAction,o=Ht((0,j.F_)(g.fV),1)[0],l=(0,k.useState)(""),a=l[0],i=l[1],s=Ht((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===t||void 0===t?void 0:t._firestore_id)).collection("editorNotes")),1)[0];return(0,b.jsxs)("div",{className:" specSearchModal ",children:[(0,b.jsxs)("header",{className:" h-[10%] w-full border-b border-sky-500 flex items-center justify-between px-3 py-2 ",children:[(0,b.jsxs)("h4",{className:" specSearchModalHeader ",children:["Notes from ",null===t||void 0===t?void 0:t.addedBy]}),(0,b.jsx)("button",{onClick:n,className:" rounded-full py-1 px-3 font-path-ex font-bold text-sky-500 border border-sky-500 hover:text-sky-300 hover:border-2 hover:border-sky-300 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full bg-gradient-to-br from-sky-900 to-slate-900 overflow-hidden ",children:[((null===t||void 0===t?void 0:t.addedBy)==(null===o||void 0===o?void 0:o.displayName)||"rumlowb@gmail.com"==(null===o||void 0===o?void 0:o.email)||"marvin_sy@dlsu.edu.ph"==(null===o||void 0===o?void 0:o.email))&&o&&(0,b.jsxs)("div",{className:" specSearchForm ",children:[(0,b.jsx)("textarea",{value:a,onChange:function(e){return i(e.target.value)},placeholder:"Add notes, ".concat(null===o||void 0===o?void 0:o.displayName),className:" specSearchModalTextArea overflow-y-scroll scrollbar-hide "}),(0,b.jsxs)("span",{className:" flex w-full h-[35%] justify-between px-3 py-2 ",children:[(0,b.jsx)("h1",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),!a&&alert("You seem to have forgotten your note. Try again"),g.h.doc("/hokkienWords/".concat(null===t||void 0===t?void 0:t._firestore_id)).collection("editorNotes").add({note:a,noteAdder:null===o||void 0===o?void 0:o.displayName,noteTimestamp:X.Z.firestore.FieldValue.serverTimestamp()}),i("")},className:"specSearchModalAddNoteBtn ",children:"add note"})]})]}),(0,b.jsx)("div",{className:" specSearchData overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 ",children:s&&(null===s||void 0===s?void 0:s.docs.map((function(e){return(0,b.jsx)(Zt,{parentId:null===t||void 0===t?void 0:t._firestore_id,docId:null===e||void 0===e?void 0:e.id,data:null===e||void 0===e?void 0:e.data()})})))})]}),(0,b.jsx)("footer",{className:" h-[10%] w-full flex items-center justify-evenly px-4 py-3 border-t-2 border-sky-500 "})]})};function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Gt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(0,mt.instantMeiliSearch)("https://ms-f7385f37fa20-3740.sfo.meilisearch.io","90cfa7394bf3c968b8d66f6868817717c6f6f33a"),(0,ue.Z)((function(e){var t=e.currentRefinement,n=e.refine;return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-600 border-4 border-slate-500 bg-opacity-80 px-4 py-3 mx-auto mt-2 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search for duplicate/s...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-100 font-path-ex font-normal text-lg "})})}));var Jt=function(){Gt((0,j.F_)(g.fV),1)[0];var e=(0,k.useState)(""),t=e[0],n=e[1],o=(g.h.collection("hokkienWords"),Gt((0,M.Kx)(g.h.collection("hokkienWords").where("hokkien","==",t).limit(15)),1)[0]);return(0,b.jsxs)("div",{className:" h-full w-[98%] mx-auto flex flex-col space-y-3 overflow-hidden bg-slate-800 bg-opacity-30 ",children:[(0,b.jsx)("div",{className:" h-[75px] w-[98%] mx-auto my-4 rounded bg-gradient-to-br from-slate-800 to-sky-900 px-4 py-3 ",children:(0,b.jsx)("input",{type:"text",onChange:function(e){return n(e.target.value)},placeholder:"Search for a possible duplicate here...(Add a space at the end if no result comes out)",value:t,className:" h-full w-full bg-transparent border-0 outline-none text-sky-50 placeholder-sky-700 font-fira-sans font-semibold text-xl "})}),(0,b.jsx)("div",{className:" h-full w-full overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 px-3 py-2 ",children:t&&o&&(null===o||void 0===o?void 0:o.docs.map((function(e){return(0,b.jsx)(qt,{docData:null===e||void 0===e?void 0:e.data(),docId:null===e||void 0===e?void 0:e.id})})))})]})};function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var qt=function(e){e.hit;var t,n=e.docId,o=(e.docData,Qt((0,j.F_)(g.fV),1)[0],Qt((0,M.ky)(g.h.doc("hokkienWords/".concat(n))),3)),l=o[0],a=(o[1],o[2],(0,k.useState)(!1)),i=a[0],s=a[1],d=(0,k.useState)(!1),r=d[0],c=d[1],u=(0,k.useState)(!1),v=u[0],h=u[1],x=function(){(r||v)&&(c(!1)||h(!1)),s(!0)},m=function(){(i||v)&&(s(!1)||h(!1)),c(!0)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{id:null===l||void 0===l?void 0:l.id,className:" h-[60px] w-full mx-auto my-7 flex justify-between px-4 py-3 rounded items-center bg-sky-900 bg-opacity-95 hover:bg-opacity-80 hover:bg-slate-900 transform transition duration-300 ease-out cursor-pointer group ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-base text-sky-500 group-hover:text-sky-50 ",children:null===(t=null===l||void 0===l?void 0:l.data())||void 0===t?void 0:t.hokkien}),(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("button",{onClick:function(){return s(!0)},className:" p-3 border-sky-500 text-sky-500 rounded-full border hover:text-sky-700 hover:border-sky-700 transform transition duration-300 active:outline-none focus:outline-none ",children:(0,b.jsx)(p.dEB,{style:{color:"skyblue",fontSize:"1.3em"}})}),(0,b.jsxs)("button",{onClick:m,className:"dupeResEditMeaningBtn",children:[(0,b.jsx)(p.dEB,{style:{color:"lightgreen",fontSize:"1.3em"}}),"Meaning/s"]}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(n).delete()},className:" p-3 border-red-500 text-red-500 rounded-full border hover:text-red-700 hover:border-red-700 transform transition duration-300 active:outline-none focus:outline-none ",children:(0,b.jsx)(f.GH,{style:{color:"red",fontSize:"1.3em"}})})]})]}),i&&(0,b.jsx)("div",{className:" h-full w-full fixed inset-0 z-50 bg-slate-800 bg-opacity-80 ",children:(0,b.jsx)(Dn,{snapshot:l,closeButtonAction:function(){return s(!1)},editMeaningAction:m})}),r&&(0,b.jsx)("div",{className:" h-full w-full fixed inset-0 z-50 bg-slate-800 bg-opacity-80 ",children:(0,b.jsx)(_n,{snapshot:l,closeBtnAction:function(){return c(!1)},backToDetails:x,headToHokkien:function(){(i||r)&&(s(!1)||c(!1)),h(!0)}})}),v&&(0,b.jsx)("div",{className:" h-full w-full fixed inset-0 z-50 bg-slate-800 bg-opacity-80 ",children:(0,b.jsx)(Rn,{snapshot:l,closeButtonAction:function(){return h(!1)},editDetailsAction:x,editMeaningAction:m})})]})};n(729);var en=n(7401);function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function nn(e,t,n,o,l,a,i){try{var s=e[a](i),d=s.value}catch(r){return void n(r)}s.done?t(d):Promise.resolve(d).then(o,l)}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){on(e,t,n[t])}))}return e}function an(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sn(e){return null===e||void 0===e?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}var dn=function(){an((0,j.F_)(g.fV),1)[0];var e=(0,k.useState)(!1),t=(e[0],e[1],(0,k.useState)("")),n=t[0],o=t[1],l=(0,k.useState)(1),a=l[0],i=l[1],s=(0,k.useState)(10)[0],d=(0,k.useState)([]),r=d[0],c=d[1],u=(0,k.useState)(0),v=u[0],h=u[1],f=(0,k.useState)(!1),p=f[0],x=f[1];return console.log("Words >>>>",r),(0,k.useEffect)((function(){var e=function(){var e,t=(e=$().mark((function e(){var t,o,l,i,d,r,u,v;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),t=sn(n),o=g.h.collection("hokkienWords").orderBy("hokkien","asc"),n&&(o=o.where("hokkien","<=",n+"\uf8ff").where("hokkien",">=",n)),e.next=6,o.get();case 6:l=e.sent,i=l.docs,d=i.map((function(e){return ln({id:null===e||void 0===e?void 0:e.id},null===e||void 0===e?void 0:e.data())})),r=n?null===d||void 0===d?void 0:d.filter((function(e){var n=sn(null===e||void 0===e?void 0:e.hokkien);return null===n||void 0===n?void 0:n.includes(t)})):d,h(Math.ceil((null===r||void 0===r?void 0:r.length)/s)),v=(u=(a-1)*s)+s,c(r.slice(u,v)),x(!1);case 15:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(o,l){var a=e.apply(t,n);function i(e){nn(a,o,l,i,s,"next",e)}function s(e){nn(a,o,l,i,s,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();e()}),[n,a,s]),(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:" h-full w-full bg-sky-500 bg-opacity-70 rounded-md ",children:[(0,b.jsx)("input",{className:" w-full mx-auto h-[50px] font-robot-slab text-lg text-sky-400 bg-slate-800 px-3 py-2 ",type:"text",value:n,onChange:function(e){o(e.target.value),i(1)},placeholder:"Case sensitive, experimental"}),p?(0,b.jsx)("div",{className:" font-robot-slab font-semibold text-lg text-sky-400 ",children:"Loading..."}):(0,b.jsx)("div",{className:" py-6 h-[75%] w-[90%] mx-auto bg-slate-800 overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-400 space-y-5 ",children:null===r||void 0===r?void 0:r.map((function(e,t){return(0,b.jsx)(en.Z,{docId:null===e||void 0===e?void 0:e.id})}))}),(0,b.jsx)("div",{className:" w-full overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 space-x-5 flex items-center bg-slate-800 py-3 px-4 rounded ",children:Array.from({length:v},(function(e,t){return t+1})).map((function(e){return(0,b.jsx)("button",{onClick:function(){i(e)},disabled:e===a||p,className:" text-lg text-sky-400 font-robot-slab font-semibold border border-sky-400 rounded-full px-3 py-2",children:e},e)}))})]})})};function rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function cn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var un=function(e){var t,n,o,l,a=e.snapshot;return cn((0,j.F_)(g.fV),1)[0],(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:" updateDisplay cursor-pointer transform transition duration-300 ease-in-out group ",children:[(0,b.jsxs)("header",{className:" flex flex-col h-[50px] w-full border-b border-sky-600 group-hover:border-sky-500 transform transition duration-200 ease-in-out px-3 ",children:[(0,b.jsxs)("h5",{className:" text-base text-sky-300 font-fira-sans font-semibold ",children:["Update by : ",null===(t=null===a||void 0===a?void 0:a.data())||void 0===t?void 0:t.updatedBy]}),(0,b.jsxs)("p",{className:" text-sm text-sky-500 font-fira-sans font-normal ",children:["Updated on : ",S()(null===(n=null===a||void 0===a?void 0:a.data())||void 0===n?void 0:n.updatedOn).format("MMM Do YY")]})]}),(0,b.jsx)("div",{className:" h-[80%] w-full flex flex-col items-start px-2 ",children:(0,b.jsxs)("span",{className:" w-full flex items-center text-sm font-fira-sans font-normal text-sky-400 space-x-3 ",children:["Updated",(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-base text-sky-400 underline mx-3 ",children:null===(o=null===a||void 0===a?void 0:a.data())||void 0===o?void 0:o.updated}),"to",(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-base text-sky-300 mx-3 ",children:null===(l=null===a||void 0===a?void 0:a.data())||void 0===l?void 0:l.updateText})]})})]},a)})};function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function hn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return vn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fn=function(e){var t,n,o=e.commentId,l=e.parentId,a=e.commentData,i=(hn((0,j.F_)(g.fV),1)[0],hn((0,M.ky)(g.h.doc("/hokkienWords/".concat(l)).collection("commentsData").doc(o)),3)),s=i[0],d=(i[1],i[2],(0,k.useState)(!1));return d[0],d[1],(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:" h-[70px] w-full bg-sky-900 border border-sky-500 hover:bg-sky-800 hover:border-sky-700 transform transition duration-300 ease-in-out flex flex-col cursor-pointer rounded-md group px-2 py-1 space-y-3 ",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-3 ",children:[(0,b.jsx)("h1",{className:" commenterDisplay group-hover:text-sky-50 group-hover:font-normal transform transition duration-300 ease-in-out ",children:null===(t=null===s||void 0===s?void 0:s.data())||void 0===t?void 0:t.commenter}),(0,b.jsx)("h3",{className:" commentTimestamp group-hover:text-slate-100 group-hover:font-light transform transition duration-300 ease-in-out ",children:S()(null===a||void 0===a?void 0:a.timestamp).format("DD/MMM/YYYY")})]}),(0,b.jsx)("h2",{className:" commentDimensions group-hover:text-sky-300 group-hover:font-semibold transform transition duration-300 ease-in-out ",children:null===(n=null===s||void 0===s?void 0:s.data())||void 0===n?void 0:n.comment})]},o)})};function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function xn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return pn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var mn=function(e){var t=e.meaning,n=e.type,o=e.wordId,l=(e.inputValue,e.setInputValue,e.textAreaValue,e.setTextAreaValue,e.addBtnFunc,e.delBtnFunc,xn((0,j.F_)(g.fV),1)[0],xn((0,M.ky)(g.h.doc("hokkienWords/".concat(o))),3));return l[0],l[1],l[2],(0,b.jsx)(b.Fragment,{children:n&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"amTitle",children:"Meaning & type"}),(0,b.jsxs)("span",{className:"flex items-center w-full space-x-2",children:[(0,b.jsx)("h1",{className:"amTitle",children:n}),(0,b.jsx)("h1",{className:"amTitleWord",children:t})]})]})})};function yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function bn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return yn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var kn=function(e){var t,n,o=e.snapshot,l=e.snapshotForCurrent,a=e.priorData,i=e.priorMeanType,s=e.inputValue,d=e.setInputValue,r=e.textAreaValue,c=e.setTextAreaValue,u=e.addBtnFunc,v=e.delBtnFunc,h=e.meanType,f=e.firstType,p=(e.synonymNumber,bn((0,j.F_)(g.fV),1)[0]);return(0,b.jsxs)(b.Fragment,{children:[(a||i||l==(null===(t=null===o||void 0===o?void 0:o.data())||void 0===t?void 0:t.type))&&(0,b.jsx)("input",{value:s,onChange:function(e){return d(e.target.value)},placeholder:"Type...",type:"text",className:"amInput"}),(s||l==(null===(n=null===o||void 0===o?void 0:o.data())||void 0===n?void 0:n.type))&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{value:r,onChange:function(e){return c(e.target.value)},placeholder:"Meaning...",type:"text",className:"amInput"}),(0,b.jsxs)("span",{className:" w-full flex items-center px-3 py-2 ",children:[(0,b.jsx)("button",{onClick:u,className:"addMeaningBtn",children:"Set meaning & type"}),(h&&h!==f||"rumlowb@gmail.com"==(null===p||void 0===p?void 0:p.email)||"sygrandkaiser@gmail.com"==(null===p||void 0===p?void 0:p.email))&&(0,b.jsx)("button",{onClick:v,className:"deleteMeaningBtn",children:"Delete"})]})]})]})};var gn=function(e){var t=e.type,n=e.meaning;return(0,b.jsx)(b.Fragment,{children:t&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{className:" idMeaningDiv ",children:(0,b.jsxs)("span",{className:"idMeaningSpan",children:[(0,b.jsx)("h1",{className:"idMeaningsType",children:t}),(0,b.jsx)("h2",{className:"idMeaning",children:n})]})})})})};var jn=function(e){var t=e.type,n=e.meaning;return(0,b.jsxs)("div",{className:" w-[95%] h-[120px] mx-auto rounded-md bg-inherit border border-sky-300 flex flex-col space-y-2 px-3 py-2 ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-sky-400 text-xl ",children:t}),(0,b.jsx)("div",{className:" font-fira-sans font-semibold text-sky-600 text-lg overflow-y-scroll scrollbar-hide h-full w-full ",children:n})]})};(0,mt.instantMeiliSearch)("https://ms-f7385f37fa20-3740.sfo.meilisearch.io","90cfa7394bf3c968b8d66f6868817717c6f6f33a"),(0,ue.Z)((function(e){var t=e.currentRefinement,n=e.refine;return(0,b.jsx)("form",{noValidate:!0,action:"",role:"search",className:" w-[80%] h-[60px] rounded-lg bg-sky-600 border-4 border-slate-500 bg-opacity-80 px-4 py-3 mx-auto mt-2 ",children:(0,b.jsx)("input",{type:"search",placeholder:"Search meaning...",value:t,onChange:function(e){return n(e.currentTarget.value)},className:" border-0 w-full outline-none bg-transparent placeholder-sky-100 text-sky-100 font-path-ex font-normal text-lg "})})}));function Nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function wn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Sn=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,j,N,w,S,T,C,F,W,B,A,I,D,U=e.docId,O=wn((0,M.ky)(g.h.doc("hokkienWords/".concat(U))),3),_=O[0],E=(O[1],O[2],(0,k.useState)("")),V=E[0],R=E[1],z=(0,k.useState)(""),L=z[0],K=z[1],Z=(0,k.useState)(""),P=Z[0],H=Z[1],$=(0,k.useState)(""),X=$[0],G=$[1],J=(0,k.useState)(""),Y=J[0],Q=J[1],q=(0,k.useState)(""),ee=q[0],te=q[1],ne=(0,k.useState)(""),oe=ne[0],le=ne[1],ae=(0,k.useState)(""),ie=ae[0],se=ae[1],de=(0,k.useState)(""),re=de[0],ce=de[1],ue=(0,k.useState)(""),ve=ue[0],he=ue[1],fe=(0,k.useState)(""),pe=fe[0],xe=fe[1],me=(0,k.useState)(""),ye=me[0],be=me[1],ke=(0,k.useState)(""),ge=ke[0],je=ke[1],Ne=(0,k.useState)(""),we=Ne[0],Se=Ne[1],Te=(0,k.useState)(""),Me=Te[0],Ce=Te[1],Fe=(0,k.useState)(""),We=Fe[0],Be=Fe[1],Ae=(0,k.useState)(""),Ie=Ae[0],De=Ae[1],Ue=(0,k.useState)(""),Oe=Ue[0],_e=Ue[1],Ee=(0,k.useState)(""),Ve=Ee[0],Re=Ee[1],ze=(0,k.useState)(""),Le=ze[0],Ke=ze[1],Ze=(0,k.useState)(""),Pe=Ze[0],He=Ze[1],$e=(0,k.useState)(""),Xe=$e[0],Ge=$e[1],Je=(0,k.useState)(""),Ye=Je[0],Qe=Je[1],qe=(0,k.useState)(""),et=qe[0],tt=qe[1],nt=(0,k.useState)(""),ot=nt[0],at=nt[1],it=(0,k.useState)(""),st=it[0],dt=it[1],rt=(0,k.useState)(""),ct=rt[0],ut=rt[1],vt=(0,k.useState)(""),ht=vt[0],ft=vt[1],pt=(0,k.useState)(""),xt=pt[0],mt=pt[1],yt=(0,k.useState)(""),bt=yt[0],kt=yt[1];return(0,b.jsxs)("div",{className:" h-full w-full px-3 py-2 pb-24 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-500 space-y-4 ",children:[(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"1",type:null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.type,meaning:null===(n=null===_||void 0===_?void 0:_.data())||void 0===n?void 0:n.meaning,typeInput:V,meaningInput:L,setTypeInput:R,setMeaningInput:K,addBtn:function(e){e.preventDefault(),V&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({meaning:L,type:V},{merge:!0}),R(""),K(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(V," & ").concat(L)}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"2",type:null===(o=null===_||void 0===_?void 0:_.data())||void 0===o?void 0:o.secondType,meaning:null===(l=null===_||void 0===_?void 0:_.data())||void 0===l?void 0:l.secondMeaning,typeInput:P,meaningInput:X,setTypeInput:H,setMeaningInput:G,addBtn:function(e){e.preventDefault(),P&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({secondMeaning:X,secondType:P},{merge:!0}),H(""),G(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(P," & ").concat(X)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.secondType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({secondMeaning:"",secondType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"second meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"3",type:null===(a=null===_||void 0===_?void 0:_.data())||void 0===a?void 0:a.thirdType,meaning:null===(i=null===_||void 0===_?void 0:_.data())||void 0===i?void 0:i.thirdMeaning,typeInput:Y,meaningInput:ee,setTypeInput:Q,setMeaningInput:te,addBtn:function(e){e.preventDefault(),Y&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({thirdMeaning:ee,thirdType:Y},{merge:!0}),te(""),Q(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Y," & ").concat(ee)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.thirdType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({thirdMeaning:"",thirdType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"third meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"4",type:null===(s=null===_||void 0===_?void 0:_.data())||void 0===s?void 0:s.fourthType,meaning:null===(d=null===_||void 0===_?void 0:_.data())||void 0===d?void 0:d.fourthMeaning,typeInput:oe,meaningInput:ie,setTypeInput:le,setMeaningInput:se,addBtn:function(e){e.preventDefault(),oe&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({fourthMeaning:ie,fourthType:oe},{merge:!0}),se(""),le(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(oe," & ").concat(ie)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.fourthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({fourthMeaning:"",fourthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fourth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"5",type:null===(r=null===_||void 0===_?void 0:_.data())||void 0===r?void 0:r.fifthType,meaning:null===(c=null===_||void 0===_?void 0:_.data())||void 0===c?void 0:c.fifthMeaning,typeInput:re,meaningInput:ve,setTypeInput:ce,setMeaningInput:he,addBtn:function(e){e.preventDefault(),re&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({fifthMeaning:ve,fifthType:re},{merge:!0}),he(""),ce(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(re," & ").concat(ve)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.fifthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({fifthMeaning:"",fifthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fifth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"6",type:null===(u=null===_||void 0===_?void 0:_.data())||void 0===u?void 0:u.sixthType,meaning:null===(v=null===_||void 0===_?void 0:_.data())||void 0===v?void 0:v.sixthMeaning,typeInput:pe,meaningInput:ye,setTypeInput:xe,setMeaningInput:be,addBtn:function(e){e.preventDefault(),pe&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({sixthMeaning:ye,sixthType:pe},{merge:!0}),be(""),xe(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"sixth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(pe," & ").concat(ye)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.sixthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({sixthMeaning:"",sixthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"sixth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"7",type:null===(h=null===_||void 0===_?void 0:_.data())||void 0===h?void 0:h.seventhType,meaning:null===(f=null===_||void 0===_?void 0:_.data())||void 0===f?void 0:f.seventhMeaning,typeInput:ge,meaningInput:we,setTypeInput:je,setMeaningInput:Se,addBtn:function(e){e.preventDefault(),ge&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({seventhMeaning:we,seventhType:ge},{merge:!0}),Se(""),je(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(ge," & ").concat(we)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.seventhType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({seventhMeaning:"",seventhType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"seventh meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"8",type:null===(p=null===_||void 0===_?void 0:_.data())||void 0===p?void 0:p.eighthType,meaning:null===(x=null===_||void 0===_?void 0:_.data())||void 0===x?void 0:x.eighthMeaning,typeInput:Me,meaningInput:We,setTypeInput:Ce,setMeaningInput:Be,addBtn:function(e){e.preventDefault(),Me&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({eighthMeaning:We,eighthType:Me},{merge:!0}),Be(""),Ce(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Me," & ").concat(We)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.eighthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({eighthMeaning:"",eighthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"eighth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"9",type:null===(m=null===_||void 0===_?void 0:_.data())||void 0===m?void 0:m.ninthType,meaning:null===(y=null===_||void 0===_?void 0:_.data())||void 0===y?void 0:y.ninthMeaning,typeInput:Ie,meaningInput:Oe,setTypeInput:De,setMeaningInput:_e,addBtn:function(e){e.preventDefault(),Ie&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({ninthMeaning:Oe,ninthType:Ie},{merge:!0}),_e(""),De(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"ninth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Ie," & ").concat(Oe)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.ninthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({nintheaning:"",ninthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"ninth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"10",type:null===(j=null===_||void 0===_?void 0:_.data())||void 0===j?void 0:j.tenthType,meaning:null===(N=null===_||void 0===_?void 0:_.data())||void 0===N?void 0:N.tenthMeaning,typeInput:Ve,meaningInput:Le,setTypeInput:Re,setMeaningInput:Ke,addBtn:function(e){e.preventDefault(),Ve&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({tenthMeaning:Le,tenthType:Ve},{merge:!0}),Ke(""),Re(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"tenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Ve," & ").concat(Le)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.tenthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({tenthMeaning:"",tenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"tenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"11",type:null===(w=null===_||void 0===_?void 0:_.data())||void 0===w?void 0:w.eleventhType,meaning:null===(S=null===_||void 0===_?void 0:_.data())||void 0===S?void 0:S.eleventhMeaning,typeInput:Xe,meaningInput:Pe,setTypeInput:Ge,setMeaningInput:He,addBtn:function(e){e.preventDefault(),Xe&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({eleventhMeaning:Pe,eleventhType:Xe},{merge:!0}),He(""),Ge(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"eleventh meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Xe," & ").concat(Pe)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.eleventhType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({eleventhMeaning:"",eleventhType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"eleventh meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"12",type:null===(T=null===_||void 0===_?void 0:_.data())||void 0===T?void 0:T.twelfthType,meaning:null===(C=null===_||void 0===_?void 0:_.data())||void 0===C?void 0:C.twelfthMeaning,typeInput:Ye,meaningInput:et,setTypeInput:Qe,setMeaningInput:tt,addBtn:function(e){e.preventDefault(),Ye&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({twelfthMeaning:et,twelfthType:Ye},{merge:!0}),tt(""),Qe(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"twelfth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(Ye," & ").concat(et)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.twelfthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({twelfthMeaning:"",twelfthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"twelfth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"13",type:null===(F=null===_||void 0===_?void 0:_.data())||void 0===F?void 0:F.thirteenthType,meaning:null===(W=null===_||void 0===_?void 0:_.data())||void 0===W?void 0:W.thirteenthMeaning,typeInput:ot,meaningInput:st,setTypeInput:at,setMeaningInput:dt,addBtn:function(e){e.preventDefault(),ot&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({thirteenthMeaning:st,thirteenthType:ot},{merge:!0}),dt(""),at(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"thirteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(ot," & ").concat(st)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.thirteenthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({secondMeaning:"",secondType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"thirteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"14",type:null===(B=null===_||void 0===_?void 0:_.data())||void 0===B?void 0:B.fourteenthType,meaning:null===(A=null===_||void 0===_?void 0:_.data())||void 0===A?void 0:A.fourteenthMeaning,typeInput:ct,meaningInput:ht,setTypeInput:ut,setMeaningInput:ft,addBtn:function(e){e.preventDefault(),ct&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({fourteenthMeaning:ht,fourteenthType:ct},{merge:!0}),ft(""),ut(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fourteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(ct," & ").concat(ht)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.fourteenthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({fourteenthMeaning:"",fourteenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fourteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}}),(0,b.jsx)(lt,{id:null===_||void 0===_?void 0:_.id,meanNumber:"15",type:null===(I=null===_||void 0===_?void 0:_.data())||void 0===I?void 0:I.fifteenthType,meaning:null===(D=null===_||void 0===_?void 0:_.data())||void 0===D?void 0:D.fifteenthMeaning,typeInput:xt,meaningInput:bt,setTypeInput:mt,setMeaningInput:kt,addBtn:function(e){e.preventDefault(),xt&&(g.h.doc("/hokkienWords/".concat(null===_||void 0===_?void 0:_.id)).set({fifteenthMeaning:bt,fifteenthType:xt},{merge:!0}),kt(""),mt(""),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fifteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"".concat(xt," & ").concat(bt)}))},delBtn:function(e){var t;e.preventDefault(),(null===(t=null===_||void 0===_?void 0:_.data())||void 0===t?void 0:t.fifteenthType)&&(g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).set({fifteenthMeaning:"",fifteenthType:""},{merge:!0}),g.h.collection("hokkienWords").doc(null===_||void 0===_?void 0:_.id).collection("editorUpdates").add({updated:"fifteenth meaning & type",updatedBy:null===user||void 0===user?void 0:user.displayName,updatedOn:firebase.firestore.FieldValue.serverTimestamp(),updateText:"none (deleted)"}))}})]})};function Tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Mn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Cn=function(e){var t=e.id,n=e.hokkienValue,o=e.taiLoValue,l=e.hanziValue,a=e.lannangValue,i=e.pojValue,s=Mn((0,j.F_)(g.fV),1)[0],d=(0,k.useState)(""),r=d[0],c=d[1],u=(0,k.useState)(""),v=u[0],h=u[1],f=(0,k.useState)(""),p=f[0],x=f[1],m=(0,k.useState)(""),y=m[0],N=m[1],w=(0,k.useState)(""),S=w[0],T=w[1];return(0,b.jsxs)("div",{className:" h-full w-full space-y-5 flex flex-col px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsxs)("span",{className:"authSearchEditorSpan",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authSearchEditorTitle",children:"Hokkien:"}),(0,b.jsx)("h1",{className:"authSearchEditorData",children:n})]}),(0,b.jsx)("input",{type:"text",placeholder:"Hokkien",value:r,onChange:function(e){return c(e.target.value)},className:" h-[50px] w-full outline-none bg-transparent border border-sky-400 rounded text-lg text-sky-400 font-fira-sans font-semibold focus:shadow-md focus:shadow-sky-600 placeholder-sky-700 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center ",children:[(0,b.jsx)("span",{className:" w-full "}),(0,b.jsx)("button",{disabled:!r,onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(t).set({hokkien:r},{merge:!0}),c(""),g.h.doc("hokkienWords/".concat(t)).collection("editorUpdates").add({updated:"hokkien",updatedBy:null===s||void 0===s?void 0:s.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp(),updateText:r})},className:" w-full border border-sky-500 text-xl text-sky-500 font-fira-sans font-semibold px-3 py-2 rounded-md outline-none hover:border-sky-400 hover:text-sky-400 transform transition duration-300 ease-in-out ",children:"Set"})]})]}),(0,b.jsxs)("span",{className:"authSearchEditorSpan",children:[o&&(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authSearchEditorTitle",children:"Numbered Tai-lo:"}),(0,b.jsx)("h1",{className:"authSearchEditorData",children:o})]}),(0,b.jsx)("input",{type:"text",placeholder:"Numbered tai-lo",value:v,onChange:function(e){return h(e.target.value)},className:" h-[50px] w-full outline-none bg-transparent border border-sky-400 rounded text-lg text-sky-400 font-fira-sans font-semibold focus:shadow-md focus:shadow-sky-600 placeholder-sky-700 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center ",children:[(0,b.jsx)("span",{className:" w-full "}),(0,b.jsx)("button",{disabled:!v,onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(t).set({taiLo:v},{merge:!0}),h(""),g.h.doc("hokkienWords/".concat(t)).collection("editorUpdates").add({updated:"numbered Tai-lo",updatedBy:null===s||void 0===s?void 0:s.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp(),updateText:v})},className:" w-full border border-sky-500 text-xl text-sky-500 font-fira-sans font-semibold px-3 py-2 rounded-md outline-none hover:border-sky-400 hover:text-sky-400 transform transition duration-300 ease-in-out ",children:"Set"})]})]}),(0,b.jsxs)("span",{className:"authSearchEditorSpan",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authSearchEditorTitle",children:"Hanzi:"}),(0,b.jsx)("h1",{className:"authSearchEditorData",children:l})]}),(0,b.jsx)("input",{type:"text",placeholder:"Hanzi",value:p,onChange:function(e){return x(e.target.value)},className:" h-[50px] w-full outline-none bg-transparent border border-sky-400 rounded text-lg text-sky-400 font-fira-sans font-semibold focus:shadow-md focus:shadow-sky-600 placeholder-sky-700 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center ",children:[(0,b.jsx)("span",{className:" w-full "}),(0,b.jsx)("button",{disabled:!p,onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(t).set({hanzi:r},{merge:!0}),x(""),g.h.doc("hokkienWords/".concat(t)).collection("editorUpdates").add({updated:"hanzi",updatedBy:null===s||void 0===s?void 0:s.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp(),updateText:p})},className:" w-full border border-sky-500 text-xl text-sky-500 font-fira-sans font-semibold px-3 py-2 rounded-md outline-none hover:border-sky-400 hover:text-sky-400 transform transition duration-300 ease-in-out ",children:"Set"})]})]}),(0,b.jsxs)("span",{className:"authSearchEditorSpan",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authSearchEditorTitle",children:"Lannang:"}),(0,b.jsx)("h1",{className:"authSearchEditorData",children:a})]}),(0,b.jsx)("input",{type:"text",placeholder:"Lannang",value:y,onChange:function(e){return N(e.target.value)},className:" h-[50px] w-full outline-none bg-transparent border border-sky-400 rounded text-lg text-sky-400 font-fira-sans font-semibold focus:shadow-md focus:shadow-sky-600 placeholder-sky-700 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center ",children:[(0,b.jsx)("span",{className:" w-full "}),(0,b.jsx)("button",{disabled:!y,onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(t).set({lannang:y},{merge:!0}),N(""),g.h.doc("hokkienWords/".concat(t)).collection("editorUpdates").add({updated:"lannang",updatedBy:null===s||void 0===s?void 0:s.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp(),updateText:y})},className:" w-full border border-sky-500 text-xl text-sky-500 font-fira-sans font-semibold px-3 py-2 rounded-md outline-none hover:border-sky-400 hover:text-sky-400 transform transition duration-300 ease-in-out ",children:"Set"})]})]}),(0,b.jsxs)("span",{className:"authSearchEditorSpan",children:[(0,b.jsxs)("span",{className:" flex items-center space-x-4 ",children:[(0,b.jsx)("h3",{className:"authSearchEditorTitle",children:"POJ:"}),(0,b.jsx)("h1",{className:"authSearchEditorData",children:i})]}),(0,b.jsx)("input",{type:"text",placeholder:"POJ",value:S,onChange:function(e){return T(e.target.value)},className:" h-[50px] w-full outline-none bg-transparent border border-sky-400 rounded text-lg text-sky-400 font-fira-sans font-semibold focus:shadow-md focus:shadow-sky-600 placeholder-sky-700 px-3 py-2 "}),(0,b.jsxs)("span",{className:" w-full flex items-center ",children:[(0,b.jsx)("span",{className:" w-full "}),(0,b.jsx)("button",{disabled:!S,onClick:function(e){e.preventDefault(),g.h.collection("hokkienWords").doc(t).set({poj:S},{merge:!0}),T(""),g.h.doc("hokkienWords/".concat(t)).collection("editorUpdates").add({updated:"poj",updatedBy:null===s||void 0===s?void 0:s.displayName,timestamp:X.Z.firestore.FieldValue.serverTimestamp(),updateText:S})},className:" w-full border border-sky-500 text-xl text-sky-500 font-fira-sans font-semibold px-3 py-2 rounded-md outline-none hover:border-sky-400 hover:text-sky-400 transform transition duration-300 ease-in-out ",children:"Set"})]})]})]})};function Fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Wn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Fn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Bn=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,k,j,N,w,S,T,C,F,W,B,A,I,D=e.docId,U=Wn((0,M.ky)(g.h.doc("hokkienWords/".concat(D))),3),O=U[0];return U[1],U[2],(0,b.jsxs)("div",{className:" h-full w-full px-3 py-2 flex flex-col items-start space-y-12 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsxs)("span",{className:" flex flex-col w-full space-y-2 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-400 text-2xl ",children:null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.hokkien}),(null===(n=null===O||void 0===O?void 0:O.data())||void 0===n?void 0:n.taiLo)&&(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-sky-600 text-xl ",children:null===(o=null===O||void 0===O?void 0:O.data())||void 0===o?void 0:o.taiLo})]}),(0,b.jsxs)("span",{className:" flex flex-col w-full space-y-4 px-3 py-2 bg-slate-800 rounded ",children:[(0,b.jsxs)("span",{className:" flex items-center w-[50%] justify-between ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-lg text-sky-500 ",children:"Hanzi"}),(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-xl text-sky-600 ",children:null===(l=null===O||void 0===O?void 0:O.data())||void 0===l?void 0:l.hanzi})]}),(0,b.jsxs)("span",{className:" flex w-[50%] items-center justify-between ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-lg text-sky-500 ",children:"Lannang"}),(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-xl text-sky-600 ",children:null===(a=null===O||void 0===O?void 0:O.data())||void 0===a?void 0:a.lannang})]}),(0,b.jsxs)("span",{className:" flex w-[50%] items-center justify-between ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-lg text-sky-500 ",children:"POJ"}),(0,b.jsx)("h2",{className:" font-fira-sans font-bold text-xl text-sky-600 ",children:null===(i=null===O||void 0===O?void 0:O.data())||void 0===i?void 0:i.poj})]})]}),(0,b.jsxs)("span",{className:" flex flex-col w-full space-y-14 bg-slate-800 rounded-md px-3 py-2 overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 h-full ",children:[(0,b.jsxs)("span",{className:" authSearchDetailsMeaning ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-500 ",children:null===(s=null===O||void 0===O?void 0:O.data())||void 0===s?void 0:s.type}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-400 ",children:null===(d=null===O||void 0===O?void 0:O.data())||void 0===d?void 0:d.meaning})]}),(null===(r=null===O||void 0===O?void 0:O.data())||void 0===r?void 0:r.secondType)&&(0,b.jsxs)("span",{className:" authSearchDetailsMeaning ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-500 ",children:null===(c=null===O||void 0===O?void 0:O.data())||void 0===c?void 0:c.secondType}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-400 ",children:null===(u=null===O||void 0===O?void 0:O.data())||void 0===u?void 0:u.secondMeaning})]}),(null===(v=null===O||void 0===O?void 0:O.data())||void 0===v?void 0:v.thirdType)&&(0,b.jsxs)("span",{className:" authSearchDetailsMeaning ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-500 ",children:null===(h=null===O||void 0===O?void 0:O.data())||void 0===h?void 0:h.thirdType}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-400 ",children:null===(f=null===O||void 0===O?void 0:O.data())||void 0===f?void 0:f.thirdMeaning})]}),(null===(p=null===O||void 0===O?void 0:O.data())||void 0===p?void 0:p.fourthType)&&(0,b.jsxs)("span",{className:" authSearchDetailsMeaning ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-500 ",children:null===(x=null===O||void 0===O?void 0:O.data())||void 0===x?void 0:x.fourthType}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-400 ",children:null===(m=null===O||void 0===O?void 0:O.data())||void 0===m?void 0:m.fourthMeaning})]}),(null===(y=null===O||void 0===O?void 0:O.data())||void 0===y?void 0:y.fifthType)&&(0,b.jsxs)("span",{className:" authSearchDetailsMeaning ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-500 ",children:null===(k=null===O||void 0===O?void 0:O.data())||void 0===k?void 0:k.fifthType}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-lg text-sky-400 ",children:null===(j=null===O||void 0===O?void 0:O.data())||void 0===j?void 0:j.fifthMeaning})]}),(null===(N=null===O||void 0===O?void 0:O.data())||void 0===N?void 0:N.sixthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(w=null===O||void 0===O?void 0:O.data())||void 0===w?void 0:w.seventhType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(S=null===O||void 0===O?void 0:O.data())||void 0===S?void 0:S.eighthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(T=null===O||void 0===O?void 0:O.data())||void 0===T?void 0:T.ninthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(C=null===O||void 0===O?void 0:O.data())||void 0===C?void 0:C.tenthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(F=null===O||void 0===O?void 0:O.data())||void 0===F?void 0:F.eleventhType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(W=null===O||void 0===O?void 0:O.data())||void 0===W?void 0:W.twelfthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(B=null===O||void 0===O?void 0:O.data())||void 0===B?void 0:B.thirteenthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(A=null===O||void 0===O?void 0:O.data())||void 0===A?void 0:A.fourteenthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "}),(null===(I=null===O||void 0===O?void 0:O.data())||void 0===I?void 0:I.fifteenthType)&&(0,b.jsx)("span",{className:" authSearchDetailsMeaning "})]})]})};function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function In(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return An(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return An(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Dn=function(e){var t,n,o,l,a,i=e.snapshot,s=e.closeButtonAction,d=e.editMeaningAction,r=In((0,j.F_)(g.fV),1)[0],c=(0,k.useState)(!1),u=(c[0],c[1],(0,k.useState)("")),v=(u[0],u[1],(0,k.useState)("")),h=v[0],f=v[1],p=(0,k.useState)(""),x=p[0],m=p[1],y=(0,k.useState)(""),N=y[0],w=y[1],S=(0,k.useState)(""),T=S[0],M=S[1],C=(0,k.useState)(""),F=(C[0],C[1],(0,k.useState)(""));return F[0],F[1],(0,b.jsxs)("div",{className:"dupeResEditModal",children:[(0,b.jsxs)("header",{className:" top-0 w-full flex items-center px-3 py-1 h-[75px] bg-slate-800 border-b border-sky-500 justify-between ",children:[(0,b.jsxs)("h3",{className:" font-fira-sans font-semibold text-sky-400 text-lg ",children:["Edit ",null===(t=null===i||void 0===i?void 0:i.data())||void 0===t?void 0:t.hokkien]}),(0,b.jsx)("button",{onClick:s,className:" grid place-items-center text-xl font-semibold text-sky-500 rounded-full border border-sky-500 hover:text-sky-700 hover:border-sky-700 active:outline-none transform transition duration-300 ease-in-out px-3 py-1 ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 px-4 py-3 space-y-7 overflow-y-scroll scrollbar-thin scrollbar-track-sky-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Numbered tai-lo:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(n=null===i||void 0===i?void 0:i.data())||void 0===n?void 0:n.taiLo})]}),(0,b.jsx)("input",{value:h,onChange:function(e){return f(e.target.value)},placeholder:"Change Numbered tai-lo...",type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 text-sky-300 rounded-lg font-fira-sans font-semibold placeholder-sky-600 "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).set({taiLo:h},{merge:!0}),f(""),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).collection("editorUpdates").add({updated:"Numbered tai-lo",updateBy:null===r||void 0===r?void 0:r.displayName,updateText:"Changed to ".concat(h)})},className:"dupeResEditSpanBtn",children:"Fix Numbered Tai-lo"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Hanzi:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(o=null===i||void 0===i?void 0:i.data())||void 0===o?void 0:o.hanzi})]}),(0,b.jsx)("input",{value:x,onChange:function(e){return m(e.target.value)},placeholder:"Change Hanzi...",type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 text-sky-300 rounded-lg font-fira-sans font-semibold placeholder-sky-600 "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).set({hanzi:x},{merge:!0}),m(""),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).collection("editorUpdates").add({updated:"Hanzi",updateBy:null===r||void 0===r?void 0:r.displayName,updateText:"Changed to ".concat(x)})},className:"dupeResEditSpanBtn",children:"Fix Hanzi"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Lannang:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(l=null===i||void 0===i?void 0:i.data())||void 0===l?void 0:l.lannang})]}),(0,b.jsx)("input",{value:N,onChange:function(e){return w(e.target.value)},placeholder:"Change Lannang...",type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 text-sky-300 rounded-lg font-fira-sans font-semibold placeholder-sky-600 "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).set({lannang:N},{merge:!0}),w(""),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).collection("editorUpdates").add({updated:"Lannang",updateBy:null===r||void 0===r?void 0:r.displayName,updateText:"Changed to ".concat(N)})},className:"dupeResEditSpanBtn",children:"Fix Lannang"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"POJ:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(a=null===i||void 0===i?void 0:i.data())||void 0===a?void 0:a.poj})]}),(0,b.jsx)("input",{value:T,onChange:function(e){return M(e.target.value)},placeholder:"Change POJ...",type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 text-sky-300 rounded-lg font-fira-sans font-semibold placeholder-sky-600 "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).set({poj:T},{merge:!0}),M(""),g.h.doc("hokkienWords/".concat(null===i||void 0===i?void 0:i.id)).collection("editorUpdates").add({updated:"POJ",updateBy:null===r||void 0===r?void 0:r.displayName,updateText:"Changed to ".concat(T)})},className:"dupeResEditSpanBtn",children:"Fix POJ"})]})]}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 w-[75%] mx-auto pb-8 ",children:"Hokkien fix will be at the end, done to avoid errors"})]}),(0,b.jsx)("footer",{className:" bottom-0 w-full flex flex-col bg-slate-800 border-t border-sky-400 ",children:(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsx)("span",{className:"dupeResEditSpanInner",children:(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:"To fix types & meanings, press the button below:"})}),(0,b.jsx)("button",{onClick:d,className:" font-fira-sans font-semibold h-[60px] w-[80%] mx-auto rounded-md text-xl text-sky-500 border border-sky-500 focus:outline-none active:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Fix types & meanings"})]})})]})};function Un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function On(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Un(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var _n=function(e){var t,n,o,l,a,i,s,d,r,c,u,v,h,f,p,x,m,y,N,w,S,T,M,C,F,W,B,A,I,D,U,O=e.snapshot,_=e.closeBtnAction,E=e.backToDetails,V=e.headToHokkien,R=On((0,j.F_)(g.fV),1)[0],z=(0,k.useState)(""),L=z[0],K=z[1],Z=(0,k.useState)(""),P=Z[0],H=Z[1],$=(0,k.useState)(""),X=$[0],G=$[1],J=(0,k.useState)(""),Y=J[0],Q=J[1],q=(0,k.useState)(""),ee=q[0],te=q[1],ne=(0,k.useState)(""),oe=ne[0],le=ne[1],ae=(0,k.useState)(""),ie=ae[0],se=ae[1],de=(0,k.useState)(""),re=de[0],ce=de[1],ue=(0,k.useState)(""),ve=ue[0],he=ue[1],fe=(0,k.useState)(""),pe=fe[0],xe=fe[1],me=(0,k.useState)(""),ye=me[0],be=me[1],ke=(0,k.useState)(""),ge=ke[0],je=ke[1],Ne=(0,k.useState)(""),we=Ne[0],Se=Ne[1],Te=(0,k.useState)(""),Me=Te[0],Ce=Te[1],Fe=(0,k.useState)(""),We=Fe[0],Be=Fe[1],Ae=(0,k.useState)(""),Ie=Ae[0],De=Ae[1],Ue=(0,k.useState)(""),Oe=Ue[0],_e=Ue[1],Ee=(0,k.useState)(""),Ve=Ee[0],Re=Ee[1],ze=(0,k.useState)(""),Le=ze[0],Ke=ze[1],Ze=(0,k.useState)(""),Pe=Ze[0],He=Ze[1],$e=(0,k.useState)(""),Xe=$e[0],Ge=$e[1],Je=(0,k.useState)(""),Ye=Je[0],Qe=Je[1],qe=(0,k.useState)(""),et=qe[0],tt=qe[1],nt=(0,k.useState)(""),ot=nt[0],lt=nt[1],at=(0,k.useState)(""),it=at[0],st=at[1],dt=(0,k.useState)(""),rt=dt[0],ct=dt[1],ut=(0,k.useState)(""),vt=ut[0],ht=ut[1],ft=(0,k.useState)(""),pt=ft[0],xt=ft[1],mt=(0,k.useState)(""),yt=mt[0],bt=mt[1],kt=(0,k.useState)(""),gt=kt[0],jt=kt[1],Nt=(0,k.useState)(""),wt=(Nt[0],Nt[1],(0,k.useState)(""));return wt[0],wt[1],(0,b.jsxs)("div",{className:" h-[85%] mx-auto lg:w-[65%] md:w-[85%] sm:w-[95%] w-[98%] bg-sky-700 border border-sky-500 flex flex-col items-center ",children:[(0,b.jsxs)("header",{className:" w-full top-0 h-[50px] border-b border-sky-300 flex items-center justify-between px-3 py-1 bg-slate-800 ",children:[(0,b.jsxs)("h3",{className:" text-lg text-sky-400 font-fira-sans font-semibold ",children:["Fix meanings for ",null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.hokkien]}),(0,b.jsx)("button",{onClick:_,className:" rounded-full border border-sky-400 text-lg text-sky-400 grid place-items-center px-3 py-1 font-fira-sans font-semibold hover:border-sky-600 hover:text-sky-600 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-[90%] w-full bg-slate-800 overflow-y-scroll scrollbar-thin scrollbar-track-slate-700 scrollbar-thumb-sky-400 flex flex-col space-y-4 items-start ",children:[(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(n=null===O||void 0===O?void 0:O.data())||void 0===n?void 0:n.type})]}),(0,b.jsx)("input",{value:L,onChange:function(e){return K(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(o=null===O||void 0===O?void 0:O.data())||void 0===o?void 0:o.meaning})]}),(0,b.jsx)("textarea",{value:P,onChange:function(e){return H(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),L&&P?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({type:L,meaning:P},{merge:!0}),H(""),K(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #1",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(L," & ").concat(P)})):alert("You cannot leave this blank, ".concat(null===R||void 0===R?void 0:R.displayName,". Please input the meaning & type"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #1"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(l=null===O||void 0===O?void 0:O.data())||void 0===l?void 0:l.secondType})]}),(0,b.jsx)("input",{value:Y,onChange:function(e){return Q(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(a=null===O||void 0===O?void 0:O.data())||void 0===a?void 0:a.secondMeaning})]}),(0,b.jsx)("textarea",{value:X,onChange:function(e){return G(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),Y&&X?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({secondMeaning:X,secondType:Y},{merge:!0}),G(""),Q(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #2",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Y," & ").concat(X)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #2"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(i=null===O||void 0===O?void 0:O.data())||void 0===i?void 0:i.thirdType})]}),(0,b.jsx)("input",{value:oe,onChange:function(e){return le(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(s=null===O||void 0===O?void 0:O.data())||void 0===s?void 0:s.thirdMeaning})]}),(0,b.jsx)("textarea",{value:ee,onChange:function(e){return te(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),ee&&oe&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.secondMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({thirdMeaning:ee,thirdType:oe},{merge:!0}),te(""),le(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #3",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(oe," & ").concat(ee)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #3"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(d=null===O||void 0===O?void 0:O.data())||void 0===d?void 0:d.fourthType})]}),(0,b.jsx)("input",{value:re,onChange:function(e){return ce(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(r=null===O||void 0===O?void 0:O.data())||void 0===r?void 0:r.fourthMeaning})]}),(0,b.jsx)("textarea",{value:ie,onChange:function(e){return se(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),ie&&re&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.thirdMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({fourthMeaning:ie,fourthType:re},{merge:!0}),se(""),ce(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #4",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(re," & ").concat(ie)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #4"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(c=null===O||void 0===O?void 0:O.data())||void 0===c?void 0:c.fifthType})]}),(0,b.jsx)("input",{value:pe,onChange:function(e){return xe(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(u=null===O||void 0===O?void 0:O.data())||void 0===u?void 0:u.fifthMeaning})]}),(0,b.jsx)("textarea",{value:ve,onChange:function(e){return he(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),ve&&pe&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.fourthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({thirdMeaning:ee,thirdType:oe},{merge:!0}),he(""),xe(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #5",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(pe," & ").concat(ve)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #5"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(v=null===O||void 0===O?void 0:O.data())||void 0===v?void 0:v.sixthType})]}),(0,b.jsx)("input",{value:ge,onChange:function(e){return je(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(h=null===O||void 0===O?void 0:O.data())||void 0===h?void 0:h.sixthMeaning})]}),(0,b.jsx)("textarea",{value:ye,onChange:function(e){return be(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),ye&&ge&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.fifthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({sixthMeaning:ye,sixthType:ge},{merge:!0}),be(""),je(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #6",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(ge," & ").concat(ye)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #6"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(f=null===O||void 0===O?void 0:O.data())||void 0===f?void 0:f.seventhType})]}),(0,b.jsx)("input",{value:Me,onChange:function(e){return Ce(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(p=null===O||void 0===O?void 0:O.data())||void 0===p?void 0:p.seventhMeaning})]}),(0,b.jsx)("textarea",{value:we,onChange:function(e){return Se(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),we&&Me&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.sixthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({seventhMeaning:we,seventhType:Me},{merge:!0}),Se(""),Ce(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #7",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Me," & ").concat(we)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #7"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(x=null===O||void 0===O?void 0:O.data())||void 0===x?void 0:x.eighthType})]}),(0,b.jsx)("input",{value:Ie,onChange:function(e){return De(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(m=null===O||void 0===O?void 0:O.data())||void 0===m?void 0:m.eighthMeaning})]}),(0,b.jsx)("textarea",{value:We,onChange:function(e){return Be(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),We&&Ie&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.seventhMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({eighthMeaning:We,eighthType:Ie},{merge:!0}),Be(""),De(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #8",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Ie," & ").concat(We)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #8"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(y=null===O||void 0===O?void 0:O.data())||void 0===y?void 0:y.ninthType})]}),(0,b.jsx)("input",{value:Ve,onChange:function(e){return Re(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(N=null===O||void 0===O?void 0:O.data())||void 0===N?void 0:N.ninthMeaning})]}),(0,b.jsx)("textarea",{value:Oe,onChange:function(e){return _e(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),Oe&&Ve&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.eighthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({ninthMeaning:Oe,ninthType:Ve},{merge:!0}),_e(""),Re(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #9",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Ve," & ").concat(Oe)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #9"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(w=null===O||void 0===O?void 0:O.data())||void 0===w?void 0:w.tenthType})]}),(0,b.jsx)("input",{value:Pe,onChange:function(e){return He(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(S=null===O||void 0===O?void 0:O.data())||void 0===S?void 0:S.tenthMeaning})]}),(0,b.jsx)("textarea",{value:Le,onChange:function(e){return Ke(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),Le&&Pe&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.ninthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({tenthMeaning:Le,tenthType:Pe},{merge:!0}),Ke(""),He(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #10",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Pe," & ").concat(Le)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #10"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(T=null===O||void 0===O?void 0:O.data())||void 0===T?void 0:T.eleventhType})]}),(0,b.jsx)("input",{value:Ye,onChange:function(e){return Qe(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(M=null===O||void 0===O?void 0:O.data())||void 0===M?void 0:M.eleventhMeaning})]}),(0,b.jsx)("textarea",{value:Xe,onChange:function(e){return Ge(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),Xe&&Ye&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.tenthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({eleventhMeaning:Xe,eleventhType:Ye},{merge:!0}),Ge(""),Qe(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #11",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(Ye," & ").concat(Xe)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #11"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(C=null===O||void 0===O?void 0:O.data())||void 0===C?void 0:C.twelfthType})]}),(0,b.jsx)("input",{value:ot,onChange:function(e){return lt(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(F=null===O||void 0===O?void 0:O.data())||void 0===F?void 0:F.tweflthMeaning})]}),(0,b.jsx)("textarea",{value:et,onChange:function(e){return tt(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),et&&ot&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.eleventhMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({twelfthMeaning:et,twelfthType:ot},{merge:!0}),tt(""),lt(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #12",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(ot," & ").concat(et)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #12"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(W=null===O||void 0===O?void 0:O.data())||void 0===W?void 0:W.thirteenthType})]}),(0,b.jsx)("input",{value:rt,onChange:function(e){return ct(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(B=null===O||void 0===O?void 0:O.data())||void 0===B?void 0:B.thirteenthMeaning})]}),(0,b.jsx)("textarea",{value:it,onChange:function(e){return st(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),it&&rt&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.twelfthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({thirteenthMeaning:it,thirteenthType:rt},{merge:!0}),st(""),ct(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #13",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(rt," & ").concat(it)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #13"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(A=null===O||void 0===O?void 0:O.data())||void 0===A?void 0:A.fourteenthType})]}),(0,b.jsx)("input",{value:pt,onChange:function(e){return xt(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(I=null===O||void 0===O?void 0:O.data())||void 0===I?void 0:I.fourteenthMeaning})]}),(0,b.jsx)("textarea",{value:vt,onChange:function(e){return ht(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),vt&&pt&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.thirteenthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({fourteenthMeaning:vt,fourteenthType:pt},{merge:!0}),ht(""),xt(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #14",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(pt," & ").concat(vt)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #14"})]})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Type:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(D=null===O||void 0===O?void 0:O.data())||void 0===D?void 0:D.fifteenthType})]}),(0,b.jsx)("input",{value:gt,onChange:function(e){return jt(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[60px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "})]}),(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsxs)("span",{className:"dupeResEditSpanInner",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-normal text-lg text-sky-400 ",children:"Meaning:"}),(0,b.jsx)("h1",{className:" font-montserr font-semibold text-xl text-sky-300 ",children:null===(U=null===O||void 0===O?void 0:O.data())||void 0===U?void 0:U.fifteenthMeaning})]}),(0,b.jsx)("textarea",{value:yt,onChange:function(e){return bt(e.target.value)},type:"text",className:" w-full outline-none border border-sky-500 h-[390px] px-3 py-2 bg-sky-900 rounded-lg font-fira-sans font-semibold "}),(0,b.jsxs)("span",{className:"dupeResEditSpanBottom",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){var t;e.preventDefault(),yt&&gt&&(null===(t=null===O||void 0===O?void 0:O.data())||void 0===t?void 0:t.fourteenthMeaning)?(g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).set({fifteenthMeaning:yt,fifteenthType:gt},{merge:!0}),bt(""),jt(""),g.h.doc("hokkienWords/".concat(null===O||void 0===O?void 0:O.id)).collection("editorUpdates").add({updated:"Meaning & type #15",updateBy:null===R||void 0===R?void 0:R.displayName,updateText:"Changed to ".concat(gt," & ").concat(yt)})):alert("There's something missing from your inputs, ".concat(null===R||void 0===R?void 0:R.displayName,". Either that, or there's no prior meaning"))},className:"dupeResEditSpanBtn",children:"Fix Meaning #15"})]})]})]}),(0,b.jsx)("footer",{className:" bottom-0 w-full flex flex-col bg-slate-800 border-t border-sky-400 ",children:(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsx)("span",{className:"dupeResEditSpanInnerAlt",children:(0,b.jsx)("h1",{className:" font-montserr font-semibold text-sm text-sky-300 ",children:"To go back to the details, press the left button below. Else, head to the fix for Hokkien if needed"})}),(0,b.jsxs)("span",{className:" dresEditMeaningFooterSpan ",children:[(0,b.jsx)("button",{onClick:E,className:" font-fira-sans font-semibold h-[60px] w-[45%] mx-auto rounded-md text-base text-sky-500 border border-sky-500 focus:outline-none active:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Fix word details"}),(0,b.jsx)("button",{onClick:V,className:" font-fira-sans font-semibold h-[60px] w-[45%] mx-auto rounded-md text-base text-sky-500 border border-sky-500 focus:outline-none active:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Fix Hokkien"})]})]})})]})};function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Vn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return En(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Rn=function(e){var t=e.snapshot,n=e.closeButtonAction,o=e.editMeaningAction,l=e.editDetailsAction,a=Vn((0,j.F_)(g.fV),1)[0],i=(0,k.useState)(""),s=i[0],d=i[1],r=(0,k.useState)(!1),c=r[0],u=r[1],v=(0,k.useState)(!1),h=v[0],f=v[1];return(0,b.jsxs)("div",{className:"dupeResEditHokkien",children:[(0,b.jsxs)("header",{className:" top-0 w-full flex items-center px-3 py-1 h-[75px] bg-slate-800 border-b border-sky-500 justify-between ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-400 text-lg ",children:"Edit Hokkien proper"}),(0,b.jsx)("button",{onClick:n,className:" grid place-items-center text-xl font-semibold text-sky-500 rounded-full border border-sky-500 hover:text-sky-700 hover:border-sky-700 active:outline-none transform transition duration-300 ease-in-out px-3 py-1 ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full bg-slate-800 px-4 py-3 pb-7 overflow-y-scroll scrollbar-thin space-y-2 scrollbar-track-slate-800 scrollbar-thumb-sky-400 ",children:[(0,b.jsxs)("div",{className:" h-[50%] w-full flex flex-col items-start px-3 py-2 space-y-3 ",children:[(0,b.jsx)("h1",{className:" font-fira-sans font-semibold text-sky-400 text-lg ",children:"Hokkien"}),(0,b.jsx)("input",{type:"text",placeholder:"Hokkien...",value:s,onChange:function(e){return d(e.target.value)},className:" outline-none border border-sky-400 w-[90%] h-[60px] mx-auto px-3 font-fira-sans font-semibold text-sky-400 bg-transparent rounded-sm text-xl placeholder-sky-700 "}),(0,b.jsxs)("span",{className:" w-full flex items-center justify-between px-3 ",children:[(0,b.jsx)("span",{}),(0,b.jsx)("button",{onClick:function(e){e.preventDefault(),g.h.doc("hokkienWords/".concat(null===t||void 0===t?void 0:t.id)).set({hokkien:s},{merge:!0}),d(""),g.h.doc("hokkienWords/".concat(null===t||void 0===t?void 0:t.id)).collection("editorUpdates").add({updated:"Hokkien",updateBy:null===a||void 0===a?void 0:a.displayName,updateText:"Changed to ".concat(s)})},className:" w-[45%] h-[50px] outline-none border border-sky-400 text-sky-400 bg-slate-800 rounded-md font-fira-sans font-normal text-xl hover:font-bold hover:border-sky-600 hover:text-sky-600 transform transition duration-300 ease-in-out ",children:"Fix Hokkien"})]})]}),(0,b.jsxs)("div",{className:" h-[50%] w-full flex flex-col items-start px-3 py-2 ",children:[0==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:function(){return u(!0)},className:"w-full h-[60px] flex items-center focus:outline-none active:outline-none border-b border-sky-500 outline-none px-3 space-x-3 font-fira-sans font-semibold text-sm text-sky-500 hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:[(0,b.jsx)(y.Z1Y,{style:{fontSize:"1.1em",color:"skyblue"}}),(0,b.jsx)("p",{children:"Why is the section for editing Hokkien here ?"})]}),(0,b.jsx)("span",{className:"w-full h-[120px]"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:function(){return u(!1)},className:"w-full h-[60px] flex items-center focus:outline-none active:outline-none border-b border-sky-500 outline-none px-3 space-x-3 font-fira-sans font-semibold text-sm text-sky-500 hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:[(0,b.jsx)(y.NWQ,{style:{fontSize:"1.1em",color:"skyblue"}}),(0,b.jsx)("p",{children:"Close"})]}),(0,b.jsx)("span",{className:"w-[80%] h-[120px] font-fira-sans font-bold text-sky-400 text-md overflow-y-scroll scrollbar-hide mx-auto",children:"So as to prevent an error in the updating of the duplicated word"})]}),0==h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:function(){return f(!0)},className:"w-full h-[60px] flex items-center focus:outline-none active:outline-none border-b border-sky-500 outline-none px-3 space-x-3 font-fira-sans font-semibold text-sm text-sky-500 hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:[(0,b.jsx)(y.Z1Y,{style:{fontSize:"1.1em",color:"skyblue"}}),(0,b.jsx)("p",{children:"What error is going to be ecnountered ?"})]}),(0,b.jsx)("span",{className:"w-full h-[120px]"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:function(){return f(!1)},className:"w-full h-[60px] flex items-center focus:outline-none active:outline-none border-b border-sky-500 outline-none px-3 space-x-3 font-fira-sans font-semibold text-sm text-sky-500 hover:border-sky-700 hover:text-sky-700 transform transition duration-300 ease-in-out ",children:[(0,b.jsx)(y.NWQ,{style:{fontSize:"1.1em",color:"skyblue"}}),(0,b.jsx)("p",{children:"Close"})]}),(0,b.jsx)("span",{className:"w-[80%] h-[120px] font-fira-sans font-bold text-sky-400 text-md overflow-y-scroll scrollbar-hide mx-auto",children:"So as to prevent errors in the updating of the duplicated word"})]})]})]}),(0,b.jsx)("footer",{className:" bottom-0 w-full flex flex-col bg-slate-800 border-t border-sky-400 ",children:(0,b.jsxs)("span",{className:" dupeResEditSpan ",children:[(0,b.jsx)("span",{className:"dupeResEditSpanInner",children:(0,b.jsx)("h1",{className:" font-montserr font-semibold text-base text-sky-300 ",children:"To recheck both details & meanings, click either of the buttons below"})}),(0,b.jsxs)("span",{className:"dresEditMeaningFooterSpan",children:[(0,b.jsx)("button",{onClick:l,className:" font-fira-sans font-semibold h-[60px] w-[45%] mx-auto rounded-md text-base text-sky-500 border border-sky-500 focus:outline-none active:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Check details"}),(0,b.jsx)("button",{onClick:o,className:" font-fira-sans font-semibold h-[60px] w-[45%] mx-auto rounded-md text-base text-sky-500 border border-sky-500 focus:outline-none active:outline-none hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"Check types & meanings"})]})]})})]})};function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,l,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(d){s=!0,l=d}finally{try{i||null==n.return||n.return()}finally{if(s)throw l}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Kn=function(e){var t,n,o,l,a,i,s,d,c,u,v,h=e.snapshot,f=e.openEditDetails,p=e.openAddMeaning,x=e.openEditLabels,m=e.openFeedbackForm,y=e.hit,w=e.setWordInfo,S=(0,k.useState)(!1),C=(S[0],S[1],(0,N.useRouter)()),F=Ln((0,j.F_)(g.fV),1)[0],W=(0,k.useState)(!1),B=(W[0],W[1],(0,k.useState)(!0)),A=B[0],I=B[1],D=(0,k.useState)(!1),U=D[0],O=D[1],_=(0,k.useState)(!1),E=_[0],V=_[1],R=(0,k.useState)(""),z=(R[0],R[1],function(){(E||U)&&(V(!1)||O(!1)),I(!0)}),L=(Ln((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===h||void 0===h?void 0:h.id)).collection("sampleSentence")),1)[0],Ln((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===h||void 0===h?void 0:h.id)).collection("editorNotes")),1)[0],Ln((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===h||void 0===h?void 0:h.id)).collection("editorUpdates").orderBy("updatedOn","desc")),1)[0]),K=(Ln((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===h||void 0===h?void 0:h.id)).collection("commentsData")),1)[0],Ln((0,M.Kx)(g.h.doc("/hokkienWords/".concat(null===h||void 0===h?void 0:h.id)).collection("feedbackCollection")),1)[0]);return(0,k.useEffect)((function(){F&&g.h.collection("users").doc(F.uid).set({email:F.email,displayName:F.displayName,photoURL:F.photoURL})}),[F]),(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:" sresWordInfoLg ",children:[(0,b.jsx)("header",{className:" w-full bg-slate-700 top-0 z-50 sticky flex items-center justify-between px-4 py-3",children:(0,b.jsxs)("p",{className:" font-fira-sans font-semibold text-xl text-sky-50 underline pl-3 pr-5 sticky z-50 ",children:["Info about word: ",null===(t=null===h||void 0===h?void 0:h.data())||void 0===t?void 0:t.hokkien]})}),(0,b.jsxs)("div",{className:" h-full w-full flex flex-col items-center space-y-2 px-4 py-3 z-50 sticky overflow-hidden",children:[(0,b.jsxs)("div",{className:" w-full h-[30%] flex items-center justify-evenly space-x-4 mx-auto ",children:[(0,b.jsx)("span",{className:" grid top-1 z-50 sticky place-items-start w-full space-y-4 px-5 ",children:(0,b.jsxs)("span",{className:" w-full flex flex-col space-y-3 px-2 py-1 ",children:[(0,b.jsx)("h1",{className:"sResHokkien ",children:null===(n=null===h||void 0===h?void 0:h.data())||void 0===n?void 0:n.hokkien}),(0,b.jsx)("h2",{className:" sresTaiLo",children:null===(o=null===h||void 0===h?void 0:h.data())||void 0===o?void 0:o.hanzi}),(null===(l=null===h||void 0===h?void 0:h.data())||void 0===l?void 0:l.variants)&&(0,b.jsxs)("span",{className:" flex items-center space-x-2 ",children:[(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-lg text-sky-50 ",children:"Variant/s:"}),(0,b.jsx)("h2",{className:" font-fira-sans font-semibold text-xl text-sky-100 ",children:null===(a=null===h||void 0===h?void 0:h.data())||void 0===a?void 0:a.variants})]}),(null===(i=null===h||void 0===h?void 0:h.data())||void 0===i?void 0:i.pronunciation)&&(0,b.jsx)("span",{className:" px-3 py-2 border border-sky-400 rounded ",children:(0,b.jsx)("audio",{src:null===(s=null===h||void 0===h?void 0:h.data())||void 0===s?void 0:s.pronunciation,controls:!0})})]})}),(0,b.jsxs)("div",{className:" flex flex-col items-start w-full space-y-1 justify-evenly ",children:[(0,b.jsxs)("span",{className:" flex flex-col items-start ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-200 text-lg ",children:"POJ:"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-100 text-lg ",children:null===(d=null===h||void 0===h?void 0:h.data())||void 0===d?void 0:d.poj})]}),("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&""!=(null===(c=null===h||void 0===h?void 0:h.data())||void 0===c?void 0:c.taiLo)&&(0,b.jsxs)("span",{className:" flex flex-col items-start ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-200 text-lg ",children:"Tai-lo (#):"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-100 text-lg ",children:null===(u=null===h||void 0===h?void 0:h.data())||void 0===u?void 0:u.taiLo})]}),(0,b.jsxs)("span",{className:" flex flex-col items-start ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-sky-200 text-lg ",children:"Lannang:"}),(0,b.jsx)("h1",{className:" font-fira-sans font-bold text-sky-100 text-lg ",children:null===(v=null===h||void 0===h?void 0:h.data())||void 0===v?void 0:v.lannang})]})]})]}),(0,b.jsxs)("div",{className:" w-full px-3 py-1 flex items-end justify-between ",children:[(0,b.jsx)("span",{}),(0,b.jsx)(r.Z,{buttonText:"Options",size:"sm",buttonType:"link",color:"blue",children:(0,b.jsxs)("div",{className:" bg-slate-800 h-[210px] w-[260px] overflow-y-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-400 flex flex-col items-center space-y-3 py-4 ",children:[("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&(0,b.jsx)("button",{onClick:f,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Edit details"}),("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&(0,b.jsx)("button",{onClick:p,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Edit meanings"}),("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&(0,b.jsx)("button",{onClick:x,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Labels options"}),(null===F||void 0===F?void 0:F.email)?(0,b.jsx)("button",{onClick:m,className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Give feedback"}):(0,b.jsx)("button",{onClick:function(){g.fV.signInWithPopup(g.Ap).catch(alert),m()},className:" w-[90%] h-[45px] mx-auto font-fira-sans font-semibold border border-sky-400 text-lg text-sky-400 hover:text-sky-600 hover:border-sky-600 rounded-md transform transition duration-300 ",children:"Sign in first"})]})})]}),(0,b.jsxs)("div",{className:" h-[70%] w-full bg-opacity-60 rounded-sm ",children:[(0,b.jsxs)("header",{className:" w-full min-h-[50px] max-h-[70px] justify-evenly flex items-center space-x-2 px-3 py-1 overflow-x-scroll scrollbar-thin scrollbar-track-slate-800 scrollbar-thumb-sky-600 ",children:["rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email)?(0,b.jsx)("button",{onClick:z,className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[420px] ",children:"Meanings"}):(0,b.jsx)("button",{onClick:z,className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out w-full ",children:"Meanings"}),("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&(0,b.jsx)("button",{onClick:function(){(A||U)&&(I(!1)||O(!1)),V(!0)},className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[420px] ",children:"Update/s"}),("rumlowb@gmail.com"==(null===F||void 0===F?void 0:F.email)||"marvin_sy@dlsu.edu.ph"==(null===F||void 0===F?void 0:F.email)||"sygrandkaiser@gmail.com"==(null===F||void 0===F?void 0:F.email)||"reaperiff697@gmail.com"==(null===F||void 0===F?void 0:F.email))&&(0,b.jsx)("button",{onClick:function(){(A||E)&&(I(!1)||V(!1)),O(!0)},className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[420px] ",children:"Feedback/s"})]}),A&&(0,b.jsx)("div",{className:" flex flex-col overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 px-4 py-3 pb-96 h-[80%] m-auto w-full space-y-5 bg-opacity-60 ",children:(0,b.jsx)(ct,{hit:y})}),U&&(0,b.jsx)("div",{className:" flex flex-col overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 px-4 py-3 pb-52 h-[80%] m-auto w-full space-y-5 ",children:K&&(null===K||void 0===K?void 0:K.docs.map((function(e){return(0,b.jsx)(T,{snapshot:e})})))}),E&&(0,b.jsx)("div",{className:" flex flex-col overflow-y-scroll scrollbar-thin scrollbar-track-slate-900 scrollbar-thumb-sky-500 px-4 py-3 h-[80%] m-auto w-full space-y-12 ",children:null!==L&&(null===L||void 0===L?void 0:L.docs.map((function(e){return(0,b.jsx)(un,{snapshot:e})})))})]})]}),(0,b.jsxs)("footer",{className:" place-self-end justify-evenly w-full h-[10%] flex items-center px-4 py-3 bg-slate-700 ",children:[(0,b.jsx)("button",{onClick:function(){return w(!1)},className:" font-fira-sans w-[40%] justify-center rounded-md font-normal capitalize text-lg flex items-center space-x-4 border hover:border-2 focus:border-4 focus:outline-none h-[40px] border-sky-400 text-sky-500 focus:text-sky-100 transform transition duration-200 ease-in-out ",children:"Exit"}),(0,b.jsx)("button",{onClick:function(){return C.push("/word/".concat(null===h||void 0===h?void 0:h.id))},className:" font-fira-sans font-normal w-[40%] justify-center rounded-md capitalize text-lg flex items-center space-x-4 border hover:border-2 focus:border-4 focus:outline-none h-[40px] border-emerald-400 text-emerald-500 active:text-emerald-100 transform transition duration-200 ease-in-out ",children:"Read more"})]})]})})};var Zn=function(e){var t=e.openEditDetails,n=e.openAddMeaning,o=(e.openEditSynonyms,e.closeEditOption),l=e.openEditLabels;return e.closeEditLabels,(0,b.jsxs)("div",{className:" h-[390px] w-[430px] rounded-md mx-auto bg-slate-800 ",children:[(0,b.jsxs)("header",{className:" flex items-center justify-between px-4 py-3 border-b border-sky-400 ",children:[(0,b.jsx)("h3",{className:" font-fira-sans font-semibold text-lg text-sky-500 ",children:"Options on what to edit"}),(0,b.jsx)("button",{onClick:o,className:" font-fira-sans font-bold text-sky-400 text-xl px-3 py-1 rounded-full border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out ",children:"X"})]}),(0,b.jsxs)("div",{className:" h-full w-full flex flex-col items-center justify-center space-y-4 ",children:[(0,b.jsx)("button",{onClick:t,className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[390px] ",children:"Edit details"}),(0,b.jsx)("button",{onClick:n,className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[390px] ",children:"Edit meanings"}),(0,b.jsx)("button",{onClick:l,className:" px-3 py-2 font-fira-sans font-semibold text-lg text-sky-400 rounded border border-sky-400 hover:text-sky-600 hover:border-sky-600 transform transition duration-300 ease-in-out min-w-[390px] ",children:"Edit labels"})]})]})}}}]);