tweb/public/325.977514b16cbc045987c7.ch...

2 lines
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[325,272],{9807:(e,t,s)=>{s.d(t,{Z:()=>l});var i=s(4687),n=s(1405),o=s(4727),r=s(9750);class l{constructor(e={}){const t=this.label=document.createElement("label");t.classList.add("checkbox-field"),e.restriction&&t.classList.add("checkbox-field-restriction"),e.round&&t.classList.add("checkbox-field-round"),e.disabled&&this.toggleDisability(!0);const s=this.input=document.createElement("input");let l;if(s.classList.add("checkbox-field-input"),s.type="checkbox",e.name&&(s.id="input-"+e.name),e.checked&&(s.checked=!0),e.stateKey&&i.default.getState().then((t=>{const n=(0,r.Z)(t,e.stateKey);let o;o=e.stateValues?1===e.stateValues.indexOf(n):n,this.setValueSilently(o),s.addEventListener("change",(()=>{let t;t=e.stateValues?e.stateValues[s.checked?1:0]:s.checked,i.default.setByKey(e.stateKey,t)}))})),e.text?(l=this.span=document.createElement("span"),l.classList.add("checkbox-caption"),(0,o._i18n)(l,e.text,e.textArgs)):t.classList.add("checkbox-without-caption"),t.append(s),e.toggle){t.classList.add("checkbox-field-toggle");const e=document.createElement("div");e.classList.add("checkbox-toggle"),t.append(e)}else{const e=document.createElement("div");e.classList.add("checkbox-box");const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.classList.add("checkbox-box-check"),s.setAttributeNS(null,"viewBox","0 0 24 24");const i=document.createElementNS("http://www.w3.org/2000/svg","use");i.setAttributeNS(null,"href","#check"),i.setAttributeNS(null,"x","-1"),s.append(i);const n=document.createElement("div");n.classList.add("checkbox-box-background");const o=document.createElement("div");o.classList.add("checkbox-box-border"),e.append(o,n,s),t.append(e)}l&&t.append(l),e.withRipple?(t.classList.add("checkbox-ripple","hover-effect"),(0,n.ripple)(t,void 0,void 0,!0)):e.withHover&&t.classList.add("hover-effect")}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e);const t=new Event("change",{bubbles:!0,cancelable:!0});this.input.dispatchEvent(t)}setValueSilently(e){this.input.checked=e}toggleDisability(e){return this.label.classList.toggle("checkbox-disabled",e),()=>this.toggleDisability(!e)}}},8805:(e,t,s)=>{s.d(t,{ZP:()=>a,v7:()=>h});var i=s(5432),n=s(5003),o=s(4789),r=s(8594),l=s(3910);class c{constructor(e,t="",s=document.createElement("div")){this.el=e,this.container=s,this.onScrollMeasure=0,this.lastScrollPosition=0,this.lastScrollDirection=0,this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation=!1,this.onScroll=()=>{if(this.isHeavyAnimationInProgress)return this.onScrollMeasure&&window.cancelAnimationFrame(this.onScrollMeasure),void(this.needCheckAfterAnimation=!0);(this.onScrolledTop||this.onScrolledBottom||this.splitUp||this.onAdditionalScroll)&&(this.onScrollMeasure&&window.cancelAnimationFrame(this.onScrollMeasure),this.onScrollMeasure=window.requestAnimationFrame((()=>{this.onScrollMeasure=0;const e=this.container[this.scrollProperty];this.lastScrollDirection=this.lastScrollPosition===e?0:this.lastScrollPosition<e?1:-1,this.lastScrollPosition=e,this.onAdditionalScroll&&0!==this.lastScrollDirection&&this.onAdditionalScroll(),this.checkForTriggers&&this.checkForTriggers()})))},this.container.classList.add("scrollable"),this.log=(0,n.kg)("SCROLL"+(t?"-"+t:""),n.v9.Error),e&&(Array.from(e.children).forEach((e=>this.container.append(e))),e.append(this.container))}setListeners(){this.removeHeavyAnimationListener||(window.addEventListener("resize",this.onScroll,{passive:!0}),this.container.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}),this.removeHeavyAnimationListener=(0,r.ZP)((()=>{this.isHeavyAnimationInProgress=!0,this.onScrollMeasure&&(this.needCheckAfterAnimation=!0,window.cancelAnimationFrame(this.onScrollMeasure))}),(()=>{this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation&&(this.onScroll(),this.needCheckAfterAnimation=!1)})))}removeListeners(){this.removeHeavyAnimationListener&&(window.removeEventListener("resize",this.onScroll),this.container.removeEventListener("scroll",this.onScroll,{capture:!0}),this.removeHeavyAnimationListener())}append(e){this.container.append(e)}scrollIntoViewNew(e){return(0,o.Z)(Object.assign(Object.assign({},e),{container:this.container}))}}class a extends c{constructor(e,t="",s=300,i){super(e,t),this.onScrollOffset=s,this.loadedAll={top:!0,bottom:!1},this.checkForTriggers=()=>{if(!this.onScrolledTop&&!this.onScrolledBottom)return;if(this.isHeavyAnimationInProgress)return void this.onScroll();const e=this.container.scrollHeight;if(!e)return;const t=e-this.container.clientHeight,s=this.lastScrollPosition;this.onScrolledTop&&s<=this.onScrollOffset&&this.lastScrollDirection<=0&&this.onScrolledTop(),this.onScrolledBottom&&t-s<=this.onScrollOffset&&this.lastScrollDirection>=0&&this.onScrolledBottom()},this.container.classList.add("scrollable-y"),this.setListeners(),this.scrollProperty="scrollTop"}setVirtualContainer(e){this.splitUp=e,this.log("setVirtualContainer:",e,this)}prepend(...e){(this.splitUp||this.padding||this.container).prepend(...e)}append(...e){(this.splitUp||this.padding||this.container).append(...e)}getDistanceToEnd(){return this.scrollHeight-Math.round(this.scrollTop+this.container.offsetHeight)}get isScrolledDown(){return this.getDistanceToEnd()<=1}set scrollTop(e){this.container.scrollTop=e}get scrollTop(){return this.container.scrollTop}get scrollHeight(){return this.container.scrollHeight}}class h extends c{constructor(e,t="",s=300,n=15,o=document.createElement("div")){if(super(e,t,o),this.onScrollOffset=s,this.splitCount=n,this.container=o,this.container.classList.add("scrollable-x"),!i.IS_TOUCH_SUPPORTED){const e=e=>{!e.deltaX&&this.container.scrollWidth>this.container.clientWidth&&(this.container.scrollLeft+=e.deltaY/4,(0,l.d)(e))};this.container.addEventListener("wheel",e,{passive:!1})}this.scrollProperty="scrollLeft"}}},709:(e,t,s)=>{s.d(t,{Z:()=>l});var i=s(2398),n=s(6272),o=s(4762),r=s(503);class l extends r.Z{constructor(e={}){super(Object.assign({label:"Contacts.PhoneNumber.Placeholder",name:"phone"},e)),this.pasted=!1,this.lastValue="",this.container.classList.add("input-field-phone");let t=this.input;if(t instanceof HTMLInputElement)t.type="tel",t.autocomplete="rr55RandomRR55";else{t.inputMode="decimal";const e=window.devicePixelRatio;if(e>1){let s;o.IS_APPLE?s=-.16*e:o.IS_ANDROID&&(s=0),t.style.setProperty("--letter-spacing",s+"px")}const s=this.setValueSilently.bind(this);this.setValueSilently=e=>{s(e),(0,i.Z)(this.input,!0)}}t.addEventListener("input",(()=>{t.classList.remove("error");const s=this.value;let i;Math.abs(s.length-this.lastValue.length)>1&&!this.pasted&&o.IS_APPLE_MOBILE&&this.setValueSilently(this.lastValue+s),this.pasted=!1,this.setLabel();let r,l,c,a="";"+"===this.value.replace(/\++/,"+")?this.setValueSilently("+"):(i=(0,n.u)(this.value),r=i.formatted,l=i.country,a=i.leftPattern,c=i.code,this.setValueSilently(this.lastValue=r?"+"+r:"")),t.dataset.leftPattern=a,e.onInput&&e.onInput(i)})),t.addEventListener("paste",(()=>{this.pasted=!0})),t.addEventListener("keypress",(e=>{const t=e.key;if(/\D/.test(t)&&!e.metaKey&&!e.ctrlKey&&"Backspace"!==t&&("+"!==t||!e.shiftKey))return e.preventDefault(),!1}))}}},3019:(e,t,s)=>{function i(e,t){return new Promise((s=>{const i=new FileReader;i.addEventListener("loadend",(e=>{s(e.target.result)})),i[t](e)}))}s.d(t,{Z:()=>i})},8150:(e,t,s)=>{s.d(t,{Z:()=>n});var i=s(3019);function n(e){return(0,i.Z)(e,"readAsArrayBuffer")}},7151:(e,t,s)=>{s.d(t,{Z:()=>n});var i=s(8150);function n(e){return(0,i.Z)(e).then((e=>new Uint8Array(e)))}},4668:(e,t,s)=>{function i(e,t){return e.closest(t)}s.d(t,{Z:()=>i})},2398:(e,t,s)=>{s.d(t,{Z:()=>n});var i=s(5432);function n(e,t=!1){if(!i.IS_TOUCH_SUPPORTED||t&&document.activeElement===e)if(e.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var s=document.createRange();s.selectNodeContents(e),s.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(s)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(e),o.collapse(!1),o.select()}}},1656:(e,t,s)=>{function i(e,t){return t?e.forEach((e=>e.setAttribute("disabled","true"))):e.forEach((e=>e.removeAttribute("disabled"))),()=>i(e,!t)}s.d(t,{Z:()=>i})},6272:(e,t,s)=>{s.d(t,{u:()=>l});var i=s(4727);const n=new Map;let o=0;const r=(e,t,s="")=>{s=t.country_code+s,o=Math.max(o,s.length),n.set(s,{country:e,code:t})};function l(e){e=e||"",n.size||i.default.countriesList.forEach((e=>{e.country_codes.forEach((t=>{t.prefixes?t.prefixes.forEach((s=>{r(e,t,s)})):r(e,t)}))}));let t,s=e.replace(/\D/g,""),l=s.slice(0,o);for(let e=l.length-1;e>=0&&(t=n.get(l.slice(0,e+1)),!t);--e);if(!t)return{formatted:s,country:void 0,code:void 0,leftPattern:""};const c=t.country,a=t.code.patterns||[],h=s.slice(t.code.country_code.length);let d="",u=0,p="";for(let e=a.length-1;e>=0;--e){d=a[e];const t=d.replace(/ /g,"");let s=0;for(let e=0,i=Math.min(h.length,t.length);e<i;++e){if(h[e]!==t[e]&&"X"!==t[e]){s=0;break}++s}s>u&&(u=s,p=d)}d=p||d,d=d.replace(/\d/g,"X"),d=t.code.country_code+" "+d,d.split("").forEach(((e,t)=>{" "===e&&" "!==s[t]&&s.length>t&&(s=s.slice(0,t)+" "+s.slice(t))}));let m=d&&d.length>s.length?d.slice(s.length):"";return m&&(m=m.replace(/X/g,"")),{formatted:s,country:c,code:t.code,leftPattern:m}}},8576:(e,t,s)=>{s.d(t,{Z:()=>r});var i=s(1267),n=s(8975),o=s(2328);class r{constructor(e){this.dbName=e,this.useStorage=!0,i.Z.test&&(this.dbName+="_test"),r.STORAGES.length&&(this.useStorage=r.STORAGES[0].useStorage),this.openDatabase(),r.STORAGES.push(this)}openDatabase(){var e;return null!==(e=this.openDbPromise)&&void 0!==e?e:this.openDbPromise=caches.open(this.dbName)}delete(e){return this.timeoutOperation((t=>t.delete("/"+e)))}deleteAll(){return caches.delete(this.dbName)}get(e){return this.timeoutOperation((t=>t.match("/"+e)))}save(e,t){return this.timeoutOperation((s=>s.put("/"+e,t)))}getFile(e,t="blob"){return this.get(e).then((e=>{if(!e)throw"NO_ENTRY_FOUND";return e[t]()}))}saveFile(e,t){t instanceof Blob||(t=(0,n.Z)(t));const s=new Response(t,{headers:{"Content-Length":""+t.size}});return this.save(e,s).then((()=>t))}timeoutOperation(e){return this.useStorage?new Promise(((t,s)=>{return i=this,n=void 0,r=function*(){let i=!1;const n=setTimeout((()=>{s(),i=!0}),15e3);try{const s=yield this.openDatabase();if(!s)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const n=yield e(s);if(i)return;t(n)}catch(e){s(e)}clearTimeout(n)},new((o=void 0)||(o=Promise))((function(e,t){function s(e){try{c(r.next(e))}catch(e){t(e)}}function l(e){try{c(r.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(s,l)}c((r=r.apply(i,n||[])).next())}));var i,n,o,r})):Promise.reject("STORAGE_OFFLINE")}getFileWriter(e,t){const s=o.Z.getFakeFileWriter(t,(t=>this.saveFile(e,t).catch((()=>t))));return Promise.resolve(s)}static toggleStorage(e){return Promise.all(this.STORAGES.map((t=>{if(t.useStorage=e,!e)return t.deleteAll()})))}}r.STORAGES=[]},2328:(e,t,s)=>{s.d(t,{Z:()=>o});var i=s(8975),n=s(7151);const o=new class{constructor(){this.blobSupported=!0;try{(0,i.Z)([],"")}catch(e){this.blobSupported=!1}}isAvailable(){return this.blobSupported}write(e,t){return t instanceof Blob?(0,n.Z)(t).then((t=>e.write(t))):e.write(t)}getFakeFileWriter(e,t){const s=[];return{write:e=>{return t=this,i=void 0,o=function*(){if(!this.blobSupported)throw!1;s.push(e)},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function l(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var s;t.done?e(t.value):(s=t.value,s instanceof n?s:new n((function(e){e(s)}))).then(r,l)}c((o=o.apply(t,i||[])).next())}));var t,i,n,o},truncate:()=>{s.length=0},finalize:(n=!0)=>{const o=(0,i.Z)(s,e);return n&&t&&t(o),o}}}}}}]);
//# sourceMappingURL=325.977514b16cbc045987c7.chunk.js.map