sales-frontend-debug 0.0.61 → 0.0.63

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.
package/dist/index.d.cts CHANGED
@@ -48,9 +48,18 @@ declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unkn
48
48
  declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
49
49
  declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
50
50
 
51
+ type DebugFilterKey = 'downloader' | 'console-log' | 'auth-token' | 'validation-off' | 'http-log';
52
+
53
+ /**
54
+ * @deprecated isDebugByFilterName('validation-off') 를 사용하세요. 해당 함수는 삭제 예정
55
+ * @returns boolean
56
+ */
51
57
  declare function isDebugStepValidationOff(): boolean;
52
- declare function isDebugMode(): boolean;
53
- declare function getDebugFileConvertType(): string;
54
- declare function isDebugByFilterName(name: string): boolean;
58
+ /**
59
+ * @description 원하는 기능에 따라 쿠키를 확인하여 true/false를 리턴한다.
60
+ * @param name DebugFilterKey
61
+ * @returns boolean
62
+ */
63
+ declare function isDebugByFilterName(name: DebugFilterKey): boolean;
55
64
 
56
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
65
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
package/dist/index.d.ts CHANGED
@@ -48,9 +48,18 @@ declare function addRequestLog(config: InternalAxiosRequestConfig): Promise<unkn
48
48
  declare function addResponseLog(response: AxiosResponse): Promise<unknown> | undefined;
49
49
  declare function addErrorLog(error: AxiosError): Promise<unknown> | undefined;
50
50
 
51
+ type DebugFilterKey = 'downloader' | 'console-log' | 'auth-token' | 'validation-off' | 'http-log';
52
+
53
+ /**
54
+ * @deprecated isDebugByFilterName('validation-off') 를 사용하세요. 해당 함수는 삭제 예정
55
+ * @returns boolean
56
+ */
51
57
  declare function isDebugStepValidationOff(): boolean;
52
- declare function isDebugMode(): boolean;
53
- declare function getDebugFileConvertType(): string;
54
- declare function isDebugByFilterName(name: string): boolean;
58
+ /**
59
+ * @description 원하는 기능에 따라 쿠키를 확인하여 true/false를 리턴한다.
60
+ * @param name DebugFilterKey
61
+ * @returns boolean
62
+ */
63
+ declare function isDebugByFilterName(name: DebugFilterKey): boolean;
55
64
 
56
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
65
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React9, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
2
- import { getCookie, setCookie, deleteCookie } from 'sales-frontend-utils/cookie';
3
- import { isClient, getEnvironmentFromHostname } from 'sales-frontend-utils';
2
+ import { getCookie, setCookie, deleteCookie as deleteCookie$1 } from 'sales-frontend-utils/cookie';
3
+ import { isClient, getEnvironmentFromHostname, deleteCookie } from 'sales-frontend-utils';
4
4
  import { useDebugStore } from 'sales-frontend-stores';
5
5
 
6
6
  // src/debug-tool.tsx
@@ -361,30 +361,68 @@ function ChangeHost() {
361
361
  };
362
362
  return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "API\uD638\uC2A4\uD2B8")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("local") }, "local"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("dev") }, "dev"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleHost("stg") }, "stg")));
363
363
  }
364
- var fileConvertTypeCookieKey = "dsp-debug-mode-file-convert-type";
365
- function FileConvert() {
366
- const handleFileConvertType = (host) => {
367
- setCookie(fileConvertTypeCookieKey, host);
368
- alert(`file convert type \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.:${host}`);
369
- console.log("file convert type \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
370
- [fileConvertTypeCookieKey]: getCookie(fileConvertTypeCookieKey)
371
- });
372
- };
373
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "File Convert Type")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("fetch") }, "fetch"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("canvas") }, "canvas"), /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, onClick: () => handleFileConvertType("xhr") }, "xhr")));
374
- }
375
364
  var filterNameCookieKey = "dsp-debug-mode-filter-name";
