@ienlab/react-library 0.11.0-dev01 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,12 @@ declare const _default: {
23
23
  "default": "We couldn’t complete the sign-in. Please try again later."
24
24
  }
25
25
  },
26
- "unknown_error_occurred": "Unknown error occurred."
26
+ "unknown_error_occurred": "Unknown error occurred.",
27
+ "datetime": {
28
+ "date_format": "MMMM D, YYYY",
29
+ "date_time_format": "MMMM D, YYYY h:mm:ss A",
30
+ "time_format": "h:mm:ss A"
31
+ }
27
32
  };
28
33
 
29
34
  export default _default;
@@ -23,7 +23,12 @@ declare const _default: {
23
23
  "default": "로그인 중 문제가 발생했어요. 잠시 후 다시 시도해 주세요."
24
24
  }
25
25
  },
26
- "unknown_error_occurred": "알 수 없는 오류가 발생했습니다."
26
+ "unknown_error_occurred": "알 수 없는 오류가 발생했습니다.",
27
+ "datetime": {
28
+ "date_format": "YYYY년 M월 D일",
29
+ "date_time_format": "YYYY년 M월 D일 a h:mm:ss",
30
+ "time_format": "a h:mm:ss"
31
+ }
27
32
  };
28
33
 
29
34
  export default _default;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`react`),t=require(`motion/react`),n=require(`react/jsx-runtime`),r=require(`firebase/firestore`),i=require(`zustand/react`);function a({placeholder:r,src:i,onLoadError:a,...o}){let[s,c]=(0,e.useState)(()=>{if(typeof window>`u`||!i)return!1;let e=new Image;return e.src=i,e.complete&&e.naturalWidth>0}),[l,u]=(0,e.useState)(i);return l!==i&&(u(i),c(!1)),(0,e.useEffect)(()=>{if(!i)return;let e=new Image;return e.src=i,e.onload=()=>c(!0),e.onerror=e=>{a?a(e):console.error(`CrossfadeImage: Failed to load image`,i)},e.complete&&e.naturalWidth>0&&e.onload(new Event(`load`)),()=>{e.onload=null,e.onerror=null}},[i,a]),(0,n.jsx)(t.AnimatePresence,{children:s&&i?(0,n.jsx)(t.motion.img,{src:i,...o,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{...o.style}},`loaded-image`):(0,n.jsx)(t.motion.div,{initial:{opacity:1},transition:{duration:.3},style:{...o.style},children:r??(0,n.jsx)(`div`,{className:`w-full h-full bg-sidebar`})},`placeholder`)})}var o=[`ko`,`en`];function s(e){return{...e.data(),id:e.id}}async function c(e,t,n,i){let a=i.filter(e=>!!(e&&!n.has(e.path)));for(let i=0;i<a.length;i+=30){let o=a.slice(i,i+30);(await(0,r.getDocs)((0,r.query)(e,(0,r.where)((0,r.documentId)(),`in`,o.map(e=>e.id))))).forEach(e=>{let r=t(e);n.set(e.ref.path,r)})}}async function l(e,t,n){let i=n.filter(e=>!!(e&&!t.has(e.path)));await Promise.all(i.map(async n=>{let i=e(await(0,r.getDoc)(n));t.set(n.path,i)}))}function u(e={}){let{cache:t=!0,includeMetadataChanges:n}=e;return{listenOptions:{includeMetadataChanges:n??!t},cache:t}}function d(e,t){return t!==!1||!e}function f(e,t,n={}){let{listenOptions:i,cache:a}=u(n),{onError:o}=n;return e.type,(0,r.onSnapshot)(e,i,e=>{d(e.metadata.fromCache,a)&&t(e)},o)}Array.prototype.mapNotNull=function(e){return this.flatMap((t,n)=>{let r=e(t,n);return r==null?[]:[r]})};function p(){if(typeof window>`u`)return`pc`;let e=navigator.userAgent,t=navigator.platform,n=/Android/i.test(e),r=/iPhone|iPad|iPod/i.test(e)||t===`MacIntel`&&navigator.maxTouchPoints>1;return n?`android`:r?`ios`:`pc`}function m(t){let r=(0,e.createContext)(null);function a({children:i,...a}){let[o]=(0,e.useState)(()=>t(a));return(0,n.jsx)(r.Provider,{value:o,children:i})}function o(t){let n=(0,e.useContext)(r);if(!n)throw Error(`Provider가 필요합니다.`);return(0,i.useStore)(n,t)}let s=new Map;return{Provider:a,useStore:o,use:new Proxy({},{get:(e,t)=>(s.has(t)||s.set(t,()=>o(e=>e[t])),s.get(t))})}}var h=()=>({updateAt:(0,r.serverTimestamp)(),delete:!0}),g=()=>({updateAt:(0,r.serverTimestamp)(),delete:!1});function _(e){switch(e){case`auth/user-not-found`:return`libs:auth.errors.user_not_found`;case`auth/wrong-password`:return`libs:auth.errors.wrong_password`;case`auth/invalid-credential`:return`libs:auth.errors.invalid_credential`;case`auth/invalid-email`:return`libs:auth.errors.invalid_email`;case`auth/user-disabled`:return`libs:auth.errors.user_disabled`;case`auth/too-many-requests`:return`libs:auth.errors.too_many_requests`;case`auth/network-request-failed`:return`libs:auth.errors.network_request_failed`;case`auth/timeout`:return`libs:auth.errors.timeout`;case`auth/email-already-in-use`:return`libs:auth.errors.email_already_in_use`;case`auth/weak-password`:return`libs:auth.errors.weak_password`;case`auth/requires-recent-login`:return`libs:auth.errors.requires_recent_login`;case`auth/user-token-expired`:return`libs:auth.errors.user_token_expired`;case`auth/popup-blocked`:return`libs:auth.errors.popup_blocked`;case`auth/popup-closed-by-user`:return`libs:auth.errors.popup_closed_by_user`;case`auth/operation-not-allowed`:return`libs:auth.errors.operation_not_allowed`;case`auth/web-storage-unsupported`:return`libs:auth.errors.web_storage_unsupported`;case`auth/unauthorized-domain`:return`libs:auth.errors.unauthorized_domain`;default:return`libs:auth.errors.default`}}var v={auth:{errors:{invalid_credential:`이메일 또는 비밀번호를 다시 확인해 주세요.`,wrong_password:`이메일 또는 비밀번호를 다시 확인해 주세요.`,user_not_found:`입력한 정보와 일치하는 계정을 찾을 수 없어요.`,invalid_email:`이메일 형식을 확인해 주세요.`,email_already_in_use:`이미 가입된 이메일이에요. 로그인하거나 다른 이메일을 사용해 주세요.`,weak_password:`비밀번호는 6자 이상으로 입력해 주세요.`,user_disabled:`이 계정은 현재 사용할 수 없어요. 관리자에게 문의해 주세요.`,too_many_requests:`시도가 너무 많아요. 잠시 후 다시 시도해 주세요.`,network_request_failed:`인터넷 연결을 확인한 뒤 다시 시도해 주세요.`,timeout:`응답이 지연되고 있어요. 잠시 후 다시 시도해 주세요.`,requires_recent_login:`보안을 위해 다시 로그인해 주세요.`,user_token_expired:`로그인 시간이 만료되었어요. 다시 로그인해 주세요.`,operation_not_allowed:`현재 사용할 수 없는 로그인 방식이에요.`,account_exists_with_different_credential:`이미 다른 로그인 방식으로 가입된 이메일이에요. 기존 방식으로 로그인해 주세요.`,popup_blocked:`로그인 창이 차단되었어요. 팝업 허용 후 다시 시도해 주세요.`,popup_closed_by_user:`로그인 창이 닫혀서 로그인이 완료되지 않았어요.`,web_storage_unsupported:`현재 브라우저 설정에서는 로그인을 진행할 수 없어요.`,unauthorized_domain:`현재 접속한 도메인에서는 로그인을 사용할 수 없어요.`,internal_error:`문제가 발생했어요. 잠시 후 다시 시도해 주세요.`,default:`로그인 중 문제가 발생했어요. 잠시 후 다시 시도해 주세요.`}},unknown_error_occurred:`알 수 없는 오류가 발생했습니다.`},y={auth:{errors:{invalid_credential:`Please check your email or password.`,wrong_password:`Please check your email or password.`,user_not_found:`We couldn’t find an account matching that information.`,invalid_email:`Please check your email format.`,email_already_in_use:`This email is already registered. Sign in or use a different email.`,weak_password:`Your password must be at least 6 characters long.`,user_disabled:`This account is currently unavailable. Please contact support.`,too_many_requests:`Too many attempts. Please try again later.`,network_request_failed:`Check your internet connection and try again.`,timeout:`The request is taking too long. Please try again.`,requires_recent_login:`For security reasons, please sign in again.`,user_token_expired:`Your session has expired. Please sign in again.`,operation_not_allowed:`This sign-in method is currently unavailable.`,account_exists_with_different_credential:`This email is already linked to another sign-in method. Please use that method to sign in.`,popup_blocked:`The sign-in window was blocked. Please allow pop-ups and try again.`,popup_closed_by_user:`The sign-in window was closed before completion.`,web_storage_unsupported:`Sign-in is not available with your current browser settings.`,unauthorized_domain:`Sign-in is not available on this domain.`,internal_error:`Something went wrong. Please try again later.`,default:`We couldn’t complete the sign-in. Please try again later.`}},unknown_error_occurred:`Unknown error occurred.`};function b(e){e.hasResourceBundle(`ko`,`libs`)||e.addResourceBundle(`ko`,`libs`,v,!0,!1),e.hasResourceBundle(`en`,`libs`)||e.addResourceBundle(`en`,`libs`,y,!0,!1)}var x={Info:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-sky-600), var(--color-sky-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`},Solid:{"--normal-bg":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`}},Success:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-green-600), var(--color-green-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`},Solid:{"--normal-bg":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`}},Warning:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-amber-600), var(--color-amber-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`},Solid:{"--normal-bg":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`}},Destructive:{Soft:{"--normal-bg":`color-mix(in oklab, var(--destructive) 10%, var(--background))`,"--normal-text":`var(--destructive)`,"--normal-border":`var(--destructive)`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`var(--destructive)`,"--normal-border":`var(--destructive)`},Solid:{"--normal-bg":`light-dark(var(--destructive), color-mix(in oklab, var(--destructive) 60%, var(--background)))`,"--normal-text":`var(--color-white)`,"--normal-border":`transparent`}}};exports.CrossfadeImage=a,exports.SUPPORTED_LOCALES=o,exports.ToastCSS=x,exports.createZustandContext=m,exports.deleteItem=h,exports.fetchItems=c,exports.fetchItemsByOne=l,exports.getAuthErrorKey=_,exports.getPlatformType=p,exports.getSnapshots=f,exports.initIenlabI18n=b,exports.snapshotToData=s,exports.undeleteItem=g;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`),u=require(`motion/react`),d=require(`react/jsx-runtime`),f=require(`firebase/firestore`),p=require(`zustand/react`),m=require(`react-i18next`);function h({placeholder:e,src:t,onLoadError:n,...r}){let[i,a]=(0,l.useState)(()=>{if(typeof window>`u`||!t)return!1;let e=new Image;return e.src=t,e.complete&&e.naturalWidth>0}),[o,s]=(0,l.useState)(t);return o!==t&&(s(t),a(!1)),(0,l.useEffect)(()=>{if(!t)return;let e=new Image;return e.src=t,e.onload=()=>a(!0),e.onerror=e=>{n?n(e):console.error(`CrossfadeImage: Failed to load image`,t)},e.complete&&e.naturalWidth>0&&e.onload(new Event(`load`)),()=>{e.onload=null,e.onerror=null}},[t,n]),(0,d.jsx)(u.AnimatePresence,{children:i&&t?(0,d.jsx)(u.motion.img,{src:t,...r,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{...r.style}},`loaded-image`):(0,d.jsx)(u.motion.div,{initial:{opacity:1},transition:{duration:.3},style:{...r.style},children:e??(0,d.jsx)(`div`,{className:`w-full h-full bg-sidebar`})},`placeholder`)})}var g=[`ko`,`en`];function _(e){return{...e.data(),id:e.id}}async function v(e,t,n,r){let i=r.filter(e=>!!(e&&!n.has(e.path)));for(let r=0;r<i.length;r+=30){let a=i.slice(r,r+30);(await(0,f.getDocs)((0,f.query)(e,(0,f.where)((0,f.documentId)(),`in`,a.map(e=>e.id))))).forEach(e=>{let r=t(e);n.set(e.ref.path,r)})}}async function y(e,t,n){let r=n.filter(e=>!!(e&&!t.has(e.path)));await Promise.all(r.map(async n=>{let r=e(await(0,f.getDoc)(n));t.set(n.path,r)}))}function b(e={}){let{cache:t=!0,includeMetadataChanges:n}=e;return{listenOptions:{includeMetadataChanges:n??!t},cache:t}}function x(e,t){return t!==!1||!e}function S(e,t,n={}){let{listenOptions:r,cache:i}=b(n),{onError:a}=n;return e.type,(0,f.onSnapshot)(e,r,e=>{x(e.metadata.fromCache,i)&&t(e)},a)}Array.prototype.mapNotNull=function(e){return this.flatMap((t,n)=>{let r=e(t,n);return r==null?[]:[r]})};function C(){if(typeof window>`u`)return`pc`;let e=navigator.userAgent,t=navigator.platform,n=/Android/i.test(e),r=/iPhone|iPad|iPod/i.test(e)||t===`MacIntel`&&navigator.maxTouchPoints>1;return n?`android`:r?`ios`:`pc`}function w(e){let t=(0,l.createContext)(null);function n({children:n,...r}){let[i]=(0,l.useState)(()=>e(r));return(0,d.jsx)(t.Provider,{value:i,children:n})}function r(e){let n=(0,l.useContext)(t);if(!n)throw Error(`Provider가 필요합니다.`);return(0,p.useStore)(n,e)}let i=new Map;return{Provider:n,useStore:r,use:new Proxy({},{get:(e,t)=>(i.has(t)||i.set(t,()=>r(e=>e[t])),i.get(t))})}}var T=c(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}))(),1);function E(e,t,n){return!e||!(0,T.default)(e).isValid()?``:(0,T.default)(e).format(n(t))}function D(){let{t:e}=(0,m.useTranslation)();return(0,l.useMemo)(()=>({basicDateTimeFormat:(t,n)=>E(t,n,e),dateTimeFormat:t=>E(t,`libs:datetime.date_time_format`,e),dateFormat:t=>E(t,`libs:datetime.date_format`,e),timeFormat:t=>E(t,`libs:datetime.time_format`,e)}),[e])}function O(e){return(0,T.default)(e).format(`YYYYMMDD`)}function k(e){return(0,T.default)(e).format(`HH:mm`)}var A=()=>({updateAt:(0,f.serverTimestamp)(),delete:!0}),j=()=>({updateAt:(0,f.serverTimestamp)(),delete:!1});function M(e){switch(e){case`auth/user-not-found`:return`libs:auth.errors.user_not_found`;case`auth/wrong-password`:return`libs:auth.errors.wrong_password`;case`auth/invalid-credential`:return`libs:auth.errors.invalid_credential`;case`auth/invalid-email`:return`libs:auth.errors.invalid_email`;case`auth/user-disabled`:return`libs:auth.errors.user_disabled`;case`auth/too-many-requests`:return`libs:auth.errors.too_many_requests`;case`auth/network-request-failed`:return`libs:auth.errors.network_request_failed`;case`auth/timeout`:return`libs:auth.errors.timeout`;case`auth/email-already-in-use`:return`libs:auth.errors.email_already_in_use`;case`auth/weak-password`:return`libs:auth.errors.weak_password`;case`auth/requires-recent-login`:return`libs:auth.errors.requires_recent_login`;case`auth/user-token-expired`:return`libs:auth.errors.user_token_expired`;case`auth/popup-blocked`:return`libs:auth.errors.popup_blocked`;case`auth/popup-closed-by-user`:return`libs:auth.errors.popup_closed_by_user`;case`auth/operation-not-allowed`:return`libs:auth.errors.operation_not_allowed`;case`auth/web-storage-unsupported`:return`libs:auth.errors.web_storage_unsupported`;case`auth/unauthorized-domain`:return`libs:auth.errors.unauthorized_domain`;default:return`libs:auth.errors.default`}}var N={auth:{errors:{invalid_credential:`이메일 또는 비밀번호를 다시 확인해 주세요.`,wrong_password:`이메일 또는 비밀번호를 다시 확인해 주세요.`,user_not_found:`입력한 정보와 일치하는 계정을 찾을 수 없어요.`,invalid_email:`이메일 형식을 확인해 주세요.`,email_already_in_use:`이미 가입된 이메일이에요. 로그인하거나 다른 이메일을 사용해 주세요.`,weak_password:`비밀번호는 6자 이상으로 입력해 주세요.`,user_disabled:`이 계정은 현재 사용할 수 없어요. 관리자에게 문의해 주세요.`,too_many_requests:`시도가 너무 많아요. 잠시 후 다시 시도해 주세요.`,network_request_failed:`인터넷 연결을 확인한 뒤 다시 시도해 주세요.`,timeout:`응답이 지연되고 있어요. 잠시 후 다시 시도해 주세요.`,requires_recent_login:`보안을 위해 다시 로그인해 주세요.`,user_token_expired:`로그인 시간이 만료되었어요. 다시 로그인해 주세요.`,operation_not_allowed:`현재 사용할 수 없는 로그인 방식이에요.`,account_exists_with_different_credential:`이미 다른 로그인 방식으로 가입된 이메일이에요. 기존 방식으로 로그인해 주세요.`,popup_blocked:`로그인 창이 차단되었어요. 팝업 허용 후 다시 시도해 주세요.`,popup_closed_by_user:`로그인 창이 닫혀서 로그인이 완료되지 않았어요.`,web_storage_unsupported:`현재 브라우저 설정에서는 로그인을 진행할 수 없어요.`,unauthorized_domain:`현재 접속한 도메인에서는 로그인을 사용할 수 없어요.`,internal_error:`문제가 발생했어요. 잠시 후 다시 시도해 주세요.`,default:`로그인 중 문제가 발생했어요. 잠시 후 다시 시도해 주세요.`}},unknown_error_occurred:`알 수 없는 오류가 발생했습니다.`,datetime:{date_format:`YYYY년 M월 D일`,date_time_format:`YYYY년 M월 D일 a h:mm:ss`,time_format:`a h:mm:ss`}},P={auth:{errors:{invalid_credential:`Please check your email or password.`,wrong_password:`Please check your email or password.`,user_not_found:`We couldn’t find an account matching that information.`,invalid_email:`Please check your email format.`,email_already_in_use:`This email is already registered. Sign in or use a different email.`,weak_password:`Your password must be at least 6 characters long.`,user_disabled:`This account is currently unavailable. Please contact support.`,too_many_requests:`Too many attempts. Please try again later.`,network_request_failed:`Check your internet connection and try again.`,timeout:`The request is taking too long. Please try again.`,requires_recent_login:`For security reasons, please sign in again.`,user_token_expired:`Your session has expired. Please sign in again.`,operation_not_allowed:`This sign-in method is currently unavailable.`,account_exists_with_different_credential:`This email is already linked to another sign-in method. Please use that method to sign in.`,popup_blocked:`The sign-in window was blocked. Please allow pop-ups and try again.`,popup_closed_by_user:`The sign-in window was closed before completion.`,web_storage_unsupported:`Sign-in is not available with your current browser settings.`,unauthorized_domain:`Sign-in is not available on this domain.`,internal_error:`Something went wrong. Please try again later.`,default:`We couldn’t complete the sign-in. Please try again later.`}},unknown_error_occurred:`Unknown error occurred.`,datetime:{date_format:`MMMM D, YYYY`,date_time_format:`MMMM D, YYYY h:mm:ss A`,time_format:`h:mm:ss A`}};function F(e){e.hasResourceBundle(`ko`,`libs`)||e.addResourceBundle(`ko`,`libs`,N,!0,!1),e.hasResourceBundle(`en`,`libs`)||e.addResourceBundle(`en`,`libs`,P,!0,!1)}var I={Info:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-sky-600), var(--color-sky-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`},Solid:{"--normal-bg":`light-dark(var(--color-sky-600), var(--color-sky-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-sky-600), var(--color-sky-400))`}},Success:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-green-600), var(--color-green-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`},Solid:{"--normal-bg":`light-dark(var(--color-green-600), var(--color-green-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-green-600), var(--color-green-400))`}},Warning:{Soft:{"--normal-bg":`color-mix(in oklab, light-dark(var(--color-amber-600), var(--color-amber-400)) 10%, var(--background))`,"--normal-text":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`},Solid:{"--normal-bg":`light-dark(var(--color-amber-600), var(--color-amber-400))`,"--normal-text":`var(--color-white)`,"--normal-border":`light-dark(var(--color-amber-600), var(--color-amber-400))`}},Destructive:{Soft:{"--normal-bg":`color-mix(in oklab, var(--destructive) 10%, var(--background))`,"--normal-text":`var(--destructive)`,"--normal-border":`var(--destructive)`},Outline:{"--normal-bg":`var(--background)`,"--normal-text":`var(--destructive)`,"--normal-border":`var(--destructive)`},Solid:{"--normal-bg":`light-dark(var(--destructive), color-mix(in oklab, var(--destructive) 60%, var(--background)))`,"--normal-text":`var(--color-white)`,"--normal-border":`transparent`}}};exports.CrossfadeImage=h,exports.SUPPORTED_LOCALES=g,exports.ToastCSS=I,exports.createZustandContext=w,exports.dateIdFormat=O,exports.deleteItem=A,exports.fetchItems=v,exports.fetchItemsByOne=y,exports.getAuthErrorKey=M,exports.getPlatformType=C,exports.getSnapshots=S,exports.initIenlabI18n=F,exports.snapshotToData=_,exports.time24Format=k,exports.undeleteItem=j,exports.useDateTimeFormatters=D;
