6 lines
9.7 KiB
Plaintext
6 lines
9.7 KiB
Plaintext
"use strict";
|
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="45524c79-b427-5bca-b032-b98599e68f2b")}catch(e){}}();
|
|
(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[5],{731:(e,s,n)=>{n.d(s,{Z:()=>j});var i=n(9),t=n.n(i),a=n(0),r=n(10),l=n(398),o=n(399),c=n(72),u=n(99),d=n(8),p=n(804),m=n(796),h=n(1);const x=n(822),f=void 0,_=({ariaLabel:e,autoCapitalize:s,autoComplete:n,autoCorrect:i,autoFocus:l=!1,className:o="",classNameInput:p="",classNameInputContainer:m="",classNameInputWrapper:_="",disabled:S,error:j,iconLeftURL:k,iconRightURL:L,label:C,classNameLabelPlaceholder:I,classNameLabelOverflow:z,max:R,maxLength:Z,min:T,name:w,onBlur:y,onChange:M,onClick:E,onFocus:P,onIconRightClick:A,onKeyDown:B,placeholder:F,prefix:$,readOnly:U,required:O,size:Y="m",spellCheck:V,suffix:W,testId:G,type:H="text",valid:K,value:J,errorTestId:q},X)=>{const Q=(0,u._x)(),ee=(0,r.v9)(d.Y6),[se,ne]=(0,a.useState)(!!l),ie=(0,a.useRef)(null),te=(0,a.useRef)(null);(0,a.useImperativeHandle)(X,(()=>({get container(){return te.current},get input(){return ie.current}})));const ae=Boolean(j||L||K),re=t()("D_nt",ee?null:f.container,o),le=t()("D_nu",ee?x.inputContainer:f.inputContainer,{D_nx:S,D_nC:Boolean(j)},m),oe=t()("D_nw",_),ce=t()("D_n_",ee?null:f.input,{D_nA:!C||se||!!J},ee?{[x.clearInputArrows]:"number"===H,[x.inputSizeS]:"s"===Y,[x.inputSizeM]:"m"===Y,[x.inputWrapperLeftSpace]:Boolean(k),[x.inputWrapperRightSpace]:ae}:{[f.inputSizeS]:"s"===Y,[f.inputSizeM]:"m"===Y,[f.inputWrapperRightSpace]:ae},p);return(0,h.jsxs)("div",{className:re,ref:te,children:[(0,h.jsxs)("div",{className:le,children:[(0,h.jsx)(D,{prefix:$,size:Y}),(0,h.jsxs)("div",{className:oe,children:[(0,h.jsx)(b,{classNameLabelOverflow:z,classNameLabelPlaceholder:I,label:C,shouldMinimizeLabel:se||!!J,size:Y}),(0,h.jsx)(g,{iconLeftURL:k}),(0,h.jsx)("input",{"aria-label":C||e,autoCapitalize:s,autoCorrect:i,autoComplete:"password"===H?"off":n,autoFocus:l,className:ce,disabled:S,inputMode:"number"===H?"numeric":void 0,max:R,maxLength:Z?parseInt(`${Z}`,10):void 0,min:T,name:w,onBlur:e=>{y&&y(e),ne(!1)},onChange:M,onClick:E,onFocus:e=>{P&&P(e),ne(!0)},onKeyDown:B,placeholder:F,readOnly:U,ref:ie,required:O,spellCheck:V,"data-testid":G,type:H,value:J}),(0,h.jsx)(v,{error:j,iconRightURL:L,onIconRightClick:A,valid:K})]}),(0,h.jsx)(N,{hasRightIcon:ae,size:Y,suffix:W})]}),j?(0,h.jsx)(c.Z,{className:ee?x.errorText:f.errorText,color:Q.carouRed80,size:"s",testId:q,children:j}):null]})},D=({prefix:e,size:s})=>{const n=(0,r.v9)(d.Y6);if(!e)return null;const i=t()("D_nv",n?x.prefix:f.prefix);return(0,h.jsx)(c.Z,{className:i,inline:!0,singleline:!0,size:s,children:e})},N=e=>{const s=(0,r.v9)(d.Y6),{hasRightIcon:n,suffix:i,size:a}=e;if(!i)return null;const l=t()("D_nB",s?x.suffix:f.suffix,s?{[x.suffixWithIcon]:n}:null);return(0,h.jsx)(c.Z,{className:l,inline:!0,singleline:!0,size:a,children:i})},b=e=>{const s=(0,r.v9)(d.Y6),{label:n,shouldMinimizeLabel:i,size:a}=e;if(!n)return null;const l=t()(e.classNameLabelOverflow,"D_ny",s?x.label:f.label,i?s?{[x.labelMinimizedSizeS]:"s"===a,[x.labelMinimizedSizeM]:"m"===a}:{[f.labelMinimizedSizeS]:"s"===a,[f.labelMinimizedSizeM]:"m"===a}:e.classNameLabelPlaceholder??"",i?"D_nz":"");return(0,h.jsx)(c.Z,{className:l,inline:!0,singleline:!0,size:i?"m"===a?"s":"xs":a,children:n})},g=({iconLeftURL:e})=>{const s=(0,r.v9)(d.Y6),n=t()(s?x.icon:f.icon);return e?(0,h.jsx)(o.Z,{className:n,src:e}):null},v=({error:e,valid:s,iconRightAriaLabel:n,iconRightURL:i,onIconRightClick:a})=>{const c=(0,r.v9)(d.Y6),u=t()(c?x.icon:f.icon);return e?(0,h.jsx)(o.Z,{className:u,src:p}):s?(0,h.jsx)(o.Z,{className:u,src:m}):i?a?(0,h.jsx)(l.Z,{ariaLabel:n,className:"D_nE",onClick:a,type:"icon",children:(0,h.jsx)(o.Z,{className:u,src:i})}):(0,h.jsx)(o.Z,{className:u,src:i}):null},S=(0,a.forwardRef)(_);S.displayName="InputText";const j=S},730:(e,s,n)=>{n.d(s,{Z:()=>o,h:()=>l});var i=n(9),t=n.n(i),a=(n(0),n(1187)),r=n(1);const l=e=>{const{className:s,style:n,animated:i=!0}=e;return(0,r.jsx)("div",{className:t()(i?a.os:a.z1,s),style:n})},o=l},764:(e,s,n)=>{n.d(s,{Z:()=>o});var i=n(0),t=n(10),a=n(429),r=n(105),l=n(1);const o=({action:e,message:s,snackbarID:n})=>{const o=(0,t.I0)(),c=(0,t.v9)(r.pN),u=(0,i.useCallback)((()=>{c===n&&setTimeout((()=>o((0,r.eG)())),0)}),[c,o,n]);(0,i.useEffect)((()=>()=>{u()}),[u]);const d=(0,i.useMemo)((()=>({actionText:e?.text,message:s})),[e?.text,s]);return c!==n?null:(0,l.jsx)("div",{className:"D_oP",children:(0,l.jsx)(a.Z,{definition:d,id:0,isDuplicate:!1,lifetime:4e3,onActionClick:()=>{e?.handler()},onClose:u})})}},749:(e,s,n)=>{n.r(s),n.d(s,{default:()=>w});var i=n(9),t=n.n(i),a=n(0),r=n(10),l=n(66),o=n(398),c=n(40),u=n(764),d=n(730),p=n(1);const m=()=>(0,p.jsxs)("div",{className:"D_NE",children:[(0,p.jsx)(d.Z,{className:"D_NF"}),(0,p.jsx)(d.Z,{className:"D_NG"}),(0,p.jsxs)("div",{className:"D_NH",children:[(0,p.jsx)(d.Z,{className:"D_NI"}),(0,p.jsx)(d.Z,{className:"D_NJ"})]}),(0,p.jsx)(d.Z,{className:"D_NK"})]});var h=n(99),x=n(397),f=n(72),_=n(428),D=n(18);const N=({className:e})=>{const s=(0,r.v9)(_.$s),n=(0,r.v9)(_.X5),i=(0,r.I0)(),l=(0,h._x)();(0,a.useEffect)((()=>(window.addEventListener("offline",o),window.addEventListener("online",c),()=>{window.removeEventListener("offline",o),window.removeEventListener("online",c)})),[]);const o=()=>i((0,_.lB)()),c=()=>i((0,_.aD)());if(n){const n=t()(e,"D_NL",s?"D_NN":"D_NM"),i=s?(0,D.ZP)("Back online"):(0,D.ZP)("You are offline");return(0,p.jsx)("div",{className:n,children:(0,p.jsx)(f.Z,{color:l.white,size:"s",children:(0,p.jsx)(x.Z,{id:i})})})}return null};var b=n(8),g=n(16),v=n(421),S=n(21),j=n(15),k=n(179),L=n(1016),C=n(76),I="D_oA",z="D_ox",R="D_oz";const Z=n(1919);class T extends a.PureComponent{constructor(e){super(e),this.mainRef=void 0,this.onViewDraftsClick=()=>{const{routerPush:e,sellTrackingJourneyStart:s}=this.props;s({context:"view_drafts_snack_bar"}),e("/sell/")},this.unfocusMain=e=>{e.currentTarget?.removeAttribute("tabindex")},this.mainRef=a.createRef()}render(){const{adUnitFillStatuses:e=[],bottom:s,className:n="",isBranchBannerVisible:i,isDesktop:a,pageSkinEnabled:r,statusVisible:l,stickyTop:o,preTop:u,top:d}=this.props,h=(0,C.Yi)(),x=e.filter((e=>"adPageskin"===e.adIndex)),f=!x.some((e=>!e.fillStatus)),_=e.find((e=>"adPageskinPassback"===e.adIndex));let D=0;D=u&&o?u.height:(d?parseInt(d.height,10):0)+(i?h:0);const N={paddingBottom:`${(s?parseInt(s.height,10):0)+(l?parseInt(c.networkStatusHeight,10):0)}px`,paddingTop:"number"==typeof D?`${D}px`:D},b=x.length>0&&f&&r&&_&&!_?.fillStatus,g=a?t()(n,z,{[Z.container]:!b,[Z.containerPageskin]:b}):t()(n,z);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:g,ref:this.props.containerRef,style:N,children:[i&&(0,p.jsx)(m,{}),u?u.component:null,(0,p.jsxs)("header",{className:this.getTopClassName(),style:{marginTop:`${i?h:0}px`},children:[this.renderSkipToContent(),null!=d?d.component:null]}),this.renderMainSection(g)]}),(0,p.jsx)(L.Z,{})]})}renderSkipToContent(){return(0,p.jsx)(o.Z,{className:"D_oB",onClick:()=>{const e=this.mainRef.current;e&&(e.setAttribute("tabindex","-1"),e.focus())},size:"s",tabIndex:0,type:"linkTeal",children:(0,p.jsx)(x.Z,{id:D.ZP`Skip to content`})})}renderMainSection(e){const{bottom:s,children:n,isDesktop:i,stickyTop:t}=this.props,a=(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("main",{id:"main",onBlur:this.unfocusMain,ref:this.mainRef,children:n}),this.renderReportListingSnackbars(),(0,p.jsxs)("div",{className:this.getBottomClassName(),children:[null!=s?s.component:null,(0,p.jsx)(N,{})]})]});return i&&t?(0,p.jsx)("div",{className:"D_oy",children:(0,p.jsx)("div",{className:e,children:a})}):a}renderReportListingSnackbars(){const{localizeText:e}=this.props;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u.Z,{message:e((0,D.ZP)("Thank you for keeping Carousell a trusted marketplace.")),snackbarID:"REPORT_LISTING_SUCCESS"}),(0,p.jsx)(u.Z,{message:e((0,D.ZP)("Sorry, there was an error reporting the listing.")),snackbarID:"REPORT_LISTING_FAILURE"}),(0,p.jsx)(u.Z,{message:e((0,D.ZP)("Draft saved.")),snackbarID:"LISTING_DRAFT_SAVE_SUCCESS",action:{handler:this.onViewDraftsClick,text:e((0,D.ZP)("View Drafts"))}}),(0,p.jsx)(u.Z,{message:e((0,D.ZP)("There was an error saving your draft.")),snackbarID:"LISTING_DRAFT_SAVE_FAILURE"})]})}getTopClassName(){return this.props.isDesktop?`${R} ${Z.top} ${this.props.stickyTop?"D_o_":""}`:`${R} ${(void 0).top}`}getBottomClassName(){return this.props.isDesktop?`${I} ${Z.bottom}`:I}}const w=(0,r.$j)((function(e){return{isBranchBannerVisible:(0,v.RM)(e),isDesktop:(0,b.Y6)(e),localizeText:(0,S.l$)(e),me:(0,g.XM)(e),statusVisible:(0,_.X5)(e)}}),(function(e){return(0,l.DE)({routerPush:j.J5,sellTrackingJourneyStart:k.YW},e)}))(T)},822:(e,s,n)=>{n.r(s),n.d(s,{clearInputArrows:()=>i,errorText:()=>t,icon:()=>a,input:()=>r,inputContainer:()=>l,inputSizeM:()=>o,inputSizeS:()=>c,inputWrapperLeftSpace:()=>u,inputWrapperRightSpace:()=>d,label:()=>p,labelMinimizedSizeM:()=>m,labelMinimizedSizeS:()=>h,prefix:()=>x,suffix:()=>f,suffixWithIcon:()=>_});var i="D_nr",t="D_nq",a="D_nn",r="D_nm",l="D_nc",o="D_nl",c="D_nk",u="D_ne",d="D_nf",p="D_nh",m="D_nj",h="D_ni",x="D_ng",f="D_no",_="D_np"},1187:(e,s,n)=>{n.d(s,{os:()=>i,z1:()=>t});var i="D_nM",t="D_nL"},1919:(e,s,n)=>{n.r(s),n.d(s,{bottom:()=>i,container:()=>t,containerPageskin:()=>a,top:()=>r});var i="D_oG",t="D_oC",a="D_oE",r="D_oF"},804:e=>{e.exports="https://mweb-cdn.karousell.com/build/alert-error-97b09b3b85.svg"},796:e=>{e.exports="https://mweb-cdn.karousell.com/build/alert-success-eb38b5e8bc.svg"}}]);
|
|
//# sourceMappingURL=https://mdev.llesuorac.com/01857052a1fbff6c7926249973b6164fd2b19d8b/f88f48d6c6c713a7.min.js.map
|
|
//# debugId=45524c79-b427-5bca-b032-b98599e68f2b
|