365
+ var filterList = [
366
+ {
367
+ key: "downloader",
368
+ description: "\uB2E4\uC6B4\uB85C\uB354 \uD6C5 \uBD84\uAE30 \uD655\uC778\uC6A9"
369
+ },
370
+ {
371
+ key: "console-log",
372
+ description: "\uCF58\uC194\uB85C\uADF8 on/off"
373
+ },
374
+ {
375
+ key: "auth-token",
376
+ description: "\uCFE0\uD0A4\uC5D0\uC11C \uD1A0\uD070\uD68D\uB4DD"
377
+ },
378
+ {
379
+ key: "validation-off",
380
+ description: "\uC720\uD6A8\uC131\uAC80\uC0AC off"
381
+ },
382
+ {
383
+ key: "http-log",
384
+ description: "http \uC694\uCCAD/\uC751\uB2F5 \uB85C\uADF8 on/off"
385
+ }
386
+ ];
376
387
  function Filter() {
377
388
  const [filterName, setFilterName] = React9.useState("");
378
- const handleFilterNameChange = (e) => {
379
- const filterName2 = e.target.value;
380
- setCookie(filterNameCookieKey, filterName2);
381
- setFilterName(filterName2);
382
- };
383
389
  useEffect(() => {
384
390
  const filterName2 = getCookie(filterNameCookieKey);
385
391
  setFilterName(filterName2);
386
392
  }, []);
387
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Filter ex: filter1,filter2")), /* @__PURE__ */ React9.createElement("ul", null, /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle }, "filter-name:", /* @__PURE__ */ React9.createElement("input", { type: "text", onChange: handleFilterNameChange, value: filterName }))));
393
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uB514\uBC84\uAE45 \uC635\uC158")), /* @__PURE__ */ React9.createElement("ul", null, filterList.map((filter) => /* @__PURE__ */ React9.createElement("li", { style: menuItemStyle, key: filter.key }, /* @__PURE__ */ React9.createElement(
394
+ "input",
395
+ {
396
+ type: "checkbox",
397
+ checked: filterName.includes(filter.key),
398
+ onChange: (e) => {
399
+ if (e.target.checked) {
400
+ setFilterName((prev) => {
401
+ if (prev) {
402
+ const newFilterName = `${prev},${filter.key}`;
403
+ setCookie(filterNameCookieKey, newFilterName);
404
+ return newFilterName;
405
+ } else {
406
+ setCookie(filterNameCookieKey, filter.key);
407
+ return filter.key;
408
+ }
409
+ });
410
+ } else {
411
+ setFilterName((prev) => {
412
+ if (prev.includes(",")) {
413
+ const arr = prev.split(",");
414
+ const newFilterName = arr.filter((item) => item !== filter.key).join(",");
415
+ setCookie(filterNameCookieKey, newFilterName);
416
+ return newFilterName;
417
+ } else {
418
+ deleteCookie$1(filterNameCookieKey);
419
+ return "";
420
+ }
421
+ });
422
+ }
423
+ }
424
+ }
425
+ ), filter.key))));
388
426
  }
