You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3 lines
7.4 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{OL6p:function(e,t,n){e.exports={icon:"icon-26rGYU-z"}},qZIh:function(e,t,n){"use strict";var c=n("qFKp"),o=n("q1tI"),r=n.n(o),u=n("TSYQ"),l=n.n(u),a=n("Eyy1"),i=n("3F0O"),s=n("xADF"),f=n("wHCJ"),b=n("Iivm"),p=n("OL6p"),d=n("yd0C");function h(e){return o.createElement(b.a,{className:p.icon,icon:d})}var m=n("SpAO"),v=n("wnq4");var g=n("8Rai"),O=n("Hr11");const j={0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}};function E(e,t,n){const c=[],o=n;let r=0,u=0;const l=e.length,a=o.length;let i=-1,s=0;const f=[],b=l-1,p=[];let d;for(;r<l&&u<a;){const n=e.charAt(r),l=o.charAt(u),a=j[n];a?(l.match(a.pattern)?(c.push(l),a.recursive&&(-1===i?i=r:r===b&&r!==i&&(r=i-1),b===i&&(r-=1)),r+=1):l===d?(s--,d=void 0):a.optional?(r+=1,u-=1):a.fallback?(c.push(a.fallback),r+=1,u-=1):p.push({p:u,v:l,e:a.pattern}),u+=1):(t||c.push(n),l===n?(f.push(u),u+=1):(d=n,f.push(u+s),s++),r+=1)}const h=e.charAt(b);l!==a+1||j[h]||c.push(h);const m=c.join("");return[m,function(e,t){const n={};for(let e=0;e<t.length;e++)n[t[e]+0]=1;return n}(0,f),p]}function w(e,t,n){const c=function(e){let t=!0;for(let n=0;n<e.length;n++){const c=j[e.charAt(n)];if(c&&c.recursive){t=!1;break}}return t?e.length:void 0}(e),[r,u]=E(e,!1,t),[l,i]=Object(o.useState)(r),[s,f]=Object(o.useState)(0),[b,p]=Object(o.useState)(!1),d=Object(o.useRef)(u),h=Object(o.useRef)(l);return Object(o.useEffect)(()=>{const[n,c]=E(e,!1,t);i(n),m(c)},[t,e]),Object(o.useLayoutEffect)(()=>{const e=Object(a.ensureNotNull)(n.current);b&&(e.setSelectionRange(s,s),p(!1)),f(N(e))},[b]),[t,h,{onChange:function(){const t=Object(a.ensureNotNull)(n.current),c=t.value,[o,r]=E(e,!1,c);i(o),h.current=o;const u=m(r),b=function(e,t,n,c,o,r){if(e!==t){const u=t.length,l=e.length;let a=0,i=0,s=0,f=0,b=0;for(b=c;b<u&&o[b];b++)i++;for(b=c-1;b>=0&&o[b];b--)a++;for(b=c-1;b>=0;b--)o[b]&&s++;for(b=n-1;b>=0;b--)r[b]&&f++;if(c>l)c=10*u;else if(n>=c&&n!==l){if(r[c]){const e=c;c-=f-s,o[c-=a]&&(c=e)}}else c>n&&(c+=s-f,c+=i)}return c}(l,o,s,N(t),r,u);f(b),p(!0)},onSelect:function(){const e=Object(a.ensureNotNull)(n.current);f(N(e))},maxLength:c}];function m(e){const t=d.current;return d.current=e,t}}function N(e){return e.selectionStart||0}function C(e){const{value:t,mask:n,onChange:c,...u}=e,l=Object(o.useRef)(null),[a,i,s]=w(n,t,l);return Object(o.useLayoutEffect)(()=>{void 0!==e.reference&&(e.reference.current=l.current)},[e.reference]),r.a.createElement(f.a,{...u,maxLength:s.maxLength,value:a,autoComplete:"off",reference:function(e){l.current=e},onChange:function(){s.onChange(),c(i.current)},onSelect:s.onSelect})}var S=n("/3z9"),y=n("9dlw"),x=n("N5tr"),R=n("Y7w9");const k=(()=>{const e=[];for(let t=0;t<24;++t)for(let n=0;n<60;n+=15){const[c,o]=[I(t.toString()),I(n.toString())],r=`${c}:${o}`,u=B(r)?r:F(r);e.push(u)}return e})();function L(e){let t=!1
;const n=Object(o.useRef)(null),u=Object(o.useRef)(null),i=Object(o.useRef)(null),f=Object(o.useRef)(null),[b,p]=Object(m.a)(),[d,v]=Object(o.useState)(e.value),j=A(d),E=B(j)?j:F(j),[w,N]=Object(o.useState)(E),L=b||T().some(e=>null!==e&&e.contains(document.activeElement));Object(o.useLayoutEffect)(()=>v(e.value),[e.value]),Object(o.useLayoutEffect)(()=>N(E),[d,L]),Object(o.useEffect)(()=>V(w===E?"auto":"smooth"),[w]);const I=Object(R.lowerbound)(k,E,(e,t)=>e<t);let D=k;k[I]!==E&&(D=[...k],D.splice(I,0,E));const H=Object(g.a)({mouseDown:!0,touchStart:!0,handler:function(e){null!==u.current&&L&&e.target instanceof Node&&null!==i.current&&!i.current.contains(e.target)&&u.current.blur()}});return r.a.createElement("div",{className:l()(e.className),onKeyDown:function(e){if(e.defaultPrevented)return;const t=Object(S.hashFromEvent)(e.nativeEvent);if(38===t){e.preventDefault();const t=(D.indexOf(w)+D.length-1)%D.length;N(D[t])}if(40===t){e.preventDefault();const t=(D.indexOf(w)+D.length+1)%D.length;N(D[t])}},onFocus:function(e){q(e)||p.onFocus(e)},onBlur:function(e){q(e)||p.onBlur(e)},ref:H},r.a.createElement(C,{disabled:e.disabled,name:e.name,endSlot:r.a.createElement(s.b,{icon:!0},r.a.createElement(h,null)),reference:u,containerReference:n,mask:"09:00",value:d,onFocus:function(e){setTimeout(K,0)},onBlur:function(e){q(e)||z(d)},onChange:function(t){v(t),e.onInput&&e.onInput(t)},onKeyDown:function(e){if(e.defaultPrevented)return;const t=Object(S.hashFromEvent)(e.nativeEvent);13===t&&(e.preventDefault(),z(w),Object(a.ensureNotNull)(u.current).blur());27===t&&(e.preventDefault(),Object(a.ensureNotNull)(u.current).blur())}}),r.a.createElement(y.a,{onOpen:function(){V()},onClose:function(){},position:function(){const e=Object(a.ensureNotNull)(n.current).getBoundingClientRect(),t=window.innerHeight-e.bottom,c=e.top;let o=231,r=e.bottom;if(o>c&&o>t){const n=Object(O.clamp)(o,0,c),u=Object(O.clamp)(o,0,t);o=Math.max(n,u),r=n>u?e.top-n:e.bottom}else o>t&&(r=e.top-o);return{x:e.left,y:r,overrideWidth:e.width,overrideHeight:o}},closeOnClickOutside:!1,isOpened:L,tabIndex:-1,reference:i},D.map(e=>r.a.createElement(x.b,{key:e,label:e,isActive:e===E,isHovered:e===w,reference:e===w?$:void 0,onClick:M,onClickArg:e}))));function z(n){const c=A(n),o=B(c)?c:F(c);v(o),t||(t=!0,e.onChange(o))}function $(e){f.current=e}function M(e){if(z(Object(a.ensureDefined)(e)),c.isIE){const e=window.document.activeElement;e instanceof Node&&HTMLElement.prototype.blur.call(e)}else Object(a.ensureNotNull)(i.current).blur()}function q(e){return b&&(null!==J(document.activeElement)||null!==J(e.relatedTarget))}function J(e){return e instanceof Node&&T().find(t=>null!==t&&t.contains(e))||null}function T(){return[i.current,u.current]}function V(e="auto"){if(null!==f.current){const t=Object(a.ensureNotNull)(i.current).getBoundingClientRect(),n=f.current.getBoundingClientRect();(t.top>n.top||t.bottom<n.bottom)&&f.current.scrollIntoView({behavior:e})}}function K(){const e=u.current;if(null!==e){const t=e.value||"";e.setSelectionRange(0,t.length)}}}function A(e){
const[t="",n=""]=e.split(":"),[c,o]=[I(t),D(n)];return`${c}:${o}`}function B(e){return/^(0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/g.test(e)}function F(e){const[t,n]=e.split(":"),[c,o]=[Object(O.clamp)(parseInt(t),0,23),Object(O.clamp)(parseInt(n),0,59)],[r,u]=[I(c.toString()),D(o.toString())];return`${r}:${u}`}function I(e){return e.slice(0,2).padStart(2,"0")}function D(e){return e.slice(0,2).padEnd(2,"0")}n.d(t,"a",(function(){return H}));const H=c.CheckMobile.any()?function(e){const{onChange:t,onFocus:n,value:c,className:u,...b}=e,p=Object(o.useRef)(null),[d,g]=Object(m.a)(),O=Object(i.a)(g.onBlur,(function(){p.current&&c&&(p.current.defaultValue=c)}));return Object(o.useLayoutEffect)(()=>{p.current&&c&&(p.current.defaultValue=c)},[]),Object(o.useLayoutEffect)(()=>{p.current&&c&&(p.current.value=c)},[c]),r.a.createElement("div",{className:l()(v.wrap,u)},r.a.createElement(f.a,{...b,type:"text",endSlot:r.a.createElement(s.b,{icon:!0},r.a.createElement(h,null)),value:c,highlight:d,intent:d?"primary":void 0,onFocus:function(e){Object(a.ensureNotNull)(p.current).focus(),n&&n(e)},onChange:function(){}}),r.a.createElement("input",{...g,disabled:e.disabled,className:v.input,type:"time",onBlur:O,onChange:function(e){const{value:n}=e.currentTarget;t&&n&&t(n)},ref:p}))}:L},wnq4:function(e,t,n){e.exports={wrap:"wrap-3JkbcgoB",input:"input-3JkbcgoB"}},yd0C:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path fill="currentColor" d="M1 8.5a7.5 7.5 0 1 1 15 0 7.5 7.5 0 0 1-15 0zM8.5 0a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17zM9 9V3H8v5H5v1h4z"/></svg>'}}]);