PageSourceSearch

https://www.hanbit.co.kr/_next/static/chunks/7975-d4c572cbe7096e67.js

js hanbit.co.kr collected 2026-10-02 03:53:18 UTC 16,072 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ceb7d253-8ec5-4388-8c15-902a11af2894",e._sentryDebugIdIdentifier="sentry-dbid-ceb7d253-8ec5-4388-8c15-902a11af2894")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7975],{3851:(e,t,r)=>{r.d(t,{qo:()=>u,zF:()=>i});var n=r(54505);let o=/[^a-z0-9가-힣-]+/g,s=/-+/g,l=/^-+|-+$/g,a=/^\.+$/,c=/[\s%]/;function u(e,t){let r=null==e?void 0:e.trim();return r&&!a.test(r)?r:t?(0,n.D4)(t).toLowerCase().trim().replace(o,"-").replace(s,"-").replace(l,""):""}function i(e){try{let t=decodeURI(e);return c.test(t)?e:t}catch(t){return e}}},3865:(e,t,r)=>{r.d(t,{L:()=>a});var n=r(95155),o=r(40980),s=r(12115);let l={small:{container:"h-10 p-2 gap-2",text:"text-body1_normal",borderRadius:"rounded-xl"},medium:{container:"h-12 p-3 gap-2",text:"text-body1_normal",borderRadius:"rounded-xl"},gnb:{container:"h-12 hanbit_sm:h-8 p-3 gap-2",text:"text-body1_normal",borderRadius:"rounded-xl hanbit_sm:rounded-full"}},a=(0,s.forwardRef)((e,t)=>{let{size:r="medium",active:s=!1,text:a,leftIcon:c,rightIcon:u,className:i,inputClassName:d,...p}=e,f=l[r];return(0,n.jsxs)("div",{className:(0,o.cn)("flex flex-row items-center w-full","bg-fill-normal backdrop-blur-[32px]",f.borderRadius,f.container,i),children:[c,(0,n.jsx)("input",{ref:t,type:"text",value:a,placeholder:"나에게 필요한 지식과 기술을 검색해 보세요.",className:(0,o.cn)("flex-1 min-w-0 bg-transparent border-none outline-none","font-pretendard",f.text,"placeholder:text-label-assistive",!s&&"text-label-assistive",d),...p}),u&&(0,n.jsx)("span",{className:"flex-shrink-0",children:u})]})});a.displayName="SearchField"},6904:(e,t,r)=>{r.d(t,{BM:()=>m,DX:()=>f,Fr:()=>v,Ij:()=>b,Qj:()=>w,S:()=>y,U3:()=>l,VL:()=>g,Xf:()=>h,_Q:()=>C,aU:()=>x,dn:()=>p,es:()=>s,gj:()=>a,i:()=>u,mm:()=>d,p6:()=>E,rj:()=>i,yQ:()=>c});var n=r(95268),o=r(3851);function s(e){return e===n.Vo.SEMINAR}function l(e){return e===n.Vo.COURSE||e===n.Vo.VOD}function a(e){return e===n.Vo.SEMINAR||e===n.Vo.VOD}function c(e){return e===n.Vo.COURSE||e===n.Vo.VOD||e===n.Vo.SEMINAR||e===n.Vo.PACKAGE||e===n.Vo.COHORT}function u(e){return e===n.Vo.BOOK||e===n.Vo.EBOOK||e===n.Vo.AGENCY_EBOOK||e===n.Vo.DIGITAL_TEXTBOOK}function i(e){return e===n.Vo.EBOOK||e===n.Vo.AGENCY_EBOOK}function d(e){return"br05"===e}function p(e){return e===n.Vo.PACKAGE}function f(e){return e===n.Vo.DIGITAL_TEXTBOOK}function h(e){return e===n.Vo.BOOK}function m(e){return e===n.Vo.EBOOK}function b(e){return e===n.Vo.AGENCY_EBOOK}function x(e){return h(e)||m(e)}function v(e){return e.filter(e=>"pr01"===e.productTypeId||"pr03"===e.productTypeId)}function g(e){return e.filter(e=>"pr04"===e.productTypeId||"pr05"===e.productTypeId)}function C(e){switch(e){case"pr01":return"강의";case"pr02":return"세미나";case"pr03":return"세미나 다시보기";case"pr04":return"종이책";case"pr05":case"pr07":return"전자책";case"pr06":return"패키지";case"pr08":return"디지털교재";case"pr09":return"트랙"}}function y(e,t,r){let n=(0,o.qo)(t,r)||String(e);return"".concat("/seminars/").concat(e,"/").concat(encodeURIComponent(n))}function w(e,t){if(e.startsWith("CMS"))return"".concat("https://www.hanbit.co.kr","/channel/view.html?cmscode=").concat(e);return n.wc.test(e)?"".concat("/books/").concat(encodeURIComponent(t||e),"?code=").concat(e):"/product/".concat(e)}function E(e,t){return e.startsWith("E")&&"br05"!==t?"B".concat(e.slice(1)):e}},37975:(e,t,r)=>{r.d(t,{A:()=>h});var n=r(95155),o=r(43171),s=r(3865),l=r(40980),a=r(81173),c=r(82849),u=r(6904),i=r(38409),d=r(40115),p=r(73321),f=r(12115);function h(e){let{className:t,autoFocus:r,defaultValue:h}=e,m=(0,p.useSearchParams)(),[b,x]=(0,f.useState)(h||m.get("q")||""),[v,g]=(0,f.useState)(!1),[C,y]=(0,f.useState)([]),[w,E]=(0,f.useState)(null),[S,R]=(0,f.useState)(!1),O=(0,p.useRouter)(),k=(0,f.useRef)(null),A=(0,f.useRef)(!1),{setSearchAutocomplete:I,setCurrentItem:j}=(0,a.r)(),{currentItem:_,educationSearchResults:N,booksSearchResults:V,contentsSearchResults:K,packageSearchResults:B}=(0,a.C)(),T=(0,p.usePathname)();(0,f.useEffect)(()=>{let e=m.get("q");e?x(e):h||x("")},[T,m,h]),(0,f.useEffect)(()=>{let e=setTimeout(()=>{if(""===b.trim()||b.trim().length<2){I({query:"",booksSearchResults:[],contentsSearchResults:[],educationSearchResults:[],packageSearchResults:[]}),k.current&&k.current.abort();return}D(b)},200);return()=>clearTimeout(e)},[b,I]);let D=async e=>{k.current&&k.current.abort();let t=new AbortController;k.current=t;try{var r,n,o,s,l,a,u,i;let d=encodeURIComponent(e),p=await fetch("".concat("https://sch.hanbit.co.kr","/autocomplete/search?q=").concat(d,"&types=education,book,contents,package&fq=").concat(d,"&size=5"),{signal:t.signal});if(!p.ok)throw new c.eo("검색어 자동완성 조회 오류",p.statusText,p.status);if(k.current!==t)return;let f=await p.json();I({query:e,booksSearchResults:null!=(r=f.booksResults)?r:[],contentsSearchResults:null!=(n=f.contentsResults)?n:[],educationSearchResults:null!=(o=f.educationResults)?o:[],packageSearchResults:null!=(s=f.packageResults)?s:[]}),y([...null!=(l=f.packageResults)?l:[],...null!=(a=f.educationResults)?a:[],...null!=(u=f.booksResults)?u:[],...null!=(i=f.contentsResults)?i:[]]),j(null),E(null)}catch(e){"AbortError"!==e.name&&console.error("검색어 자동완성 조회 오류 발생 : ",e)}finally{k.current===t&&(k.current=null)}},L=()=>
1{if(b.trim()){if(g(!1),_)return void O.push((0,u.Qj)(_.code));O.push("/search/result?q=".concat(encodeURIComponent(b)))}};return(0,n.jsxs)("div",{className:(0,l.cn)("w-full min-w-0",t),"data-sentry-component":"SearchInput","data-sentry-source-file":"SearchInput.tsx",children:[(0,n.jsx)(s.L,{size:"gnb",active:!!b,text:b,onChange:e=>x(e.target.value),onFocus:()=>g(!0),onBlur:()=>{S||g(!1)},onKeyDown:e=>{var t;if(A.current)return;if("Enter"===e.key)return void L();let r=w;if(_&&null!==r||(null==_?void 0:_.code)!==(null==(t=C[null!=r?r:0])?void 0:t.code)){let e=C.findIndex(e=>e.code===(null==_?void 0:_.code));r=e<0?null:e,E(e)}if("ArrowDown"===e.key){if(e.preventDefault(),null===r){E(0),j(C[0]);return}r<C.length-1&&(E(r+1),j(C[r+1]));return}if("ArrowUp"===e.key&&null!==r){if(e.preventDefault(),r<=0){E(null),j(null);return}if(r>0){E(r-1),j(C[r-1]);return}}E(null),j(null)},onCompositionStart:()=>{A.current=!0},onCompositionEnd:()=>{A.current=!1},autoFocus:r,leftIcon:(0,n.jsx)("button",{type:"button",onClick:L,children:(0,n.jsx)(d.A,{className:(0,l.cn)("w-5 h-5",b?"fill-label-alternative":"fill-label-assistive")})}),rightIcon:b?(0,n.jsx)("button",{type:"button",onClick:()=>{x("")},className:"flex items-center justify-center",children:(0,n.jsx)(i.A,{className:"w-5 h-5 text-label-assistive","data-testid":"close-icon"})}):void 0,"data-sentry-element":"SearchField","data-sentry-source-file":"SearchInput.tsx"}),b.length>1&&v&&(0,n.jsx)(o.A,{query:b,packageSearchResults:B,educationSearchResults:N,booksSearchResults:V,contentsSearchResults:K,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),onClick:()=>g(!1),className:"hidden hanbit_sm:flex absolute top-[48px] hanbit_sm:top-[32px] max-h-[400px] left-0 right-0 z-10 bg-white border border-line-neutral rounded-xl"})]})}},38409:(e,t,r)=>{r.d(t,{A:()=>l});var n,o=r(12115);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let l=function(e){return o.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 22 22"},e),n||(n=o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.925 11a9.075 9.075 0 1 1 18.15 0 9.075 9.075 0 0 1-18.15 0m6.45-3.79a.825.825 0 1 0-1.167 1.166L9.833 11l-2.625 2.625a.825.825 0 1 0 1.167 1.167L11 12.168l2.625 2.625a.825.825 0 1 0 1.166-1.167L12.166 11l2.625-2.625a.825.825 0 1 0-1.166-1.167L11 9.834z",clipRule:"evenodd"})))}},40115:(e,t,r)=>{r.d(t,{A:()=>l});var n,o=r(12115);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}let l=function(e){return o.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24"},e),n||(n=o.createElement("path",{fillRule:"evenodd",d:"M10 2.1a7.9 7.9 0 1 0 4.913 14.086l4.95 4.95a.9.9 0 0 0 1.273-1.272l-4.95-4.95A7.9 7.9 0 0 0 10 2.1M3.9 10a6.1 6.1 0 1 1 12.2 0 6.1 6.1 0 0 1-12.2 0",clipRule:"evenodd"})))}},43171:(e,t,r)=>{r.d(t,{A:()=>f});var n=r(95155);let o=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"];var s=r(40980),l=r(81173),a=r(6904),c=r(98500),u=r.n(c),i=r(73321),d=r(12115);function p(e){let{query:t,title:r,items:c,onClick:p}=e,f=(0,i.useRouter)(),{currentItem:h,actions:m}=(0,l.C)(),b=(0,d.useRef)(null);return((0,d.useEffect)(()=>{h&&b.current&&b.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[h]),0===c.length)?null:(0,n.jsxs)("div",{className:"flex flex-col border-t first:border-t-0 pt-[15px] first:pt-0 hanbit_sm:pt-[7px] hanbit_sm:first:pt-0 border-line-alternative","data-sentry-component":"AutocompletionList","data-sentry-source-file":"SearchAutocompletion.tsx",children:[(0,n.jsx)("p",{className:"hanbit_sm:pt-2 hanbit_sm:pb-1 first:px-[1px] text-label1_normal hanbit_sm:text-label2 text-label-alternative font-semibold",children:r}),c.map(e=>(0,n.jsxs)(u(),{ref:(null==h?void 0:h.code)===e.code?b:null,href:(0,a.Qj)(e.code),onMouseEnter:()=>{m.setCurrentItem(e)},onClick:t=>{t.stopPropagation(),f.push((0,a.Qj)(e.code)),null==p||p()},"data-testid":"autocomplete-item-".concat(e.code),"data-selected":(null==h?void 0:h.code)===e.code,className:"py-2 relative text-body1_normal text-label-alternative font-normal",children:[(0,n.jsx)("div",{className:(0,s.cn)("absolute hidden -left-3 -right-3 top-0 h-full bg-label-normal/[.0375] rounded-xl",(null==h?void 0:h.code)===e.code?"hanbit_sm:block":"hidden")}),(0,n.jsx)("p",{className:"line-clamp-1",children:function(e,t){if(!t)return e;let r=function(e,t){let r=e.split(""),n=e.replace(/\s+/g,""),s=t.replace(/\s+/g,""),l=s.length,a=n.split(""),c=s.split("");for(let e=0;e<=a.length-l;e++){let t=!0;for(let r=0;r<l;r++){let n=a[e+r],s=c[r];
1if(/[ㄱ-ㅎ]/.test(s)){if(function(e){let t=e.charCodeAt(0)-44032;return t<0||t>11171?e:o[Math.floor(t/588)]}(n)!==s){t=!1;break}}else if(/[a-zA-Z]/.test(s)){if(n.toLowerCase()!==s.toLowerCase()){t=!1;break}}else if(n!==s){t=!1;break}}if(t){let t=-1,n=0;for(let o=0;o<r.length;o++)if(" "!==r[o]){if(n===e){t=o;break}n++}let o=t;n=0;for(let e=t;e<r.length;e++)if(" "!==r[e]&&n++,n===l){o=e;break}return[t,o-t+1]}}return null}(e,t);if(!r)return e;let[s,l]=r,a=e.slice(0,s),c=e.slice(s,s+l),u=e.slice(s+l);return(0,n.jsxs)(n.Fragment,{children:[a,(0,n.jsx)("strong",{className:"text-label-normal font-semibold",children:c}),u]})}(e.title,t)})]},e.code))]})}function f(e){let{query:t,packageSearchResults:r,educationSearchResults:o,booksSearchResults:a,contentsSearchResults:c,className:u,onMouseEnter:i,onMouseLeave:f,onClick:h}=e,{currentItem:m}=(0,l.C)(),b=(0,d.useRef)(null);return(0,d.useEffect)(()=>{!m&&b.current&&b.current.scrollTo({top:0,behavior:"smooth"})},[m]),(0,n.jsxs)("div",{ref:b,className:(0,s.cn)("flex flex-col overflow-auto px-5 py-2 isolate",u),onMouseEnter:()=>{null==i||i()},onMouseLeave:()=>{null==f||f()},"data-sentry-component":"SearchAutocompletion","data-sentry-source-file":"SearchAutocompletion.tsx",children:[(0,n.jsx)(p,{query:t,title:"강의",items:[...r,...o].slice(0,5),onClick:h,"data-sentry-element":"AutocompletionList","data-sentry-source-file":"SearchAutocompletion.tsx"}),(0,n.jsx)(p,{query:t,title:"책",items:a,onClick:h,"data-sentry-element":"AutocompletionList","data-sentry-source-file":"SearchAutocompletion.tsx"}),(0,n.jsx)(p,{query:t,title:"채널.H",items:c,onClick:h,"data-sentry-element":"AutocompletionList","data-sentry-source-file":"SearchAutocompletion.tsx"}),0===r.length&&0===o.length&&0===a.length&&0===c.length&&(0,n.jsx)("div",{className:"py-2 text-body1_normal text-label-alternative font-normal",children:(0,n.jsx)("p",{className:"line-clamp-1",children:"일치하는 검색어가 없어요."})})]})}},81173:(e,t,r)=>{r.d(t,{C:()=>n,r:()=>o});let n=(0,r(1934).v)(e=>({query:"",currentItem:null,booksSearchResults:[],contentsSearchResults:[],educationSearchResults:[],packageSearchResults:[],actions:{setSearchAutocomplete:t=>{let{query:r,booksSearchResults:n,contentsSearchResults:o,educationSearchResults:s,packageSearchResults:l}=t;e({query:r,booksSearchResults:n,contentsSearchResults:o,educationSearchResults:s,packageSearchResults:l})},setCurrentItem:t=>{e({currentItem:t})}}})),o=()=>n().actions},82849:(e,t,r)=>{r.d(t,{Dr:()=>s,MZ:()=>f,NC:()=>b,R$:()=>n,S6:()=>h,_n:()=>p,cy:()=>m,eo:()=>o,fK:()=>i,gP:()=>d,hS:()=>x,m_:()=>c,qQ:()=>l,v3:()=>a,yI:()=>u});let n="요청을 처리하는 중에 문제가 발생했습니다.\n잠시 후 다시 시도해주세요.";class o extends Error{constructor(e,t,r,n,o,s=!0,l){super(t,{cause:l}),this.statusCode=r,this.name=e,this.data=n,this.errorCode=o,this.isCaptureSentry=s}}class s extends o{constructor(e){super("NetworkError",e,503)}}class l extends o{constructor(e,t){super("ForbiddenError",e,403,void 0,t,!1)}}class a extends o{isUnauthorized(){return this.unauthorized}constructor(e,t,r=!0){super("AuthenticationError",e,401,void 0,t,!1),this.unauthorized=r}}class c extends o{constructor(e){super("NotFoundError",e,404)}}class u extends o{constructor(e,t){super("ValidationError",e,400,t,void 0,!1)}}class i extends o{constructor(e,t){super("ConflictError",e,409,void 0,t,!1)}}class d extends o{constructor(e){super("ServerError",e,500)}}class p extends o{constructor(e){super("NoSampleError",e,450,void 0,void 0,!1)}}class f extends o{constructor(e,t,r){super(e,t,void 0,void 0,void 0,!0,r)}}function h(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e&&"isCaptureSentry"in e}function m(e){var t,r;return e?new o(e.name,e.message,e.statusCode,e.data,null!=(t=e.errorCode)?t:void 0,null==(r=e.isCaptureSentry)||r):new f("알 수 없는 오류","알 수 없는 오류가 발생했습니다.\n잠시 후 다시 시도해주세요.")}function b(e){var t,r;let o=h(e)?e:new d(n),s="ServerError"===o.name?n:o.message;return{status:"error",statusCode:null!=(t=o.statusCode)?t:500,message:s,error:{...{name:o.name,message:o.message,statusCode:o.statusCode,data:o.data,errorCode:o.errorCode,isCaptureSentry:o.isCaptureSentry},message:s},pagination:null,errorCode:null!=(r=o.errorCode)?r:null}}function x(e){var t;let r=h(e)?e:new d(n),o="ServerError"===r.name?n:r.message;return{name:r.name,message:o,statusCode:r.statusCode,data:r.data,errorCode:r.errorCode,isCaptureSentry:null==(t=r.isCaptureSentry)||t}}},95268:(e,t,r)=>{r.d(t,{CW:()=>c,En:()=>o,UK:()=>p,Vo:()=>n,dU:()=>s,oi:()=>u,q1:()=>d,qe:()=>a,wc:()=>l,wm:()=>i});let n={COURSE:"pr01",SEMINAR:"pr02",VOD:"pr03",BOOK:"pr04",EBOOK:"pr05",PACKAGE:"pr06",AGENCY_EBOOK:"pr07",DIGITAL_TEXTBOOK:"pr08",COHORT:"pr09"};Object.keys(n).filter(e=>"VOD"!==e);let o={pr01:"강의",pr02:"세미나",pr03:"세미나 다시보기",pr04:"종이책",pr05:"전자책",pr06:"패키지",pr07:"전자책",pr08:"디지털교재",pr09:"트랙"},s=999,l=/^[BE]/,a=72/96.16,c={ss01:"판매중",ss02:"일시품절",ss03:"절판",ss04:"판매중지",ss05:"재고부족"},u={pageUrl:(e,t)=>
1"".concat("https://www.hanbit.co.kr").concat(null!=t?t:"/product/".concat(e)),twitter:e=>"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(e)),facebook:e=>"https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(e))},i=["BOOK","EBOOK","AGENCY_EBOOK"],d=["COURSE","PACKAGE","COHORT"],p=["SEMINAR","VOD"]}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.