@@ -1,79 +1,92 @@
1
- import { createContext as e, useContext as t, useEffect as n, useState as r } from "react";
2
- import { AnimatePresence as i, motion as a } from "motion/react";
3
- import { jsx as o } from "react/jsx-runtime";
4
- import { documentId as s, getDoc as c, getDocs as l, onSnapshot as u, query as d, serverTimestamp as f, where as p } from "firebase/firestore";
5
- import { useStore as m } from "zustand/react";
1
+ import { createContext as e, useContext as t, useEffect as n, useMemo as r, useState as i } from "react";
2
+ import { AnimatePresence as a, motion as o } from "motion/react";
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ import { documentId as c, getDoc as l, getDocs as u, onSnapshot as d, query as f, serverTimestamp as p, where as m } from "firebase/firestore";
5
+ import { useStore as h } from "zustand/react";
6
+ import { useTranslation as g } from "react-i18next";
7
+ //#region \0rolldown/runtime.js
8
+ var _ = Object.create, v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, x = Object.getPrototypeOf, S = Object.prototype.hasOwnProperty, C = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), w = (e, t, n, r) => {
9
+ if (t && typeof t == "object" || typeof t == "function") for (var i = b(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !S.call(e, s) && s !== n && v(e, s, {
10
+ get: ((e) => t[e]).bind(null, s),
11
+ enumerable: !(r = y(t, s)) || r.enumerable
12
+ });
13
+ return e;
14
+ }, T = (e, t, n) => (n = e == null ? {} : _(x(e)), w(t || !e || !e.__esModule ? v(n, "default", {
15
+ value: e,
16
+ enumerable: !0
17
+ }) : n, e));
18
+ //#endregion
6
19
  //#region src/components/image.tsx
7
- function h({ placeholder: e, src: t, onLoadError: s, ...c }) {
8
- let [l, u] = r(() => {
20
+ function E({ placeholder: e, src: t, onLoadError: r, ...c }) {
21
+ let [l, u] = i(() => {
9
22
  if (typeof window > "u" || !t) return !1;
10
23
  let e = new Image();
11
24
  return e.src = t, e.complete && e.naturalWidth > 0;
12
- }), [d, f] = r(t);
25
+ }), [d, f] = i(t);
13
26
  return d !== t && (f(t), u(!1)), n(() => {
14
27
  if (!t) return;
15
28
  let e = new Image();
16
29
  return e.src = t, e.onload = () => u(!0), e.onerror = (e) => {
17
- s ? s(e) : console.error("CrossfadeImage: Failed to load image", t);
30
+ r ? r(e) : console.error("CrossfadeImage: Failed to load image", t);
18
31
  }, e.complete && e.naturalWidth > 0 && e.onload(new Event("load")), () => {
19
32
  e.onload = null, e.onerror = null;
20
33
  };
21
- }, [t, s]), /* @__PURE__ */ o(i, { children: l && t ? /* @__PURE__ */ o(a.img, {
34
+ }, [t, r]), /* @__PURE__ */ s(a, { children: l && t ? /* @__PURE__ */ s(o.img, {
22
35
  src: t,
23
36
  ...c,
24
37
  initial: { opacity: 0 },
25
38
  animate: { opacity: 1 },
26
39
  exit: { opacity: 0 },
27
40
  style: { ...c.style }
28
- }, "loaded-image") : /* @__PURE__ */ o(a.div, {
41
+ }, "loaded-image") : /* @__PURE__ */ s(o.div, {
29
42
  initial: { opacity: 1 },
30
43
  transition: { duration: .3 },
31
44
  style: { ...c.style },
32
- children: e ?? /* @__PURE__ */ o("div", { className: "w-full h-full bg-sidebar" })
45
+ children: e ?? /* @__PURE__ */ s("div", { className: "w-full h-full bg-sidebar" })
33
46
  }, "placeholder") });
34
47
  }
35
48
  //#endregion
36
49
  //#region src/types/localized.ts
37
- var g = ["ko", "en"];
50
+ var D = ["ko", "en"];
38
51
  //#endregion
39
52
  //#region src/utils/firestore.ts
40
- function _(e) {
53
+ function O(e) {
41
54
  return {
42
55
  ...e.data(),
43
56
  id: e.id
44
57
  };
45
58
  }
46
- async function v(e, t, n, r) {
59
+ async function k(e, t, n, r) {
47
60
  let i = r.filter((e) => !!(e && !n.has(e.path)));
48
61
  for (let r = 0; r < i.length; r += 30) {
49
62
  let a = i.slice(r, r + 30);
50
- (await l(d(e, p(s(), "in", a.map((e) => e.id))))).forEach((e) => {
63
+ (await u(f(e, m(c(), "in", a.map((e) => e.id))))).forEach((e) => {
51
64
  let r = t(e);
52
65
  n.set(e.ref.path, r);
53
66
  });
54
67
  }
55
68
  }
56
- async function y(e, t, n) {
69
+ async function A(e, t, n) {
57
70
  let r = n.filter((e) => !!(e && !t.has(e.path)));
58
71
  await Promise.all(r.map(async (n) => {
59
- let r = e(await c(n));
72
+ let r = e(await l(n));
60
73
  t.set(n.path, r);
61
74
  }));
62
75
  }
63
- function b(e = {}) {
76
+ function j(e = {}) {
64
77
  let { cache: t = !0, includeMetadataChanges: n } = e;
65
78
  return {
66
79
  listenOptions: { includeMetadataChanges: n ?? !t },
67
80
  cache: t
68
81
  };
69
82
  }
70
- function x(e, t) {
83
+ function M(e, t) {
71
84
  return t !== !1 || !e;
72
85
  }
73
- function S(e, t, n = {}) {
74
- let { listenOptions: r, cache: i } = b(n), { onError: a } = n;
75
- return e.type, u(e, r, (e) => {
76
- x(e.metadata.fromCache, i) && t(e);
86
+ function N(e, t, n = {}) {
87
+ let { listenOptions: r, cache: i } = j(n), { onError: a } = n;
88
+ return e.type, d(e, r, (e) => {
89
+ M(e.metadata.fromCache, i) && t(e);
77
90
  }, a);
78
91
  }
79
92
  //#endregion
@@ -86,46 +99,361 @@ Array.prototype.mapNotNull = function(e) {
86
99
  };
87
100
  //#endregion
88
101
  //#region src/utils/platform.ts
89
- function C() {
102
+ function P() {
90
103
  if (typeof window > "u") return "pc";
91
104
  let e = navigator.userAgent, t = navigator.platform, n = /Android/i.test(e), r = /iPhone|iPad|iPod/i.test(e) || t === "MacIntel" && navigator.maxTouchPoints > 1;
92
105
  return n ? "android" : r ? "ios" : "pc";
93
106
  }
94
107
  //#endregion
95
108
  //#region src/utils/zustand.tsx
96
- function w(n) {
97
- let i = e(null);
109
+ function F(n) {
110
+ let r = e(null);
98
111
  function a({ children: e, ...t }) {
99
- let [a] = r(() => n(t));
100
- return /* @__PURE__ */ o(i.Provider, {
112
+ let [a] = i(() => n(t));
113
+ return /* @__PURE__ */ s(r.Provider, {
101
114
  value: a,
102
115
  children: e
103
116
  });
104
117
  }
105
- function s(e) {
106
- let n = t(i);
118
+ function o(e) {
119
+ let n = t(r);
107
120
  if (!n) throw Error("Provider가 필요합니다.");
108
- return m(n, e);
121
+ return h(n, e);
109
122
  }
110
123
  let c = /* @__PURE__ */ new Map();
111
124
  return {
112
125
  Provider: a,
113
- useStore: s,
114
- use: new Proxy({}, { get: (e, t) => (c.has(t) || c.set(t, () => s((e) => e[t])), c.get(t)) })
126
+ useStore: o,
127
+ use: new Proxy({}, { get: (e, t) => (c.has(t) || c.set(t, () => o((e) => e[t])), c.get(t)) })
115
128
  };
116
129
  }
117
130
  //#endregion
131
+ //#region src/utils/datetime.ts
132
+ var I = /* @__PURE__ */ T((/* @__PURE__ */ C(((e, t) => {
133
+ (function(n, r) {
134
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
135
+ })(e, (function() {
136
+ var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
137
+ name: "en",
138
+ weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
139
+ months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
140
+ ordinal: function(e) {
141
+ var t = [
142
+ "th",
143
+ "st",
144
+ "nd",
145
+ "rd"
146
+ ], n = e % 100;
147
+ return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
148
+ }
149
+ }, _ = function(e, t, n) {
150
+ var r = String(e);
151
+ return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
152
+ }, v = {
153
+ s: _,
154
+ z: function(e) {
155
+ var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
156
+ return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
157
+ },
158
+ m: function e(t, n) {
159
+ if (t.date() < n.date()) return -e(n, t);
160
+ var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
161
+ return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
162
+ },
163
+ a: function(e) {
164
+ return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
165
+ },
166
+ p: function(e) {
167
+ return {
168
+ M: l,
169
+ y: d,
170
+ w: c,
171
+ d: s,
172
+ D: f,
173
+ h: o,
174
+ m: a,
175
+ s: i,
176
+ ms: r,
177
+ Q: u
178
+ }[e] || String(e || "").toLowerCase().replace(/s$/, "");
179
+ },
180
+ u: function(e) {
181
+ return e === void 0;
182
+ }
183
+ }, y = "en", b = {};
184
+ b[y] = g;
185
+ var x = "$isDayjsObject", S = function(e) {
186
+ return e instanceof E || !(!e || !e[x]);
187
+ }, C = function e(t, n, r) {
188
+ var i;
189
+ if (!t) return y;
190
+ if (typeof t == "string") {
191
+ var a = t.toLowerCase();
192
+ b[a] && (i = a), n && (b[a] = n, i = a);
193
+ var o = t.split("-");
194
+ if (!i && o.length > 1) return e(o[0]);
195
+ } else {
196
+ var s = t.name;
197
+ b[s] = t, i = s;
198
+ }
199
+ return !r && i && (y = i), i || !r && y;
200
+ }, w = function(e, t) {
201
+ if (S(e)) return e.clone();
202
+ var n = typeof t == "object" ? t : {};
203
+ return n.date = e, n.args = arguments, new E(n);
204
+ }, T = v;
205
+ T.l = C, T.i = S, T.w = function(e, t) {
206
+ return w(e, {
207
+ locale: t.$L,
208
+ utc: t.$u,
209
+ x: t.$x,
210
+ $offset: t.$offset
211
+ });
212
+ };
213
+ var E = function() {
214
+ function g(e) {
215
+ this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
216
+ }
217
+ var _ = g.prototype;
218
+ return _.parse = function(e) {
219
+ this.$d = function(e) {
220
+ var t = e.date, n = e.utc;
221
+ if (t === null) return /* @__PURE__ */ new Date(NaN);
222
+ if (T.u(t)) return /* @__PURE__ */ new Date();
223
+ if (t instanceof Date) return new Date(t);
224
+ if (typeof t == "string" && !/Z$/i.test(t)) {
225
+ var r = t.match(m);
226
+ if (r) {
227
+ var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
228
+ return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
229
+ }
230
+ }
231
+ return new Date(t);
232
+ }(e), this.init();
233
+ }, _.init = function() {
234
+ var e = this.$d;
235
+ this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
236
+ }, _.$utils = function() {
237
+ return T;
238
+ }, _.isValid = function() {
239
+ return this.$d.toString() !== p;
240
+ }, _.isSame = function(e, t) {
241
+ var n = w(e);
242
+ return this.startOf(t) <= n && n <= this.endOf(t);
243
+ }, _.isAfter = function(e, t) {
244
+ return w(e) < this.startOf(t);
245
+ }, _.isBefore = function(e, t) {
246
+ return this.endOf(t) < w(e);
247
+ }, _.$g = function(e, t, n) {
248
+ return T.u(e) ? this[t] : this.set(n, e);
249
+ }, _.unix = function() {
250
+ return Math.floor(this.valueOf() / 1e3);
251
+ }, _.valueOf = function() {
252
+ return this.$d.getTime();
253
+ }, _.startOf = function(e, t) {
254
+ var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
255
+ var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
256
+ return r ? i : i.endOf(s);
257
+ }, m = function(e, t) {
258
+ return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
259
+ 0,
260
+ 0,
261
+ 0,
262
+ 0
263
+ ] : [
264
+ 23,
265
+ 59,
266
+ 59,
267
+ 999
268
+ ]).slice(t)), n);
269
+ }, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
270
+ switch (u) {
271
+ case d: return r ? p(1, 0) : p(31, 11);
272
+ case l: return r ? p(1, g) : p(0, g + 1);
273
+ case c:
274
+ var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
275
+ return p(r ? _ - b : _ + (6 - b), g);
276
+ case s:
277
+ case f: return m(v + "Hours", 0);
278
+ case o: return m(v + "Minutes", 1);
279
+ case a: return m(v + "Seconds", 2);
280
+ case i: return m(v + "Milliseconds", 3);
281
+ default: return this.clone();
282
+ }
283
+ }, _.endOf = function(e) {
284
+ return this.startOf(e, !1);
285
+ }, _.$set = function(e, t) {
286
+ var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
287
+ if (c === l || c === d) {
288
+ var h = this.clone().set(f, 1);
289
+ h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
290
+ } else p && this.$d[p](m);
291
+ return this.init(), this;
292
+ }, _.set = function(e, t) {
293
+ return this.clone().$set(e, t);
294
+ }, _.get = function(e) {
295
+ return this[T.p(e)]();
296
+ }, _.add = function(r, u) {
297
+ var f, p = this;
298
+ r = Number(r);
299
+ var m = T.p(u), h = function(e) {
300
+ var t = w(p);
301
+ return T.w(t.date(t.date() + Math.round(e * r)), p);
302
+ };
303
+ if (m === l) return this.set(l, this.$M + r);
304
+ if (m === d) return this.set(d, this.$y + r);
305
+ if (m === s) return h(1);
306
+ if (m === c) return h(7);
307
+ var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
308
+ return T.w(_, this);
309
+ }, _.subtract = function(e, t) {
310
+ return this.add(-1 * e, t);
311
+ }, _.format = function(e) {
312
+ var t = this, n = this.$locale();
313
+ if (!this.isValid()) return n.invalidDate || p;
314
+ var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
315
+ return e && (e[n] || e(t, r)) || i[n].slice(0, a);
316
+ }, f = function(e) {
317
+ return T.s(a % 12 || 12, e, "0");
318
+ }, m = u || function(e, t, n) {
319
+ var r = e < 12 ? "AM" : "PM";
320
+ return n ? r.toLowerCase() : r;
321
+ };
322
+ return r.replace(h, (function(e, r) {
323
+ return r || function(e) {
324
+ switch (e) {
325
+ case "YY": return String(t.$y).slice(-2);
326
+ case "YYYY": return T.s(t.$y, 4, "0");
327
+ case "M": return s + 1;
328
+ case "MM": return T.s(s + 1, 2, "0");
329
+ case "MMM": return d(n.monthsShort, s, l, 3);
330
+ case "MMMM": return d(l, s);
331
+ case "D": return t.$D;
332
+ case "DD": return T.s(t.$D, 2, "0");
333
+ case "d": return String(t.$W);
334
+ case "dd": return d(n.weekdaysMin, t.$W, c, 2);
335
+ case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
336
+ case "dddd": return c[t.$W];
337
+ case "H": return String(a);
338
+ case "HH": return T.s(a, 2, "0");
339
+ case "h": return f(1);
340
+ case "hh": return f(2);
341
+ case "a": return m(a, o, !0);
342
+ case "A": return m(a, o, !1);
343
+ case "m": return String(o);
344
+ case "mm": return T.s(o, 2, "0");
345
+ case "s": return String(t.$s);
346
+ case "ss": return T.s(t.$s, 2, "0");
347
+ case "SSS": return T.s(t.$ms, 3, "0");
348
+ case "Z": return i;
349
+ }
350
+ return null;
351
+ }(e) || i.replace(":", "");
352
+ }));
353
+ }, _.utcOffset = function() {
354
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
355
+ }, _.diff = function(r, f, p) {
356
+ var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
357
+ return T.m(h, _);
358
+ };
359
+ switch (g) {
360
+ case d:
361
+ m = b() / 12;
362
+ break;
363
+ case l:
364
+ m = b();
365
+ break;
366
+ case u:
367
+ m = b() / 3;
368
+ break;
369
+ case c:
370
+ m = (y - v) / 6048e5;
371
+ break;
372
+ case s:
373
+ m = (y - v) / 864e5;
374
+ break;
375
+ case o:
376
+ m = y / n;
377
+ break;
378
+ case a:
379
+ m = y / t;
380
+ break;
381
+ case i:
382
+ m = y / e;
383
+ break;
384
+ default: m = y;
385
+ }
386
+ return p ? m : T.a(m);
387
+ }, _.daysInMonth = function() {
388
+ return this.endOf(l).$D;
389
+ }, _.$locale = function() {
390
+ return b[this.$L];
391
+ }, _.locale = function(e, t) {
392
+ if (!e) return this.$L;
393
+ var n = this.clone(), r = C(e, t, !0);
394
+ return r && (n.$L = r), n;
395
+ }, _.clone = function() {
396
+ return T.w(this.$d, this);
397
+ }, _.toDate = function() {
398
+ return new Date(this.valueOf());
399
+ }, _.toJSON = function() {
400
+ return this.isValid() ? this.toISOString() : null;
401
+ }, _.toISOString = function() {
402
+ return this.$d.toISOString();
403
+ }, _.toString = function() {
404
+ return this.$d.toUTCString();
405
+ }, g;
406
+ }(), D = E.prototype;
407
+ return w.prototype = D, [
408
+ ["$ms", r],
409
+ ["$s", i],
410
+ ["$m", a],
411
+ ["$H", o],
412
+ ["$W", s],
413
+ ["$M", l],
414
+ ["$y", d],
415
+ ["$D", f]
416
+ ].forEach((function(e) {
417
+ D[e[1]] = function(t) {
418
+ return this.$g(t, e[0], e[1]);
419
+ };
420
+ })), w.extend = function(e, t) {
421
+ return e.$i ||= (e(t, E, w), !0), w;
422
+ }, w.locale = C, w.isDayjs = S, w.unix = function(e) {
423
+ return w(1e3 * e);
424
+ }, w.en = b[y], w.Ls = b, w.p = {}, w;
425
+ }));
426
+ })))(), 1);
427
+ function L(e, t, n) {
428
+ return !e || !(0, I.default)(e).isValid() ? "" : (0, I.default)(e).format(n(t));
429
+ }
430
+ function R() {
431
+ let { t: e } = g();
432
+ return r(() => ({
433
+ basicDateTimeFormat: (t, n) => L(t, n, e),
434
+ dateTimeFormat: (t) => L(t, "libs:datetime.date_time_format", e),
435
+ dateFormat: (t) => L(t, "libs:datetime.date_format", e),
436
+ timeFormat: (t) => L(t, "libs:datetime.time_format", e)
437
+ }), [e]);
438
+ }
439
+ function z(e) {
440
+ return (0, I.default)(e).format("YYYYMMDD");
441
+ }
442
+ function B(e) {
443
+ return (0, I.default)(e).format("HH:mm");
444
+ }
445
+ //#endregion
118
446
  //#region src/constant/firestore.ts
119
- var T = () => ({
120
- updateAt: f(),
447
+ var V = () => ({
448
+ updateAt: p(),
121
449
  delete: !0
122
- }), E = () => ({
123
- updateAt: f(),
450
+ }), H = () => ({
451
+ updateAt: p(),
124
452
  delete: !1
125
453
  });
126
454
  //#endregion
127
455
  //#region src/constant/auth.ts
128
- function D(e) {
456
+ function U(e) {
129
457
  switch (e) {
130
458
  case "auth/user-not-found": return "libs:auth.errors.user_not_found";
131
459
  case "auth/wrong-password": return "libs:auth.errors.wrong_password";
@@ -147,7 +475,7 @@ function D(e) {
147
475
  default: return "libs:auth.errors.default";
148
476
  }
149
477
  }
150
- var O = {
478
+ var W = {
151
479
  auth: { errors: {
152
480
  invalid_credential: "이메일 또는 비밀번호를 다시 확인해 주세요.",
153
481
  wrong_password: "이메일 또는 비밀번호를 다시 확인해 주세요.",
@@ -170,8 +498,13 @@ var O = {
170
498
  internal_error: "문제가 발생했어요. 잠시 후 다시 시도해 주세요.",
171
499
  default: "로그인 중 문제가 발생했어요. 잠시 후 다시 시도해 주세요."
172
500
  } },
173
- unknown_error_occurred: "알 수 없는 오류가 발생했습니다."
174
- }, k = {
501
+ unknown_error_occurred: "알 수 없는 오류가 발생했습니다.",
502
+ datetime: {
503
+ date_format: "YYYY년 M월 D일",
504
+ date_time_format: "YYYY년 M월 D일 a h:mm:ss",
505
+ time_format: "a h:mm:ss"
506
+ }
507
+ }, G = {
175
508
  auth: { errors: {
176
509
  invalid_credential: "Please check your email or password.",
177
510
  wrong_password: "Please check your email or password.",
@@ -194,16 +527,21 @@ var O = {
194
527
  internal_error: "Something went wrong. Please try again later.",
195
528
  default: "We couldn’t complete the sign-in. Please try again later."
196
529
  } },
197
- unknown_error_occurred: "Unknown error occurred."
530
+ unknown_error_occurred: "Unknown error occurred.",
531
+ datetime: {
532
+ date_format: "MMMM D, YYYY",
533
+ date_time_format: "MMMM D, YYYY h:mm:ss A",
534
+ time_format: "h:mm:ss A"
535
+ }
198
536
  };
199
537
  //#endregion
200
538
  //#region src/locales/i18n.ts
201
- function A(e) {
202
- e.hasResourceBundle("ko", "libs") || e.addResourceBundle("ko", "libs", O, !0, !1), e.hasResourceBundle("en", "libs") || e.addResourceBundle("en", "libs", k, !0, !1);
539
+ function K(e) {
540
+ e.hasResourceBundle("ko", "libs") || e.addResourceBundle("ko", "libs", W, !0, !1), e.hasResourceBundle("en", "libs") || e.addResourceBundle("en", "libs", G, !0, !1);
203
541
  }
204
542
  //#endregion
205
543
  //#region src/css/toast.ts
206
- var j = {
544
+ var q = {
207
545
  Info: {
208
546
  Soft: {
209
547
  "--normal-bg": "color-mix(in oklab, light-dark(var(--color-sky-600), var(--color-sky-400)) 10%, var(--background))",
@@ -274,4 +612,4 @@ var j = {
274
612
  }
275
613
  };
276
614
  //#endregion
277
- export { h as CrossfadeImage, g as SUPPORTED_LOCALES, j as ToastCSS, w as createZustandContext, T as deleteItem, v as fetchItems, y as fetchItemsByOne, D as getAuthErrorKey, C as getPlatformType, S as getSnapshots, A as initIenlabI18n, _ as snapshotToData, E as undeleteItem };
615
+ export { E as CrossfadeImage, D as SUPPORTED_LOCALES, q as ToastCSS, F as createZustandContext, z as dateIdFormat, V as deleteItem, k as fetchItems, A as fetchItemsByOne, U as getAuthErrorKey, P as getPlatformType, N as getSnapshots, K as initIenlabI18n, O as snapshotToData, B as time24Format, H as undeleteItem, R as useDateTimeFormatters };
@@ -0,0 +1,9 @@
1
+ export declare function useDateTimeFormatters(): {
2
+ basicDateTimeFormat: (date: Date, formatKey: string) => string;
3
+ dateTimeFormat: (date: Date) => string;
4
+ dateFormat: (date: Date) => string;
5
+ timeFormat: (date: Date) => string;
6
+ };
7
+ export declare function dateIdFormat(date: Date): string;
8
+ export declare function time24Format(date: Date): string;
9
+ //# sourceMappingURL=datetime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../src/utils/datetime.ts"],"names":[],"mappings":"AAaA,wBAAgB,qBAAqB;gCAIL,IAAI,aAAa,MAAM;2BAC5B,IAAI;uBACR,IAAI;uBACJ,IAAI;EAE1B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE/C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE/C"}
@@ -2,4 +2,5 @@ export * from './firestore';
2
2
  export * from './array';
3
3
  export * from './platform';
4
4
  export * from './zustand';
5
+ export * from './datetime';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ienlab/react-library",
3
- "version": "0.11.0-dev01",
3
+ "version": "0.12.0",
4
4
  "description": "My React component library",
5
5
  "main": "./dist/my-library.cjs.js",
6
6
  "module": "./dist/my-library.es.js",
@@ -31,7 +31,8 @@
31
31
  "zustand": ">=5.0.0",
32
32
  "motion": ">=12.0.0",
33
33
  "@tanstack/react-table": ">=8.21.3",
34
- "react-i18next": ">=16.0.0"
34
+ "react-i18next": ">=16.0.0",
35
+ "dayjs": "^1.11.0"
35
36
  },
36
37
  "devDependencies": {
37
38
  "react": "^19.2.5",
@@ -54,6 +55,7 @@
54
55
  "vite": "^8.0.9",
55
56
  "vite-plugin-dts": "^4.5.4",
56
57
  "@tanstack/react-table": "^8.21.3",
57
- "react-i18next": "^16.0.0"
58
+ "react-i18next": "^16.0.0",
59
+ "dayjs": "^1.11.0"
58
60
  }
59
61
  }