389
427
  function FormFactor() {
390
428
  const handleFormFactor = (formFactor) => {
@@ -398,30 +436,30 @@ function FormFactor() {
398
436
  }
399
437
  function InitRefresh() {
400
438
  const handleDeleteHostCookie = () => {
401
- deleteCookie("dsp-debug-mode-env");
439
+ deleteCookie$1("dsp-debug-mode-env");
402
440
  alert("\uD638\uC2A4\uD2B8\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
403
441
  console.log("\uD638\uC2A4\uD2B8\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
404
442
  "dsp-debug-mode-env": getCookie("dsp-debug-mode-env")
405
443
  });
406
444
  };
407
445
  const handleDeleteTokenCookie = () => {
408
- deleteCookie("accessToken");
446
+ deleteCookie$1("accessToken");
409
447
  alert("\uD1A0\uD070\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
410
448
  console.log("\uD1A0\uD070\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
411
449
  accessToken: getCookie("accessToken")
412
450
  });
413
451
  };
414
452
  const handleDeleteCustomCookie = () => {
415
- deleteCookie("x-channel-appversion");
416
- deleteCookie("x-channel-deviceid");
417
- deleteCookie("x-channel-devicemodel");
418
- deleteCookie("x-channel-formfactor");
419
- deleteCookie("x-channel-loginchannel");
420
- deleteCookie("x-channel-logintype");
421
- deleteCookie("x-channel-platformname");
422
- deleteCookie("x-channel-platformversion");
423
- deleteCookie("x-channel-screenid");
424
- deleteCookie("x-channel-business-work-division-code");
453
+ deleteCookie$1("x-channel-appversion");
454
+ deleteCookie$1("x-channel-deviceid");
455
+ deleteCookie$1("x-channel-devicemodel");
456
+ deleteCookie$1("x-channel-formfactor");
457
+ deleteCookie$1("x-channel-loginchannel");
458
+ deleteCookie$1("x-channel-logintype");
459
+ deleteCookie$1("x-channel-platformname");
460
+ deleteCookie$1("x-channel-platformversion");
461
+ deleteCookie$1("x-channel-screenid");
462
+ deleteCookie$1("x-channel-business-work-division-code");
425
463
  alert("\uCEE4\uC2A4\uD140\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
426
464
  console.log("\uCEE4\uC2A4\uD140\uCFE0\uD0A4\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", {
427
465
  "x-channel-appversion": getCookie("x-channel-appversion"),
@@ -449,13 +487,23 @@ function InitRefresh() {
449
487
 
450
488
  // src/components/menu-panel.tsx
451
489
  var MenuPanel = ({ menuItems: menuItems2, onMenuItemClick, onClose, serviceCode }) => {
452
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugMenuPanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Debug Menu"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("ul", null, menuItems2.map((item) => /* @__PURE__ */ React9.createElement("li", { key: item.id, onClick: () => onMenuItemClick(item.component), style: menuItemStyle }, item.label))), serviceCode === "dsp" && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(FormFactor, null), /* @__PURE__ */ React9.createElement(ChangeHost, null), /* @__PURE__ */ React9.createElement(InitRefresh, null), /* @__PURE__ */ React9.createElement(FileConvert, null), /* @__PURE__ */ React9.createElement(Filter, null))));
490
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugMenuPanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "Debug Menu"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("ul", null, menuItems2.map((item) => /* @__PURE__ */ React9.createElement("li", { key: item.id, onClick: () => onMenuItemClick(item.component), style: menuItemStyle }, item.label))), serviceCode === "dsp" && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Filter, null), /* @__PURE__ */ React9.createElement(FormFactor, null), /* @__PURE__ */ React9.createElement(ChangeHost, null), /* @__PURE__ */ React9.createElement(InitRefresh, null))));
453
491
  };
454
492
  var menu_panel_default = MenuPanel;
493
+ function isDebugStepValidationOff() {
494
+ return isDebugByFilterName("validation-off");
495
+ }
496
+ function isDebugByFilterName(name) {
497
+ const filterNames = getCookie(filterNameCookieKey)?.split(",");
498
+ return filterNames?.includes(name) || false;
499
+ }
500
+
501
+ // src/features/console-log/use-console-log.ts
455
502
  var globalLogs = [];
456
503
  var listeners = [];
457
504
  var originalConsoleMethods = {};
458
505
  var isConsoleOverridden = false;
506
+ var MAX_LOGS = 10;
459
507
  var addLog = (type, ...args) => {
460
508
  const newLog = {
461
509
  id: Date.now() + Math.random(),
@@ -463,6 +511,11 @@ var addLog = (type, ...args) => {
463
511
  timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
464
512
  message: args
465
513
  };
514
+ if (globalLogs.length >= MAX_LOGS) {
515
+ if (!isDebugByFilterName("console-log")) {
516
+ globalLogs.shift();
517
+ }
518
+ }
466
519
  globalLogs = [...globalLogs, newLog];
467
520
  listeners.forEach((listener) => listener([...globalLogs]));
468
521
  };
@@ -549,10 +602,6 @@ var console_log_panel_default = ConsoleLogPanel;
549
602
  var LoginPanel = ({ onClose, onLogin }) => {
550
603
  const [selectedTypeId, setSelectedTypeId] = useState(loginTypes[0]?.id || "");
551
604
  const [formData, setFormData] = useState({});
552
- const [mode, setMode] = useState(getCookie("dsp-debug-mode") === "on");
553
- const [stepValidationOff, SetStepValidationOff] = useState(
554
- getCookie("Debug-Step-Validation-Off") === "true"
555
- );
556
605
  const selectedType = useMemo(() => loginTypes.find((t) => t.id === selectedTypeId), [selectedTypeId]);
557
606
  const handleInputChange = (e) => {
558
607
  const { name, value } = e.target;
@@ -561,74 +610,15 @@ var LoginPanel = ({ onClose, onLogin }) => {
561
610
  const handleSubmit = (e) => {
562
611
  e.preventDefault();
563
612
  if (selectedType) {
613
+ deleteCookie("accessToken");
564
614
  onLogin(selectedType.id, formData);
565
615
  onClose();
566
616
  }
567
617
  };
568
- const handleDebugOn = (e) => {
569
- const checkbox = e.target;
570
- if (checkbox.checked) {
571
- setCookie("dsp-debug-mode", "on", { path: "/" });
572
- setMode(true);
573
- } else {
574
- setCookie("dsp-debug-mode", "off", { path: "/" });
575
- setMode(false);
576
- }
577
- };
578
- const handleStepValidationOff = (e) => {
579
- const checkbox = e.target;
580
- if (checkbox.checked) {
581
- setCookie("Debug-Step-Validation-Off", "true", { path: "/" });
582
- SetStepValidationOff(true);
583
- } else {
584
- setCookie("Debug-Step-Validation-Off", "false", { path: "/" });
585
- SetStepValidationOff(false);
586
- }
587
- };
588
- const handleTermsPathPolyNo = (e) => {
589
- const val = e.target.value.trim();
590
- if (!val) {
591
- deleteCookie("Debug-Terms-PolyNo");
592
- } else {
593
- setCookie("Debug-Terms-PolyNo", val, { path: "/" });
594
- }
595
- };
596
- const handleTermsPathSaleDate = (e) => {
597
- const val = e.target.value.trim();
598
- if (!val) {
599
- deleteCookie("Debug-Terms-SaleDate");
600
- } else {
601
- setCookie("Debug-Terms-SaleDate", val, { path: "/" });
602
- }
603
- };
604
618
  useEffect(() => {
605
619
  setFormData({});
606
620
  }, [selectedType]);
607
- return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugFeaturePanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uAC04\uD3B8 \uB85C\uADF8\uC778"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("form", { style: loginFormContainerStyle, onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "circle" } }, /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "debug-on" }, "Debug On"), /* @__PURE__ */ React9.createElement("input", { type: "checkbox", id: "debug-on", onChange: handleDebugOn, checked: mode }), /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "square", paddingLeft: "20px" } }, /* @__PURE__ */ React9.createElement("li", null, "(\uCFE0\uD0A4\uC5D0 \uC14B\uD305\uB41C \uD1A0\uD070\uAC12\uC73C\uB85C \uD5E4\uB354\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4. \uAC04\uD3B8\uB85C\uADF8\uC778 \uC0AC\uC6A9\uC2DC \uD544\uC218\uCCB4\uD06C)"))), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "step-validation-off" }, "\uC11C\uC2DD Validation Off"), /* @__PURE__ */ React9.createElement(
608
- "input",
609
- {
610
- type: "checkbox",
611
- id: "step-validation-off",
612
- onChange: handleStepValidationOff,
613
- checked: stepValidationOff
614
- }
615
- ), /* @__PURE__ */ React9.createElement("ul", { style: { listStyleType: "square", paddingLeft: "20px" } }, /* @__PURE__ */ React9.createElement("li", null, "(\uC11C\uC2DD \uB2E8\uACC4 \uC774\uB3D9\uC2DC, validation\uC744 \uB044\uACE0 \uBBF8\uC791\uC131 \uB2E8\uACC4\uB3C4 \uC774\uB3D9\uAC00\uB2A5\uD558\uB3C4\uB85D \uD569\uB2C8\uB2E4.)"))), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "terms-path-poly-no" }, "\uC57D\uAD00 polyNo"), /* @__PURE__ */ React9.createElement(
616
- "input",
617
- {
618
- type: "text",
619
- id: "terms-path-poly-no",
620
- onChange: handleTermsPathPolyNo,
621
- placeholder: "polyNo,saleDate\uB458\uB2E4\uC785\uB825"
622
- }
623
- )), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "terms-path-sale-date" }, "\uC57D\uAD00 saleDate"), /* @__PURE__ */ React9.createElement(
624
- "input",
625
- {
626
- type: "text",
627
- id: "terms-path-sale-date",
628
- onChange: handleTermsPathSaleDate,
629
- placeholder: "polyNo,saleDate\uB458\uB2E4\uC785\uB825"
630
- }
631
- ), /* @__PURE__ */ React9.createElement("br", null), /* @__PURE__ */ React9.createElement("strong", null, "\uC57D\uAD00\uD655\uC778\uD6C4 \uD574\uB2F9\uCFE0\uD0A4 \uBC18\uB4DC\uC2DC \uC0AD\uC81C"))), /* @__PURE__ */ React9.createElement("br", null), " ", /* @__PURE__ */ React9.createElement("br", null), /* @__PURE__ */ React9.createElement("label", { htmlFor: "login-type-select" }, "\uB85C\uADF8\uC778 \uC720\uD615"), /* @__PURE__ */ React9.createElement("select", { id: "login-type-select", value: selectedTypeId, onChange: (e) => setSelectedTypeId(e.target.value) }, loginTypes.map((type) => /* @__PURE__ */ React9.createElement("option", { key: type.id, value: type.id }, type.label)))), selectedType?.fields.map((field) => /* @__PURE__ */ React9.createElement("div", { key: field.name }, /* @__PURE__ */ React9.createElement("label", { htmlFor: field.name }, field.label), /* @__PURE__ */ React9.createElement(
621
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("div", { style: modalOverlayStyle, onClick: onClose }), /* @__PURE__ */ React9.createElement("div", { style: debugFeaturePanelStyle }, /* @__PURE__ */ React9.createElement("div", { style: panelHeaderStyle }, /* @__PURE__ */ React9.createElement("h2", { style: h2Style }, "\uAC04\uD3B8 \uB85C\uADF8\uC778"), /* @__PURE__ */ React9.createElement("button", { onClick: onClose }, "X")), /* @__PURE__ */ React9.createElement("form", { style: loginFormContainerStyle, onSubmit: handleSubmit }, /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("label", { htmlFor: "login-type-select" }, "\uB85C\uADF8\uC778 \uC720\uD615"), /* @__PURE__ */ React9.createElement("select", { id: "login-type-select", value: selectedTypeId, onChange: (e) => setSelectedTypeId(e.target.value) }, loginTypes.map((type) => /* @__PURE__ */ React9.createElement("option", { key: type.id, value: type.id }, type.label)))), selectedType?.fields.map((field) => /* @__PURE__ */ React9.createElement("div", { key: field.name }, /* @__PURE__ */ React9.createElement("label", { htmlFor: field.name }, field.label), /* @__PURE__ */ React9.createElement(
632
622
  "input",
633
623
  {
634
624
  type: field.type,
@@ -904,7 +894,7 @@ var useStorage = (storageType) => {
904
894
  if (storageType === "localStorage") {
905
895
  localStorage.removeItem(key);
906
896
  } else {
907
- deleteCookie(key);
897
+ deleteCookie$1(key);
908
898
  }
909
899
  loadItems();
910
900
  },
@@ -967,17 +957,6 @@ var loginTypes = [
967
957
  id: "fp",
968
958
  label: "FP \uB85C\uADF8\uC778",
969
959
  fields: [{ name: "employeeId", label: "\uC0AC\uBC88", type: "text", placeholder: "\uC0AC\uBC88\uC744 \uC785\uB825\uD558\uC138\uC694" }]
970
- },
971
- {
972
- id: "customer",
973
- label: "\uACE0\uAC1D \uB85C\uADF8\uC778",
974
- fields: [
975
- { name: "name", label: "\uC774\uB984", type: "text", placeholder: "\uC774\uB984" },
976
- { name: "phone", label: "\uC804\uD654\uBC88\uD638", type: "tel", placeholder: "\uC804\uD654\uBC88\uD638" },
977
- { name: "residentNumber", label: "\uC8FC\uBBFC\uBC88\uD638", type: "text", placeholder: "\uC8FC\uBBFC\uBC88\uD638 \uC55E 7\uC790\uB9AC" },
978
- { name: "userId", label: "\uC544\uC774\uB514", type: "text", placeholder: "\uC544\uC774\uB514" },
979
- { name: "password", label: "\uBE44\uBC00\uBC88\uD638", type: "password", placeholder: "\uBE44\uBC00\uBC88\uD638" }
980
- ]
981
960
  }
982
961
  ];
983
962
  var menuItems = [
@@ -1103,13 +1082,19 @@ var DebugTool = ({
1103
1082
  )
1104
1083
  );
1105
1084
  };
1085
+ var MAX_LOGS2 = 20;
1106
1086
  function addRequestLog(config) {
1107
1087
  if (!isClient()) {
1108
1088
  return;
1109
1089
  }
1110
1090
  const env = getEnvironmentFromHostname(location.hostname);
1111
1091
  if (env !== "prd") {
1112
- const { addRequest, isHold, holdRequest } = useDebugStore.getState();
1092
+ const { addRequest, isHold, holdRequest, requests } = useDebugStore.getState();
1093
+ if (requests.length >= MAX_LOGS2) {
1094
+ if (!isDebugByFilterName("http-log")) {
1095
+ requests.shift();
1096
+ }
1097
+ }
1113
1098
  const startTime = Date.now();
1114
1099
  const requestInfo = {
1115
1100
  url: config.url || "",
@@ -1134,7 +1119,12 @@ function addResponseLog(response) {
1134
1119
  }
1135
1120
  const env = getEnvironmentFromHostname(location.hostname);
1136
1121
  if (env !== "prd") {
1137
- const { addResponse, isHold, holdResponse } = useDebugStore.getState();
1122
+ const { addResponse, isHold, holdResponse, responses } = useDebugStore.getState();
1123
+ if (responses.length >= MAX_LOGS2) {
1124
+ if (!isDebugByFilterName("http-log")) {
1125
+ responses.shift();
1126
+ }
1127
+ }
1138
1128
  const { config } = response;
1139
1129
  const responseInfo = {
1140
1130
  url: config.url || "",
@@ -1154,9 +1144,17 @@ function addResponseLog(response) {
1154
1144
  }
1155
1145
  }
1156
1146
  function addErrorLog(error) {
1147
+ if (!isClient()) {
1148
+ return;
1149
+ }
1157
1150
  const env = getEnvironmentFromHostname(location.hostname);
1158
1151
  if (env !== "prd") {
1159
- const { addError, isHold, holdError } = useDebugStore.getState();
1152
+ const { addError, isHold, holdError, errors } = useDebugStore.getState();
1153
+ if (errors.length >= MAX_LOGS2) {
1154
+ if (!isDebugByFilterName("http-log")) {
1155
+ errors.shift();
1156
+ }
1157
+ }
1160
1158
  const { config } = error;
1161
1159
  const errorInfo = {
1162
1160
  url: config?.url || "",
@@ -1181,23 +1179,7 @@ function addErrorLog(error) {
1181
1179
  }
1182
1180
  }
1183
1181
  }
1184
- function isDebugStepValidationOff() {
1185
- const debugStepValidationOff = getCookie("Debug-Step-Validation-Off") === "true";
1186
- return debugStepValidationOff;
1187
- }
1188
- function isDebugMode() {
1189
- const debugMode = getCookie("dsp-debug-mode") === "on";
1190
- return debugMode;
1191
- }
1192
- function getDebugFileConvertType() {
1193
- const fileConvertType = getCookie(fileConvertTypeCookieKey);
1194
- return fileConvertType;
1195
- }
1196
- function isDebugByFilterName(name) {
1197
- const filterNames = getCookie(filterNameCookieKey)?.split(",");
1198
- return filterNames?.includes(name) || false;
1199
- }
1200
1182
 
1201
- export { DebugTool, addErrorLog, addRequestLog, addResponseLog, getDebugFileConvertType, isDebugByFilterName, isDebugMode, isDebugStepValidationOff };
1183
+ export { DebugTool, addErrorLog, addRequestLog, addResponseLog, isDebugByFilterName, isDebugStepValidationOff };
1202
1184
  //# sourceMappingURL=index.js.map
1203
1185
  //# sourceMappingURL=index.js.map