import{j as N,I as $t,B as qn,ak as dt,aJ as Hn,H as Be,aB as $n,_ as Un}from"./mui-vendor-CkIVaoQP.js";import{r as S,u as Gn,g as be,e as fe,b as C,d as zn}from"./react-vendor-CmFgShSM.js";import{L as Qn,j as Vn,h as vt,A as pt,a9 as Ne,a1 as je,p as de,N as ht,G as z,S as se,W as bt,iz as Yn}from"./index-Vwb3Bce5.js";import{a as Kn,u as Ut,f as Gt,_ as Xn}from"./redux-vendor-B7uoacJt.js";import{d as Jn}from"./Delete-DHYHiC8G.js";import{C as Zn}from"./CityNewKillRequest-ByfLtRM3.js";import{R as er}from"./ResponsiveTable-DugzNG82.js";import{A as tr}from"./AdvancedTable-B0ObjV8k.js";import{d as nr}from"./Plagiarism-B6PD3EJO.js";import{_ as rr}from"./chart-vendor-sE2SUVPW.js";import{a as or,s as B}from"./styled-components.browser.esm-gS9mh05b.js";const ur=Kn("ARCHIVE_DELETE_KILL_REQUEST_SERVICE",async(e,{dispatch:t})=>{t(Qn());try{const{data:n,status:r}=await Vn.delete("Poultry_Request/"+e);return t(vt()),{data:n,status:r}}catch(n){return t(vt()),{error:n.response.data.result}}}),Bu=()=>{const[e,t]=S.useState([]),n=Ut(),[r]=S.useContext(pt),{avicultureRequests:o}=Gt(l=>l.avicultureSlice),[,,u,a,i,c]=S.useContext(pt);return S.useEffect(()=>{const l=Ne(new Date).format("YYYY-MM-DD");a(l),c(l)},[]),S.useEffect(()=>{n(je({selectedDate1:u,selectedDate2:i}))},[u,i]),S.useEffect(()=>{const l=Array.isArray(o)&&(o==null?void 0:o.filter((s,v)=>(s.stateProcess==="accepted"||s.stateProcess==="pending")&&s.finalState!=="archive"));let f;l&&(f=l==null?void 0:l.map((s,v)=>{var p,m,w,h,y,b,k,E,x,A,I,T,W,L,M,Q,_,$;let g="";return s.directBuying?g="خرید مستقیم":s.union?g="خرید خارج از استان":g="اتحادیه",[v+1,s.orderCode,g,s!=null&&s.freezing?"انجماد":s!=null&&s.export?"صادرات":"عادی",s!=null&&s.directBuyingBuyerInfo?`${(p=s==null?void 0:s.directBuyingBuyerInfo)==null?void 0:p.buyerFullname} (${(m=s==null?void 0:s.directBuyingBuyerInfo)==null?void 0:m.buyerMobile})`:"-",s.directBuyingKillPlace?s.directBuyingKillPlace:"-",s!=null&&s.createDate?de(s==null?void 0:s.createDate):"",s!=null&&s.sendDate?de(s==null?void 0:s.sendDate):"",`${(h=(w=s.process)==null?void 0:w.poultry)==null?void 0:h.poultryName} (${(b=(y=s.process)==null?void 0:y.poultry)==null?void 0:b.poultryMobile})`,`${(E=(k=s.process)==null?void 0:k.poultry)==null?void 0:E.poultryProvince}/${(A=(x=s.process)==null?void 0:x.poultry)==null?void 0:A.poultryCity}`,de((T=(I=s.process)==null?void 0:I.poultryHatching)==null?void 0:T.date),(L=(W=s.process)==null?void 0:W.poultry)==null?void 0:L.age,s.IndexWeight,(Q=(M=s.process)==null?void 0:M.poultry)==null?void 0:Q.poultryQuantity.toLocaleString(),(s.IndexWeight*(($=(_=s.process)==null?void 0:_.poultry)==null?void 0:$.poultryQuantity)).toLocaleString(),N.jsx($t,{disabled:s==null?void 0:s.directBuyingKillPlace,"aria-label":"delete",color:"error",className:"avicultureActiveRequestsBtn",onClick:()=>{var O,V;n(ur((V=(O=s==null?void 0:s.process)==null?void 0:O.poultry)==null?void 0:V.poultryRequestId)).then(U=>{U.payload.error?r({vertical:"top",horizontal:"center",msg:U.payload.error,severity:"error"}):(n(je()),n(ht({right:!1,bottom:!1,content:null})),r({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:N.jsx(Jn,{})},s==null?void 0:s.orderCode)]})),t(f)},[o]),N.jsx(N.Fragment,{children:N.jsx(z,{container:!0,gap:se.MEDIUM,direction:"column",xs:12,children:N.jsx(z,{container:!0,gap:se.SMALL,justifyContent:{xs:"center",lg:"space-between"},alignSelf:"center",alignItems:"center",xs:12,direction:{xs:"column",lg:"row"},width:"100%",children:N.jsxs(z,{container:!0,gap:se.SMALL,alignItems:"start",direction:"column",width:"100%",children:[N.jsx(z,{container:!0,width:"100%",gap:se.SMALL,children:N.jsx(qn,{className:"avicultureNewRequestBtn",variant:"contained",onClick:()=>{n(ht({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست کشتار",content:N.jsx(Zn,{isAviculture:!0})}))},children:"ثبت درخواست کشتار"})}),N.jsxs(z,{width:"100%",className:"avicultureActiveRequestsView",children:[N.jsxs(z,{container:!0,alignItems:"center",gap:se.SMALL,children:[N.jsx(z,{children:N.jsx(bt,{label:"از تاریخ",id:"date",renderInput:l=>N.jsx(dt,{style:{width:"160px"},...l}),value:u,onChange:l=>{a(Ne(l).format("YYYY-MM-DD"))}})}),N.jsx(z,{children:N.jsx(bt,{label:"تا تاریخ",id:"date",renderInput:l=>N.jsx(dt,{style:{width:"160px"},...l}),value:i,onChange:l=>{c(Ne(l).format("YYYY-MM-DD"))}})})]}),N.jsx(er,{title:"درخواست های کشتار",columns:["ردیف","کد سفارش","نوع فروش","نوع کشتار","اطلاعات خریدار","محل کشتار","تاریخ ثبت درخواست","تاریخ کشتار","مرغدار (تلفن)","استان/شهر","تاریخ جوجه ریزی","سن مرغ","میانگین وزنی","تعداد","وزن بار (کیلوگرم)","حذف"],data:e})]})]})})})})},ju=()=>{const e=Gn(),[t,n]=S.useState([]),{avicultureRequests:r}=Gt(a=>a.avicultureSlice),o=Ut();S.useEffect(()=>{o(je())},[]),S.useEffect(()=>{const a=r==null?void 0:r.filter(c=>c.stateProcess==="rejected"||c.provinceState==="rejected"),i=a==null?void 0:a.map((c,l)=>{var f,s,v,g,p,m,w,h,y,b,k,E;return[l+1,c.orderCode,de(c==null?void 0:c.createDate),de(c==null?void 0:c.sendDate),(s=(f=c==null?void 0:c.process)==null?void 0:f.poultry)==null?void 0:s.poultryName,(g=(v=c==null?void 0:c.process)==null?void 0:v.poultry)==null?void 0:g.poultryMobile,(m=(p=c==null?void 0:c.process)==null?void 0:p.poultry)==null?void 0:m.poultryCity,(h=(w=c==null?void 0:c.process)==null?void 0:w.poultry)==null?void 0:h.poultryProvince,(b=(y=c==null?void 0:c.process)==null?void 0:y.poultry)==null?void 0:b.age,(E=(k=c==null?void 0:c.process)==null?void 0:k.poultry)==null?void 0:E.poultryQuantity,N.jsx($t,{"aria-label":"delete",color:"primary",onClick:()=>{var x,A;return e(Yn+((A=(x=c==null?void 0:c.process)==null?void 0:x.poultry)==null?void 0:A.poultryRequestId))},children:N.jsx(nr,{})},c==null?void 0:c.orderCode)]});n(i)},[r]);const[u]=S.useState(["ردیف","کد سفارش","تاریخ ثبت درخواست","تاریخ درخواست","مرغدار","تلفن مرغدار","شهر","استان","سن مرغ","تعداد","مشاهده"]);return N.jsx(Hn,{children:N.jsx(tr,{name:"درخواست های رد شده",columns:u,data:t})})};var mt="focus-outline-hidden";function zt(){var e=this;document.addEventListener("keydown",function(t){e.focusByKeyboard=!0},!0),document.addEventListener("mousedown",function(t){e.focusByKeyboard=!1},!0),document.addEventListener("focus",function(t){e.updateVisibility()},!0),document.addEventListener("focusout",function(t){window.setTimeout(function(){document.hasFocus()||(e.focusByKeyboard=!0,e.updateVisibility())},0)}),this.updateVisibility()}zt.prototype={focusByKeyboard:!0,updateVisibility:function(){this.hidden=!this.focusByKeyboard},set hidden(e){document.documentElement.classList.toggle(mt,e)},get hidden(){return document.documentElement.classList.contains(mt)}};new zt;var Qt={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o4&&arguments[4]!==void 0?arguments[4]:"easeInOutCubic";return r>o?n:t+(n-t)*ir[u](r/o)};J.calcEndPoint=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(cr(t))return parseInt(t)+r;var o=n===window||n===document.documentElement?window.pageYOffset:n.scrollTop-n.getBoundingClientRect().top,u=t.nodeName.toLowerCase()==="html"?-o:t.getBoundingClientRect().top+o;return u+r};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},r=J;t.default=function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=u.duration,i=a===void 0?500:a,c=u.context,l=c===void 0?window:c,f=u.offset,s=f===void 0?0:f,v=u.ease,g=v===void 0?"easeInOutCubic":v,p=u.callback;if((typeof window>"u"?"undefined":n(window))==="object"){var m=l.scrollTop!==null&&l.scrollTop!==void 0?l.scrollTop:window.pageYOffset,w=(0,r.calcEndPoint)(o,l,s),h=performance.now(),y=window.requestAnimationFrame,b=function k(){var E=performance.now()-h,x=(0,r.setPosition)(m,w,E,i,g);l!==window?l.scrollTop=x:window.scroll(0,x),E>i?typeof p=="function"&&p(o):y(k)};b()}},e.exports=t.default})(qe,qe.exports);var Vt=qe.exports,He={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(a){for(var i=1;i0&&arguments[0]!==void 0?arguments[0]:{},i=a.query,c=i===void 0?'[href^="#"]:not([href="#"]':i,l=a.match,f=l===void 0?function(w){return document.getElementById(w.hash.substring(1))}:l,s=a.hashChange,v=s===void 0?!0:s,g=a.scrollSmoothConfig,p=document.querySelectorAll(c),m=function(h){h.preventDefault();var y=f(h.target);y&&(v&&history.replaceState(null,null,"#"+y.id),(0,o.default)(y,n({},g)))};Array.from(p).map(function(w){w.addEventListener("click",m,!1)})},e.exports=t.default})(He,He.exports);var sr=He.exports,$e={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(r){if(Array.isArray(r)){for(var o=0,u=Array(r.length);o0&&arguments[0]!==void 0?arguments[0]:{},o=r.activeClass,u=o===void 0?"active":o,a=r.query,i=a===void 0?'[href^="#"]:not([href="#"]):not([href="#0"])':a,c=r.threshold,l=c===void 0?[.25,.5,.75]:c,f=r.detectType,s=f===void 0?"max":f,v={threshold:l},g=function(x){return x.classList.remove(u)},p=function(x){return x.classList.add(u)},m=function(){document.querySelectorAll("."+u).forEach(g)},w=function(x){m(),p(document.querySelector('a[href="#'+x.id+'"]'))},h=function(x){x.forEach(function(A){A.intersectionRatio>=Math[s].apply(Math,n(l))&&w(A.target)})},y=document.querySelectorAll(i),b=new IntersectionObserver(h,v),k=function(x){var A=document.querySelector("#"+x.hash.slice(1));b.observe(A)};y.forEach(k)},e.exports=t.default})($e,$e.exports);var lr=$e.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Vt,r=l(n),o=J,u=sr,a=l(u),i=lr,c=l(i);function l(f){return f&&f.__esModule?f:{default:f}}t.default={to:r.default,calcEndPoint:o.calcEndPoint,anchorScroll:a.default,observe:c.default},e.exports=t.default})(We,We.exports);var fr=We.exports;const dr=be(fr);var Yt={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(fe,function(){var t=/(auto|scroll)/,n=function(i,c){return i.parentNode===null?c:n(i.parentNode,c.concat([i]))},r=function(i,c){return getComputedStyle(i,null).getPropertyValue(c)},o=function(i){return r(i,"overflow")+r(i,"overflow-y")+r(i,"overflow-x")},u=function(i){return t.test(o(i))},a=function(i){if(i instanceof HTMLElement||i instanceof SVGElement){for(var c=n(i.parentNode,[]),l=0;l=t||A<0||s&&I>=u}function h(){var x=_e();if(w(x))return y(x);i=setTimeout(h,m(x))}function y(x){return i=void 0,v&&r?g(x):(r=o=void 0,a)}function b(){i!==void 0&&clearTimeout(i),l=0,r=c=o=i=void 0}function k(){return i===void 0?a:y(_e())}function E(){var x=_e(),A=w(x);if(r=arguments,o=this,c=x,A){if(i===void 0)return p(c);if(s)return i=setTimeout(h,t),g(c)}return i===void 0&&(i=setTimeout(h,t)),a}return E.cancel=b,E.flush=k,E}function Ue(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ir(e){return!!e&&typeof e=="object"}function Fr(e){return typeof e=="symbol"||Ir(e)&&Ar.call(e)==br}function wt(e){if(typeof e=="number")return e;if(Fr(e))return yt;if(Ue(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ue(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(mr,"");var n=yr.test(e);return n||wr.test(e)?Cr(e.slice(2),n?2:8):gr.test(e)?yt:+e}var Tr=_r;const Rr=be(Tr);var Ge="data-focus-lock",Kt="data-focus-lock-disabled",Lr="data-no-focus-lock",Pr="data-autofocus-inside",Mr="data-no-autofocus";function Ie(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dr(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Br=typeof window<"u"?S.useLayoutEffect:S.useEffect,Ct=new WeakMap;function jr(e,t){var n=Dr(null,function(r){return e.forEach(function(o){return Ie(o,r)})});return Br(function(){var r=Ct.get(n);if(r){var o=new Set(r),u=new Set(e),a=n.current;o.forEach(function(i){u.has(i)||Ie(i,null)}),u.forEach(function(i){o.has(i)||Ie(i,a)})}Ct.set(n,e)},[e]),n}var Fe={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function Xt(e){return e}function Jt(e,t){t===void 0&&(t=Xt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(u){var a=t(u,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(u){for(r=!0;n.length;){var a=n;n=[],a.forEach(u)}n={push:function(i){return u(i)},filter:function(){return n}}},assignMedium:function(u){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(u),a=n}var c=function(){var f=a;a=[],f.forEach(u)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(f){a.push(f),l()},filter:function(f){return a=a.filter(f),n}}}};return o}function Ke(e,t){return t===void 0&&(t=Xt),Jt(e,t)}function Wr(e){e===void 0&&(e={});var t=Jt(null);return t.options=rr({async:!0,ssr:!1},e),t}var Zt=Ke({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),en=Ke(),qr=Ke(),Hr=Wr({async:!0,ssr:typeof document<"u"}),$r=S.createContext(void 0),Ur=[],Xe=S.forwardRef(function(t,n){var r,o=S.useState(),u=o[0],a=o[1],i=S.useRef(),c=S.useRef(!1),l=S.useRef(null),f=S.useState({}),s=f[1],v=t.children,g=t.disabled,p=g===void 0?!1:g,m=t.noFocusGuards,w=m===void 0?!1:m,h=t.persistentFocus,y=h===void 0?!1:h,b=t.crossFrame,k=b===void 0?!0:b,E=t.autoFocus,x=E===void 0?!0:E;t.allowTextSelection;var A=t.group,I=t.className,T=t.whiteList,W=t.hasPositiveIndices,L=t.shards,M=L===void 0?Ur:L,Q=t.as,_=Q===void 0?"div":Q,$=t.lockProps,O=$===void 0?{}:$,V=t.sideCar,U=t.returnFocus,Z=U===void 0?!1:U,Oe=t.focusOptions,ee=t.onActivation,te=t.onDeactivation,me=S.useState({}),ge=me[0],ye=S.useCallback(function(H){var ne=H.captureFocusRestore;if(!l.current){var re,Y=(re=document)==null?void 0:re.activeElement;l.current=Y,Y!==document.body&&(l.current=ne(Y))}i.current&&ee&&ee(i.current),c.current=!0,s()},[ee]),Ee=S.useCallback(function(){c.current=!1,te&&te(i.current),s()},[te]),Ae=S.useCallback(function(H){var ne=l.current;if(ne){var re=(typeof ne=="function"?ne():ne)||document.body,Y=typeof Z=="function"?Z(re):Z;if(Y){var ft=typeof Y=="object"?Y:void 0;l.current=null,H?Promise.resolve().then(function(){return re.focus(ft)}):re.focus(ft)}}},[Z]),ke=S.useCallback(function(H){c.current&&Zt.useMedium(H)},[]),G=en.useMedium,q=S.useCallback(function(H){i.current!==H&&(i.current=H,a(H))},[]),st=Be((r={},r[Kt]=p&&"disabled",r[Ge]=A,r),O),lt=w!==!0,Bn=lt&&w!=="tail",jn=jr([n,q]),Wn=S.useMemo(function(){return{observed:i,shards:M,enabled:!p,active:c.current}},[p,c.current,M,u]);return C.createElement(S.Fragment,null,lt&&[C.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:p?-1:0,style:Fe}),W?C.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:p?-1:1,style:Fe}):null],!p&&C.createElement(V,{id:ge,sideCar:Hr,observed:u,disabled:p,persistentFocus:y,crossFrame:k,autoFocus:x,whiteList:T,shards:M,onActivation:ye,onDeactivation:Ee,returnFocus:Ae,focusOptions:Oe,noFocusGuards:w}),C.createElement(_,Be({ref:jn},st,{className:I,onBlur:G,onFocus:ke}),C.createElement($r.Provider,{value:Wn},v)),Bn&&C.createElement("div",{"data-focus-guard":!0,tabIndex:p?-1:0,style:Fe}))});Xe.propTypes={};function Gr(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var u=[],a;function i(){a=e(u.map(function(l){return l.props})),t(a)}var c=function(l){$n(f,l);function f(){return l.apply(this,arguments)||this}f.peek=function(){return a};var s=f.prototype;return s.componentDidMount=function(){u.push(this),i()},s.componentDidUpdate=function(){i()},s.componentWillUnmount=function(){var g=u.indexOf(this);u.splice(g,1),i()},s.render=function(){return C.createElement(o,this.props)},f}(S.PureComponent);return Xn(c,"displayName","SideEffect("+n(o)+")"),c}}var j=function(e){for(var t=Array(e.length),n=0;n=0}).sort(eo)},no=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],et=no.join(","),ro="".concat(et,", [data-focus-guard]"),ln=function(e,t){return j((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?ro:et)?[r]:[],ln(r))},[])},oo=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?ce([e.contentDocument.body],t):[e]},ce=function(e,t){return e.reduce(function(n,r){var o,u=ln(r,t),a=(o=[]).concat.apply(o,u.map(function(i){return oo(i,t)}));return n.concat(a,r.parentNode?j(r.parentNode.querySelectorAll(et)).filter(function(i){return i===r}):[])},[])},uo=function(e){var t=e.querySelectorAll("[".concat(Pr,"]"));return j(t).map(function(n){return ce([n])}).reduce(function(n,r){return n.concat(r)},[])},tt=function(e,t){return j(e).filter(function(n){return on(t,n)}).filter(function(n){return Xr(n)})},xt=function(e,t){return t===void 0&&(t=new Map),j(e).filter(function(n){return un(t,n)})},nt=function(e,t,n){return Ze(tt(ce(e,n),t),!0,n)},ve=function(e,t){return Ze(tt(ce(e),t),!1)},ao=function(e,t){return tt(uo(e),t)},K=function(e,t){return e.shadowRoot?K(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:j(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?K(o,t):!1}return K(n,t)})},io=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(u&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,i){return!t.has(i)})},fn=function(e){return e.parentNode?fn(e.parentNode):e},rt=function(e){var t=X(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(Ge);return n.push.apply(n,o?io(j(fn(r).querySelectorAll("[".concat(Ge,'="').concat(o,'"]:not([').concat(Kt,'="disabled"])')))):[r]),n},[])},co=function(e){try{return e()}catch{return}},pe=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?pe(t.shadowRoot):t instanceof HTMLIFrameElement&&co(function(){return t.contentWindow.document})?pe(t.contentWindow.document):t}},so=function(e,t){return e===t},lo=function(e,t){return!!j(e.querySelectorAll("iframe")).some(function(n){return so(n,t)})},dn=function(e,t){return t===void 0&&(t=pe(tn(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:rt(e).some(function(n){return K(n,t)||lo(n,t)})},fo=function(e){e===void 0&&(e=document);var t=pe(e);return t?j(e.querySelectorAll("[".concat(Lr,"]"))).some(function(n){return K(n,t)}):!1},vo=function(e,t){return t.filter(sn).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},ot=function(e,t){return sn(e)&&e.name?vo(e,t):e},po=function(e){var t=new Set;return e.forEach(function(n){return t.add(ot(n,e))}),e.filter(function(n){return t.has(n)})},St=function(e){return e[0]&&e.length>1?ot(e[0],e):e[0]},Ot=function(e,t){return e.indexOf(ot(t,e))},Qe="NEW_FOCUS",ho=function(e,t,n,r,o){var u=e.length,a=e[0],i=e[u-1],c=Je(r);if(!(r&&e.indexOf(r)>=0)){var l=r!==void 0?n.indexOf(r):-1,f=o?n.indexOf(o):l,s=o?e.indexOf(o):-1;if(l===-1)return s!==-1?s:Qe;if(s===-1)return Qe;var v=l-f,g=n.indexOf(a),p=n.indexOf(i),m=po(n),w=r!==void 0?m.indexOf(r):-1,h=o?m.indexOf(o):w,y=m.filter(function(I){return I.tabIndex>=0}),b=r!==void 0?y.indexOf(r):-1,k=o?y.indexOf(o):b,E=b>=0&&k>=0?k-b:h-w;if(!v&&s>=0||t.length===0)return s;var x=Ot(e,t[0]),A=Ot(e,t[t.length-1]);if(l<=g&&c&&Math.abs(v)>1)return A;if(l>=p&&c&&Math.abs(v)>1)return x;if(v&&Math.abs(E)>1)return s;if(l<=g)return A;if(l>p)return x;if(v)return Math.abs(v)>1?s:(u+s+v)%u}},bo=function(e){return function(t){var n,r=(n=an(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Et=function(e,t,n){var r=e.map(function(u){var a=u.node;return a}),o=xt(r.filter(bo(n)));return o&&o.length?St(o):St(xt(t))},Ve=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Ve(e.parentNode.host||e.parentNode,t),t},Te=function(e,t){for(var n=Ve(e),r=Ve(t),o=0;o=0)return u}return!1},vn=function(e,t,n){var r=X(e),o=X(t),u=r[0],a=!1;return o.filter(Boolean).forEach(function(i){a=Te(a||i,i)||a,n.filter(Boolean).forEach(function(c){var l=Te(u,c);l&&(!a||K(l,a)?a=l:a=Te(l,a))})}),a},At=function(e,t){return e.reduce(function(n,r){return n.concat(ao(r,t))},[])},mo=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(Zr)},go=function(e,t){var n=pe(X(e).length>0?document:tn(e).ownerDocument),r=rt(e).filter(ze),o=vn(n||e,e,r),u=new Map,a=ve(r,u),i=a.filter(function(p){var m=p.node;return ze(m)});if(i[0]){var c=ve([o],u).map(function(p){var m=p.node;return m}),l=mo(c,i),f=l.map(function(p){var m=p.node;return m}),s=l.filter(function(p){var m=p.tabIndex;return m>=0}).map(function(p){var m=p.node;return m}),v=ho(f,s,c,n,t);if(v===Qe){var g=Et(a,s,At(r,u))||Et(a,f,At(r,u));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return v===void 0?v:l[v]}},yo=function(e){var t=rt(e).filter(ze),n=vn(e,e,t),r=Ze(ce([n],!0),!0,!0),o=ce(t,!1);return r.map(function(u){var a=u.node,i=u.index;return{node:a,index:i,lockItem:o.indexOf(a)>=0,guard:Je(a)}})},ut=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Re=0,Le=!1,pn=function(e,t,n){n===void 0&&(n={});var r=go(e,t);if(!Le&&r){if(Re>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Le=!0,setTimeout(function(){Le=!1},1);return}Re++,ut(r.node,n.focusOptions),Re--}};function le(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var wo=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:le(n),parent:le(n.parentElement),left:le(n.previousElementSibling),right:le(n.nextElementSibling)}),n=n.parentElement;return{element:le(e),stack:t,ownerDocument:e.ownerDocument}},Co=function(e){var t,n,r,o,u;if(e)for(var a=e.stack,i=e.ownerDocument,c=new Map,l=0,f=a;l-1&&(w.filter(function(y){var b=y.guard,k=y.node;return b&&k.dataset.focusAutoGuard}).forEach(function(y){var b=y.node;return b.removeAttribute("tabIndex")}),Nt(h,w.length,1,w),Nt(h,-1,-1,w))}}}return t},wn=function(t){Ce()&&t&&(t.stopPropagation(),t.preventDefault())},ct=function(){return at(Ce)},jo=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Ro(r,n)},Wo=function(){return null},Cn=function(){it=!0},xn=function(){it=!1,he="just",at(function(){he="meanwhile"})},qo=function(){document.addEventListener("focusin",wn),document.addEventListener("focusout",ct),window.addEventListener("focus",Cn),window.addEventListener("blur",xn)},Ho=function(){document.removeEventListener("focusin",wn),document.removeEventListener("focusout",ct),window.removeEventListener("focus",Cn),window.removeEventListener("blur",xn)};function $o(e){return e.filter(function(t){var n=t.disabled;return!n})}var Sn={moveFocusInside:pn,focusInside:dn,focusNextElement:Eo,focusPrevElement:Ao,focusFirstElement:ko,focusLastElement:No,captureFocusRestore:hn};function Uo(e){var t=e.slice(-1)[0];t&&!ue&&qo();var n=ue,r=n&&t&&t.id===n.id;ue=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var u=o.id;return u===n.id}).length||n.returnFocus(!t)),t?(F=null,(!r||n.observed!==t.observed)&&t.onActivation(Sn),Ce(),at(Ce)):(Ho(),F=null)}Zt.assignSyncMedium(jo);en.assignMedium(ct);qr.assignMedium(function(e){return e(Sn)});const Go=Gr($o,Uo)(Wo);var On=S.forwardRef(function(t,n){return C.createElement(Xe,Be({sideCar:Go,ref:n},t))}),En=Xe.propTypes||{};En.sideCar;Un(En,["sideCar"]);On.propTypes={};var An={exports:{}},zo="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Qo=zo,Vo=Qo;function kn(){}function Nn(){}Nn.resetWarningCache=kn;var Yo=function(){function e(r,o,u,a,i,c){if(c!==Vo){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Nn,resetWarningCache:kn};return n.PropTypes=n,n};An.exports=Yo();var Ko=An.exports;const d=be(Ko);function _t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,a=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){i=!0,u=c},f:function(){try{a||n.return==null||n.return()}finally{if(i)throw u}}}}function R(e,t,n){return(t=In(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(e)}function ru(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t)}function _n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_n=function(){return!!e})()}function ou(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,u,a,i=[],c=!0,l=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(c=(r=u.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(f){l=!0,o=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return i}}function uu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Se(e){for(var t=1;tn.right&&(n.right=i.right),i.bottom>n.bottom&&(n.bottom=i.bottom),i.left=0+c&&o>=0+c&&r<=a-c&&n<=u-c}function vu(e){return e===document.querySelector("body")||e===document.querySelector("html")}var pu=function(t){return/(left|right)/.test(t)},Pe=function(t,n){return t>n},Me=function(t,n){return t>n},D=function(t){return t<0?0:t};function hu(e){return Object.keys(e).map(function(t){return{position:t,value:e[t]}}).sort(function(t,n){return n.value-t.value}).map(function(t){return t.position})}var Dt,bu=B.div(Dt||(Dt=P([` --reactour-accent: `,`; `,` position: fixed; transition: transform 0.3s; top: 0; left: 0; z-index: 1000000; transform: `,`; `])),function(e){return e.accentColor},function(e){return e.defaultStyles?` max-width: 331px; min-width: 150px; padding-right: 40px; border-radius: `.concat(e.rounded,`px; background-color: #fff; padding: 24px 30px; box-shadow: 0 0.5em 3em rgba(0, 0, 0, 0.3); color: inherit; `):""},function(e){var t=e.targetTop,n=e.targetRight,r=e.targetBottom,o=e.targetLeft,u=e.windowWidth,a=e.windowHeight,i=e.helperWidth,c=e.helperHeight,l=e.helperPosition,f=e.padding,s={left:o,right:u-n,top:t,bottom:a-r},v=function(h){return s[h]>(pu(h)?i+f*2:c+f*2)},g=function(h){for(var y=hu(s),b=0;bf?E:f,A=Me(t+c,a)?Me(r+f,a)?r-c:r-c+f:t-f,I=A>f?A:f,T={top:[x,t-c-f*2],right:[n+f*2,I],bottom:[x,r+f*2],left:[o-i-f*2,I],center:[u/2-i/2,a/2-c/2]};return h==="center"||v(h)?T[h]:g(T)},m=p(l);return"translate(".concat(Math.round(m[0]),"px, ").concat(Math.round(m[1]),"px)")}),Bt,mu=B.span(Bt||(Bt=P([` position: absolute; font-family: monospace; background: var(--reactour-accent); background: `,`; height: 1.875em; line-height: 2; padding-left: 0.8125em; padding-right: 0.8125em; font-size: 1em; border-radius: 1.625em; color: white; text-align: center; box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.3); top: -0.8125em; left: -0.8125em; `])),function(e){return e.accentColor}),jt,gu=B.div(jt||(jt=P([` display: flex; margin-top: 24px; align-items: center; justify-content: center; `]))),Wt,yu=B.nav(Wt||(Wt=P([` counter-reset: dot; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; `]))),qt,wu=B.button(qt||(qt=P([` counter-increment: dot; width: 8px; height: 8px; border: `,`; border-radius: 100%; padding: 0; display: block; margin: 4px; transition: opacity 0.3s, transform 0.3s; cursor: `,`; transform: scale(`,`); color: `,`; background: `,`; color: `,`; background: `,`; &:before { content: counter(dot); position: absolute; bottom: calc(100% + 0.25em); left: 50%; opacity: 0; transform: translate(-50%, 1em); transition: 0.3s; display: `,`; } &:hover { background-color: currentColor; &:before { opacity: 0.5; transform: translate(-50%, -2px); } } `])),function(e){return e.current===e.index?"0":"1px solid #caccce"},function(e){return e.disabled?"not-allowed":"pointer"},function(e){return e.current===e.index?1.25:1},function(e){return e.current===e.index?"var(--reactour-accent)":"#caccce"},function(e){return e.current===e.index?"var(--reactour-accent)":"none"},function(e){return e.current===e.index?e.accentColor:"#caccce"},function(e){return e.current===e.index?e.accentColor:"none"},function(e){return e.showNumber?"block":"none"}),Ht,Cu=B.div(Ht||(Ht=P([` opacity: `,`; color: `,`; width: 100%; left: 0; top: 0; height: 100%; position: fixed; z-index: 99999; pointer-events: none; `])),function(e){return!e.maskClassName&&.7},function(e){return!e.maskClassName&&"#000"});function Mn(e){var t=e.windowWidth,n=e.windowHeight,r=e.targetWidth,o=e.targetHeight,u=e.targetTop,a=e.targetLeft,i=e.padding,c=e.rounded,l=e.roundedStep,f=e.disableInteraction,s=e.disableInteractionClassName,v=e.className,g=e.onClick,p=e.highlightedBorder,m=D(r+i*2),w=D(o+i*2),h=D(u-i),y=D(a-i),b=l?Math.min(m/2,w/2):c;return C.createElement(Cu,{onClick:g,maskClassName:v},C.createElement("svg",{width:t,height:n,xmlns:"http://www.w3.org/2000/svg",className:v},C.createElement("defs",null,C.createElement("mask",{id:"mask-main"},C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"white"}),C.createElement("rect",{x:y,y:h,width:m,height:w,fill:"black"}),C.createElement("rect",{x:y-1,y:h-1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+b,cy:h+b,r:b,fill:"black"}),C.createElement("rect",{x:y+m-b+1,y:h-1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+m-b,cy:h+b,r:b,fill:"black"}),C.createElement("rect",{x:y-1,y:h+w-b+1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+b,cy:h+w-b,r:b,fill:"black"}),C.createElement("rect",{x:y+m-b+1,y:h+w-b+1,width:b,height:b,fill:"white"}),C.createElement("circle",{cx:y+m-b,cy:h+w-b,r:b,fill:"black "})),C.createElement("clipPath",{id:"clip-path"},C.createElement("rect",{x:0,y:0,width:t,height:h}),C.createElement("rect",{x:0,y:h,width:y,height:w}),C.createElement("rect",{x:a+r+i,y:h,width:D(t-r-y),height:w}),C.createElement("rect",{x:0,y:u+o+i,width:t,height:D(n-o-h)}))),C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"currentColor",mask:"url(#mask-main)"}),C.createElement("rect",{x:0,y:0,width:t,height:n,fill:"currentColor",clipPath:"url(#clip-path)",pointerEvents:"auto"}),C.createElement("rect",{x:y,y:h,width:m,height:w,pointerEvents:"auto",fill:"transparent",display:f?"block":"none",className:s}),p&&C.createElement("rect",{x:D(y+p.width/2),y:D(h+p.width/2),width:D(m-p.width),height:D(w-p.width),pointerEvents:"auto",fill:"none",strokeWidth:p.width,stroke:p.color,rx:b-2})))}Mn.propTypes={windowWidth:d.number.isRequired,windowHeight:d.number.isRequired,targetWidth:d.number.isRequired,targetHeight:d.number.isRequired,targetTop:d.number.isRequired,targetLeft:d.number.isRequired,padding:d.number.isRequired,rounded:d.number.isRequired,roundedStep:d.bool,disableInteraction:d.bool.isRequired,disableInteractionClassName:d.string.isRequired,highlightedBorder:d.shape({color:d.string.isRequired,width:d.number.isRequired})};var xu=function(e){var t=e.step,n=e.refresh,r=S.useState(0),o=iu(r,2),u=o[0],a=o[1];return S.useEffect(function(){if(t.resizeObservables){var i=function(v){var g=ie(v),p;try{var m=function(){var h=p.value;if(!h.attributes)return 1;var y=t.resizeObservables.find(function(b){return h.matches(b)||h.querySelector(b)!=null});y&&a(u+1)};for(g.s();!(p=g.n()).done;)m()}catch(w){g.e(w)}finally{g.f()}},c=new MutationObserver(function(s){var v=ie(s),g;try{for(v.s();!(g=v.n()).done;){var p=g.value;p.addedNodes.length!==0&&i(p.addedNodes),p.removedNodes.length!==0&&i(p.removedNodes)}}catch(m){v.e(m)}finally{v.f()}}),l=document.documentElement||document.body,f={childList:!0,subtree:!0};return c.observe(l,f),function(){c.disconnect()}}},[t,u]),S.useEffect(function(){if(t.resizeObservables){var i=new ResizeObserver(function(v){n()}),c=ie(t.resizeObservables),l;try{for(c.s();!(l=c.n()).done;){var f=l.value,s=document.querySelector(f);s&&i.observe(s)}}catch(v){c.e(v)}finally{c.f()}return function(){i.disconnect()}}},[t,u]),null},Su=function(e){var t=e.step,n=e.refresh;return S.useEffect(function(){if(t.mutationObservables){var r=function(c){var l=ie(c),f;try{var s=function(){var g=f.value;if(!g.attributes)return 1;var p=t.mutationObservables.find(function(m){return g.matches(m)||g.querySelector(m)!=null});p&&n()};for(l.s();!(f=l.n()).done;)s()}catch(v){l.e(v)}finally{l.f()}},o=new MutationObserver(function(i){var c=ie(i),l;try{for(c.s();!(l=c.n()).done;){var f=l.value;f.addedNodes.length!==0&&r(f.addedNodes),f.removedNodes.length!==0&&r(f.removedNodes)}}catch(s){c.e(s)}finally{c.f()}}),u=document.documentElement||document.body,a={childList:!0,subtree:!0};return o.observe(u,a),function(){o.disconnect()}}},[t]),null};function Ou(e){var t=e.children,n=S.useRef(null);return n.current===null&&(n.current=document.createElement("div"),n.current.setAttribute("id","___reactour")),S.useEffect(function(){return document.body.appendChild(n.current),function(){document.body.removeChild(n.current)}},[n]),zn.createPortal(t,n.current)}var Eu={disableFocusLock:d.bool,badgeContent:d.func,highlightedMaskClassName:d.string,children:d.oneOfType([d.node,d.element]),className:d.string,closeButtonAriaLabel:d.string,closeWithMask:d.bool,inViewThreshold:d.number,isOpen:d.bool.isRequired,lastStepNextButton:d.node,maskClassName:d.string,maskSpace:d.number,nextButton:d.node,onAfterOpen:d.func,onBeforeClose:d.func,onRequestClose:d.func,prevButton:d.node,scrollDuration:d.number,scrollOffset:d.number,showButtons:d.bool,showCloseButton:d.bool,showNavigation:d.bool,showNavigationNumber:d.bool,showNumber:d.bool,startAt:d.number,goToStep:d.number,getCurrentStep:d.func,nextStep:d.func,prevStep:d.func,steps:d.arrayOf(d.shape({selector:d.string,content:d.oneOfType([d.node,d.element,d.func]).isRequired,position:d.oneOfType([d.arrayOf(d.number),d.oneOf(["top","right","bottom","left","center"])]),action:d.func,style:d.object,stepInteraction:d.bool,navDotAriaLabel:d.string,roundedStep:d.bool})),update:d.string,updateDelay:d.number,disableInteraction:d.bool,disableDotsNavigation:d.bool,disableKeyboardNavigation:d.oneOfType([d.arrayOf(d.oneOf(["esc","right","left"])),d.bool]),rounded:d.number,accentColor:d.string,highlightedBorder:d.shape({color:d.string.isRequired,width:d.number.isRequired})},Au={disableFocusLock:!1,showNavigation:!0,showNavigationNumber:!0,showButtons:!0,showCloseButton:!0,closeButtonAriaLabel:"Close",showNumber:!0,scrollDuration:1,maskSpace:10,updateDelay:1,disableInteraction:!1,rounded:0,accentColor:"#007aff",closeWithMask:!0},oe={mask:{disableInteraction:"reactour__mask--disable-interaction"},helper:{base:"reactour__helper",isOpen:"reactour__helper--is-open"},dot:{base:"reactour__dot",active:"reactour__dot--is-active"}},Dn=function(e){function t(){var n;return eu(this,t),n=Zo(this,t),R(n,"unlockFocus",function(r){n.setState({focusUnlocked:!0},r())}),R(n,"showStep",function(){if(!(!n.helper||!n.helper.current)){var r=n.props.steps,o=n.state,u=o.current,a=o.focusUnlocked;a&&n.setState({focusUnlocked:!1});var i=r[u],c=i.selector?document.querySelector(i.selector):null,l=function(p){i.action&&typeof i.action=="function"&&n.unlockFocus(function(){return i.action(p)})};if(i.observe){var f=document.querySelector(i.observe),s={attributes:!0,childList:!0,characterData:!0};n.setState(function(g){return g.observer&&setTimeout(function(){g.observer.disconnect()},0),{observer:new MutationObserver(function(p){p.forEach(function(m){if(m.type==="childList"&&m.addedNodes.length>0){var w=function(){return l(m.addedNodes[0])};setTimeout(function(){return n.calculateNode(m.addedNodes[0],i,w)},100)}else if(m.type==="childList"&&m.removedNodes.length>0){var h=function(){return l(c)};n.calculateNode(c,i,h)}})})}},function(){return n.state.observer.observe(f,s)})}else n.state.observer&&(n.state.observer.disconnect(),n.setState({observer:null}));if(c){var v=function(){return l(c)};n.calculateNode(c,i,v)}else n.setState(De(null,i,n.helper.current),l),i.selector&&console.warn("Doesn't find a DOM node '".concat(i.selector,"'. Please check the 'steps' Tour prop Array at position ").concat(u,"."))}}),R(n,"calculateNode",function(r,o,u){var a=n.props,i=a.scrollDuration,c=a.inViewThreshold,l=a.scrollOffset,f=Pn(r,o),s=Math.max(document.documentElement.clientWidth,window.innerWidth||0),v=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(du(Se(Se({},f),{},{w:s,h:v,threshold:c})))n.setState(De(r,o,n.helper.current),u);else{var g=pr(r),p=l||(f.height>v?-25:-(v/2)+f.height/2);dr.to(r,{context:vu(g)?window:g,duration:i,offset:p,callback:function(w){n.setState(De(w,o,n.helper.current),u)}})}}),R(n,"recalculateNode",function(r){var o=document.querySelector(r.selector),u=function(i){r.action&&typeof r.action=="function"&&n.unlockFocus(function(){return r.action(i)})};n.calculateNode(o,r,function(){return u(o)})}),R(n,"maskClickHandler",function(r){var o=n.props,u=o.closeWithMask,a=o.onRequestClose;u&&!r.target.classList.contains(oe.mask.disableInteraction)&&a(r)}),R(n,"nextStep",function(){var r=n.props,o=r.steps,u=r.getCurrentStep;n.setState(function(a){var i=a.current0?o.current-1:o.current;return typeof r=="function"&&r(u),{current:u}},n.showStep)}),R(n,"gotoStep",function(r){var o=n.props,u=o.steps,a=o.getCurrentStep;n.setState(function(i){var c=u[r]?r:i.current;return typeof a=="function"&&a(c),{current:c}},n.showStep)}),R(n,"keyDownHandler",function(r){var o=n.props,u=o.onRequestClose,a=o.nextStep,i=o.prevStep,c=o.disableKeyboardNavigation;if(r.stopPropagation(),c!==!0){var l,f,s;c&&(l=c.includes("esc"),f=c.includes("right"),s=c.includes("left")),r.keyCode===27&&!l&&(r.preventDefault(),u()),r.keyCode===39&&!f&&(r.preventDefault(),typeof a=="function"?a():n.nextStep()),r.keyCode===37&&!s&&(r.preventDefault(),typeof i=="function"?i():n.prevStep())}}),n.state={isOpen:!1,current:0,top:0,right:0,bottom:0,left:0,width:0,height:0,w:0,h:0,inDOM:!1,observer:null,focusUnlocked:!1},n.helper=S.createRef(),n.helperElement=null,n.debouncedShowStep=Rr(n.showStep,70),n}return ru(t,e),nu(t,[{key:"componentDidMount",value:function(){var r=this.props,o=r.isOpen,u=r.startAt;o&&this.open(u)}},{key:"UNSAFE_componentWillReceiveProps",value:function(r){var o=this.props,u=o.isOpen,a=o.update,i=o.updateDelay;!u&&r.isOpen?this.open(r.startAt):u&&!r.isOpen&&this.close(),u&&a!==r.update&&(r.steps[this.state.current]?setTimeout(this.showStep,i):this.props.onRequestClose()),u&&r.isOpen&&this.state.current!==r.goToStep&&this.gotoStep(r.goToStep)}},{key:"componentWillUnmount",value:function(){var r=this.props.isOpen;r&&this.close(),this.state.observer&&this.state.observer.disconnect()}},{key:"open",value:function(r){var o=this,u=this.props.onAfterOpen;this.setState(function(a){return{isOpen:!0,current:r!==void 0?r:a.current}},function(){setTimeout(o.showStep,1),o.helperElement=o.helper.current,o.props.disableFocusLock||o.helper.current.focus(),u&&u(o.helperElement)}),window.addEventListener("resize",this.debouncedShowStep,!1),window.addEventListener("keydown",this.keyDownHandler,!1)}},{key:"close",value:function(){this.setState(function(r){return r.observer&&r.observer.disconnect(),{isOpen:!1,observer:null}},this.onBeforeClose),window.removeEventListener("resize",this.debouncedShowStep),window.removeEventListener("keydown",this.keyDownHandler)}},{key:"onBeforeClose",value:function(){var r=this.props.onBeforeClose;r&&r(this.helperElement)}},{key:"render",value:function(){var r=this,o=this.props,u=o.className,a=o.steps,i=o.maskClassName,c=o.showButtons,l=o.showCloseButton,f=o.closeButtonAriaLabel,s=o.showNavigation,v=o.showNavigationNumber,g=o.showNumber,p=o.onRequestClose,m=o.maskSpace,w=o.lastStepNextButton,h=o.nextButton,y=o.prevButton,b=o.badgeContent,k=o.highlightedMaskClassName,E=o.disableInteraction,x=o.disableDotsNavigation,A=o.nextStep,I=o.prevStep,T=o.rounded,W=o.accentColor,L=o.CustomHelper,M=o.disableFocusLock,Q=o.highlightedBorder,_=this.state,$=_.isOpen,O=_.current,V=_.inDOM,U=_.top,Z=_.right,Oe=_.bottom,ee=_.left,te=_.width,me=_.height,ge=_.w,ye=_.h,Ee=_.helperWidth,Ae=_.helperHeight,ke=_.helperPosition;return $?C.createElement(Ou,null,C.createElement(su,null),C.createElement(xu,{step:a[O],refresh:function(){return r.recalculateNode(a[O])}}),C.createElement(Su,{step:a[O],refresh:function(){return r.recalculateNode(a[O])}}),C.createElement(Mn,{onClick:this.maskClickHandler,forwardRef:function(q){return r.mask=q},windowWidth:ge,windowHeight:ye,targetWidth:te,targetHeight:me,targetTop:U,targetLeft:ee,padding:m,rounded:T,roundedStep:a[O].roundedStep,className:i,disableInteraction:a[O].stepInteraction===!1||E?!a[O].stepInteraction:E,disableInteractionClassName:"".concat(oe.mask.disableInteraction," ").concat(k),highlightedBorder:Q}),C.createElement(On,{disabled:M,autoFocus:!1},C.createElement(bu,{ref:this.helper,targetHeight:me,targetWidth:te,targetTop:U,targetRight:Z,targetBottom:Oe,targetLeft:ee,windowWidth:ge,windowHeight:ye,helperWidth:Ee,helperHeight:Ae,helperPosition:ke,padding:m,tabIndex:-1,current:O,style:a[O].style?a[O].style:{},rounded:T,className:gt(oe.helper.base,u,R({},oe.helper.isOpen,$)),accentColor:W,defaultStyles:!L,role:"dialog"},L?C.createElement(L,{current:O,totalSteps:a.length,gotoStep:this.gotoStep,close:p,content:a[O]&&(typeof a[O].content=="function"?a[O].content({close:p,goTo:this.gotoStep,inDOM:V,step:O+1}):a[O].content)},this.props.children):C.createElement(C.Fragment,null,this.props.children,a[O]&&(typeof a[O].content=="function"?a[O].content({close:p,goTo:this.gotoStep,inDOM:V,step:O+1}):a[O].content),g&&C.createElement(mu,{"data-tour-elem":"badge",accentColor:W},typeof b=="function"?b(O+1,a.length):O+1),(c||s)&&C.createElement(gu,{"data-tour-elem":"controls"},c&&C.createElement(Pt,{onClick:typeof I=="function"?I:this.prevStep,disabled:O===0,label:y||null}),s&&C.createElement(yu,{"data-tour-elem":"navigation"},a.map(function(G,q){return C.createElement(wu,{key:"".concat(G.selector?G.selector:"undef","_").concat(q),onClick:function(){return r.gotoStep(q)},current:O,index:q,accentColor:W,disabled:O===q||x,showNumber:v,"data-tour-elem":"dot",className:gt(oe.dot.base,R({},oe.dot.active,O===q)),"aria-label":G.navDotAriaLabel})})),c&&C.createElement(Pt,{onClick:O===a.length-1?w?p:function(){}:typeof A=="function"?A:this.nextStep,disabled:!w&&O===a.length-1,inverted:!0,label:w&&O===a.length-1?w:h||null})),l&&C.createElement(fu,{onClick:p,className:"reactour__close",ariaLabel:f}))))):null}}])}(S.Component),De=function(t,n,r){if(r){var o=Math.max(document.documentElement.clientWidth,window.innerWidth||0),u=Math.max(document.documentElement.clientHeight,window.innerHeight||0),a=we(r),i=a.width,c=a.height,l={top:u+10,right:o/2+9,bottom:u/2+9,left:o/2-i/2,width:0,height:0,w:o,h:u,helperPosition:"center"};return t&&(l=Pn(t,n)),function(){return Se(Se({w:o,h:u,helperWidth:i,helperHeight:c,helperPosition:n.position},l),{},{inDOM:!!t})}}};Dn.propTypes=Eu;Dn.defaultProps=Au;export{Bu as A,Dn as T,ju as a};