aptechka 0.90.3 → 0.90.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),_CSSValueParser=class _CSSValueParser{parse(value,element){var _a;const num=parseFloat(value),isNumber=!isNaN(num),unit=isNumber?(_a=value.match(/[a-z]+$/i))==null?void 0:_a[0]:void 0;return isNumber&&!unit?num:unit?unit==="px"?num:unit==="oh"?((element==null?void 0:element.offsetHeight)||0)*(num/100):unit==="ow"?((element==null?void 0:element.offsetWidth)||0)*(num/100):unit==="ohmh"?(((element==null?void 0:element.offsetHeight)||0)-Viewport.viewport.height)*(num/100):unit==="owmw"?(((element==null?void 0:element.offsetWidth)||0)-Viewport.viewport.width)*(num/100):unit&&_CSSValueParser.CSS_UNITS.has(unit)?cssUnitParser_index.cssUnitParser.parse(value,element):value:value.includes("calc")?value.includes("raw!")?value.replace("raw!",""):cssUnitParser_index.cssUnitParser.parse(value):value==="true"?!0:value==="false"?!1:value}};__name(_CSSValueParser,"CSSValueParser"),_CSSValueParser.CSS_UNITS=new Set(["px","rem","vw","vh","vmin","vmax","em","cm","mm","Q","in","pc","pt","ex","ch","lh","rlh","vb","vi","svw","svh","lvw","lvh","dvw","dvh"]);let CSSValueParser=_CSSValueParser;const cssValueParser=new CSSValueParser;exports.cssValueParser=cssValueParser;
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-Blxv_yl_.cjs"),_CSSValueParser=class _CSSValueParser{parse(value,element){var _a;const num=parseFloat(value),isNumber=!isNaN(num),unit=isNumber?(_a=value.match(/[a-z]+$/i))==null?void 0:_a[0]:void 0;return isNumber&&!unit?num:unit?unit==="px"?num:unit==="oh"?((element==null?void 0:element.offsetHeight)||0)*(num/100):unit==="ow"?((element==null?void 0:element.offsetWidth)||0)*(num/100):unit==="ohmh"?(((element==null?void 0:element.offsetHeight)||0)-Viewport.viewport.height)*(num/100):unit==="owmw"?(((element==null?void 0:element.offsetWidth)||0)-Viewport.viewport.width)*(num/100):unit&&_CSSValueParser.CSS_UNITS.has(unit)?cssUnitParser_index.cssUnitParser.parse(value,element):value:value.includes("calc")?value.includes("raw!")?value.replace("raw!",""):cssUnitParser_index.cssUnitParser.parse(value,element):value==="true"?!0:value==="false"?!1:value}};__name(_CSSValueParser,"CSSValueParser"),_CSSValueParser.CSS_UNITS=new Set(["px","rem","vw","vh","vmin","vmax","em","cm","mm","Q","in","pc","pt","ex","ch","lh","rlh","vb","vi","svw","svh","lvw","lvh","dvw","dvh"]);let CSSValueParser=_CSSValueParser;const cssValueParser=new CSSValueParser;exports.cssValueParser=cssValueParser;
@@ -6,7 +6,7 @@ const _CSSValueParser = class _CSSValueParser {
6
6
  parse(value, element) {
7
7
  var _a;
8
8
  const num = parseFloat(value), isNumber = !isNaN(num), unit = isNumber ? (_a = value.match(/[a-z]+$/i)) == null ? void 0 : _a[0] : void 0;
9
- return isNumber && !unit ? num : unit ? unit === "px" ? num : unit === "oh" ? ((element == null ? void 0 : element.offsetHeight) || 0) * (num / 100) : unit === "ow" ? ((element == null ? void 0 : element.offsetWidth) || 0) * (num / 100) : unit === "ohmh" ? (((element == null ? void 0 : element.offsetHeight) || 0) - viewport.height) * (num / 100) : unit === "owmw" ? (((element == null ? void 0 : element.offsetWidth) || 0) - viewport.width) * (num / 100) : unit && _CSSValueParser.CSS_UNITS.has(unit) ? cssUnitParser.parse(value, element) : value : value.includes("calc") ? value.includes("raw!") ? value.replace("raw!", "") : cssUnitParser.parse(value) : value === "true" ? !0 : value === "false" ? !1 : value;
9
+ return isNumber && !unit ? num : unit ? unit === "px" ? num : unit === "oh" ? ((element == null ? void 0 : element.offsetHeight) || 0) * (num / 100) : unit === "ow" ? ((element == null ? void 0 : element.offsetWidth) || 0) * (num / 100) : unit === "ohmh" ? (((element == null ? void 0 : element.offsetHeight) || 0) - viewport.height) * (num / 100) : unit === "owmw" ? (((element == null ? void 0 : element.offsetWidth) || 0) - viewport.width) * (num / 100) : unit && _CSSValueParser.CSS_UNITS.has(unit) ? cssUnitParser.parse(value, element) : value : value.includes("calc") ? value.includes("raw!") ? value.replace("raw!", "") : cssUnitParser.parse(value, element) : value === "true" ? !0 : value === "false" ? !1 : value;
10
10
  }
11
11
  };
12
12
  __name(_CSSValueParser, "CSSValueParser"), _CSSValueParser.CSS_UNITS = /* @__PURE__ */ new Set([
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attributes=require("../attributes-BADnRZpK.cjs"),Store=require("../Store-B96mD8mD.cjs"),canvas=require("../canvas-BP1ceie3.cjs"),coordinates=require("../coordinates-DQ9XV9M1.cjs"),customElements=require("../custom-elements-BfZCJde6.cjs"),dom=require("../dom-B40i6NXw.cjs"),Tweened=require("../Tweened--KJh27xY.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),file=require("../file-RHfA3OS-.cjs"),_function=require("../function-H4b_gTg6.cjs"),gestures=require("../gestures-DtYbQr49.cjs"),stylesheet=require("../stylesheet-DQv6_0na.cjs"),layout=require("../layout-CnGLl7oe.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),metadata=require("../metadata-BrHUfpV9.cjs"),morph=require("../morph-Buhxq-X0.cjs"),number=require("../number-Bu4sGvW7.cjs"),object=require("../object-DTY_W6xG.cjs"),polyfills=require("../polyfills-DZCuDBkA.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-BAlaPfiQ.cjs"),style=require("../style-IDJ6db6n.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),url=require("../url-CPCO10Sy.cjs");function insert(arr,index,...newItems){return[...arr.slice(0,index),...newItems,...arr.slice(index)]}__name(insert,"insert");function shiftArray(arr,positions){const len=arr.length;positions=positions%len;const result=new Array(len);for(let i=0;i<len;i++){const newPos=(i+positions)%len;result[newPos]=arr[i]}return result}__name(shiftArray,"shiftArray");function formatBytes(bytes,decimals=2){if(!+bytes)return"0 Bytes";const k=1024,dm=decimals<0?0:decimals,sizes=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(bytes)/Math.log(k));return`${parseFloat((bytes/Math.pow(k,i)).toFixed(dm))} ${sizes[i]}`}__name(formatBytes,"formatBytes");function copyTextToClipboard(text){if(navigator.clipboard)navigator.clipboard.writeText(text).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(err=>{console.error("Failed to copy text to clipboard:",err)});else{const textArea=document.createElement("textarea");textArea.value=text,textArea.style.position="fixed",textArea.style.top="0",textArea.style.left="0",document.body.appendChild(textArea),textArea.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(err){console.error("Failed to copy text to clipboard:",err)}document.body.removeChild(textArea)}}__name(copyTextToClipboard,"copyTextToClipboard");function dotRectCollision(dot,rect){return dot.x<rect.x+rect.width&&dot.x>rect.x&&dot.y<rect.y+rect.height&&dot.y>rect.y}__name(dotRectCollision,"dotRectCollision");function dotCircleCollision(dot,circle){return Math.sqrt((dot.x-circle.x)**2+(dot.y-circle.y)**2)<circle.radius}__name(dotCircleCollision,"dotCircleCollision");function dotPolygonCollision(dot,polygon){let inside=!1;const{x,y}=dot;for(let i=0,j=polygon.length-1;i<polygon.length;j=i++){const xi=polygon[i].x,yi=polygon[i].y,xj=polygon[j].x,yj=polygon[j].y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(dotPolygonCollision,"dotPolygonCollision");function rgbToHex(r,g,b){const toHex=__name(c=>{const hex=c.toString(16);return hex.length===1?"0"+hex:hex},"toHex");return`#${toHex(r)}${toHex(g)}${toHex(b)}`}__name(rgbToHex,"rgbToHex");function getStyleRuleActualValue(rule,name){const obj=rule.style.getPropertyValue(name);if(obj){const stringValue=obj.toString();return stringValue.startsWith("var")?getStyleRuleActualValue(rule,stringValue.slice(4,-1)):stringValue}}__name(getStyleRuleActualValue,"getStyleRuleActualValue");function getRootVariables(...names){const variables={};return Array.from(document.styleSheets).forEach(stylesheet2=>{Array.from(stylesheet2.cssRules).forEach(rule=>{rule instanceof CSSStyleRule&&rule.selectorText===":root"&&names.forEach(name=>{const value=getStyleRuleActualValue(rule,name);value&&(variables[name]=value)})})}),names.forEach(name=>{variables[name]||console.warn(`variable named ${name} not found`)}),variables}__name(getRootVariables,"getRootVariables");function encode(string){const decodedStr=window.atob(string);return decodeURIComponent(window.escape(decodedStr))}__name(encode,"encode");function decode(string){const encodedStr=window.unescape(encodeURIComponent(string));return window.btoa(encodedStr)}__name(decode,"decode");const phoneRegex=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,emailRegex=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function tryCreateHrefFromContact(contact){let href,type;return emailRegex.test(contact)?(href=`mailto:${contact.trim()}`,type="email"):phoneRegex.test(contact)&&(href=`tel:${contact.replace(/[^0-9\\.\\+]+/g,"")}`,type="phone"),{href,type,contact}}__name(tryCreateHrefFromContact,"tryCreateHrefFromContact");function transliterate(text,options={}){const{separator="-",lowercase=!0,replaceNumbers=!0,maxLength=60}=options,charMap={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"};let result=text.replace(/[а-яё]/gi,char=>{const lowerChar=char.toLowerCase(),replacement=charMap[lowerChar]||"";return char===lowerChar?replacement:replacement.toUpperCase()});if(replaceNumbers){const numberMap={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};result=result.replace(/[0-9]/g,num=>numberMap[num]||num)}return lowercase&&(result=result.toLowerCase()),result=result.replace(/[^\w\-]+/g,separator).replace(new RegExp(`\\${separator}+`,"g"),separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`,"g"),""),maxLength>0&&result.length>maxLength&&(result=result.substring(0,maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`),"")),result}__name(transliterate,"transliterate");function splitPropgress(progress,items,initialItemsWithFullProgress=0){const totalItems=items-initialItemsWithFullProgress,splitted=[];for(let item=0;item<items;item++){const offset=item/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));splitted.push(itemProgress)}return splitted}__name(splitPropgress,"splitPropgress");function setElementsProgress(progress,elements,initialItemsWithFullProgress=0){const totalItems=elements.length-initialItemsWithFullProgress;elements.forEach((el,index)=>{const offset=index/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));el.style.setProperty("--item-progress",itemProgress.toString())})}__name(setElementsProgress,"setElementsProgress");function setActiveContentClasses(index,elements){elements.forEach((el,i)=>{i>index?(el.classList.remove("current","previous"),el.classList.add("next")):i<index?(el.classList.remove("current","next"),el.classList.add("previous")):(el.classList.remove("previous","next"),el.classList.add("current"))})}__name(setActiveContentClasses,"setActiveContentClasses");function cloneTemplateContent(templateElement,callback){if(templateElement){const element2=templateElement.content.cloneNode(!0).firstElementChild;return element2&&(callback==null||callback(element2)),element2}return null}__name(cloneTemplateContent,"cloneTemplateContent");function setIntervalOnIntersection(element2,delay,callback,options){let intervalId,isIntersecting=!1,current=0,previous=0,tickerUnsubsribe;const toggleInterval=__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe(),options!=null&&options.restartCounter&&(current=0),isIntersecting&&(callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker(),intervalId=setInterval(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),current++,callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker()},delay))},"toggleInterval"),restartTicker=__name(()=>ticker_index.ticker.subscribe(e=>{const progress=e.timeElapsedSinceSubscription/delay;callback({current,previous,progress})}),"restartTicker"),intersectorUnsubscribe=ticker_index.intersector.subscribe(element2,e=>{isIntersecting=e.isIntersecting,toggleInterval()});return{destroy:__name(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),intersectorUnsubscribe(),clearInterval(intervalId)},"destroy"),restart:__name((currentValue,previousValue)=>{current=currentValue||0,previousValue&&(previous=previousValue),toggleInterval()},"restart"),stop:__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe()},"stop")}}__name(setIntervalOnIntersection,"setIntervalOnIntersection");exports.getElementAttributesAdvanced=attributes.getElementAttributesAdvanced;exports.parseAttribute=attributes.parseAttribute;exports.parseAttributeValue=attributes.parseAttributeValue;exports.parseAttributeValueAdvanced=attributes.parseAttributeValueAdvanced;exports.camelToKebab=Store.camelToKebab;exports.capitalize=Store.capitalize;exports.declension=Store.declension;exports.decodeHtmlEntities=Store.decodeHtmlEntities;exports.generateId=Store.generateId;exports.getRandomChar=Store.getRandomChar;exports.isBrowser=Store.isBrowser;exports.isUppercase=Store.isUppercase;exports.kebabToCamel=Store.kebabToCamel;exports.snakeToDotted=Store.snakeToDotted;exports.toPascalCase=Store.toPascalCase;exports.uncapitalize=Store.uncapitalize;exports.contain=canvas.contain;exports.cover=canvas.cover;exports.fixPosition=canvas.fixPosition;exports.measureText=canvas.measureText;exports.getPointerPosition=coordinates.getPointerPosition;exports.normalize=coordinates.normalize;exports.screenToCartesian=coordinates.screenToCartesian;exports.whenDefined=customElements.whenDefined;exports.createScriptElement=dom.createScriptElement;exports.deepQuerySelectorAll=dom.deepQuerySelectorAll;exports.excludeElements=dom.excludeElements;exports.findParentElement=dom.findParentElement;exports.findScrollParentElement=dom.findScrollParentElement;exports.getAllParentElements=dom.getAllParentElements;exports.getElement=dom.getElement;exports.intersectElements=dom.intersectElements;exports.traverseNodes=dom.traverseNodes;exports.traverseShadowRoots=dom.traverseShadowRoots;exports.easeInCubic=Tweened.easeInCubic;exports.easeInExpo=Tweened.easeInExpo;exports.easeInOutCubic=Tweened.easeInOutCubic;exports.easeInOutExpo=Tweened.easeInOutExpo;exports.easeInOutQuad=Tweened.easeInOutQuad;exports.easeInOutQuart=Tweened.easeInOutQuart;exports.easeInOutQuint=Tweened.easeInOutQuint;exports.easeInQuad=Tweened.easeInQuad;exports.easeInQuart=Tweened.easeInQuart;exports.easeInQuint=Tweened.easeInQuint;exports.easeOutCubic=Tweened.easeOutCubic;exports.easeOutExpo=Tweened.easeOutExpo;exports.easeOutQuad=Tweened.easeOutQuad;exports.easeOutQuart=Tweened.easeOutQuart;exports.easeOutQuint=Tweened.easeOutQuint;exports.easings=Tweened.easings;exports.linear=Tweened.linear;exports.isElementVisible=element.isElementVisible;exports.dispatchEvent=events.dispatchEvent;exports.createJSONAndSave=file.createJSONAndSave;exports.downloadURI=file.downloadURI;exports.debounce=_function.debounce;exports.throttle=_function.throttle;exports.setupDrag=gestures.setupDrag;exports.createStylesheet=stylesheet.createStylesheet;exports.styleToString=stylesheet.styleToString;exports.getCumulativeOffsetLeft=layout.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=layout.getCumulativeOffsetTop;exports.getCumulativePosition=layout.getCumulativePosition;exports.getStickyOffset=layout.getStickyOffset;exports.requestLoadingCallback=loading.requestLoadingCallback;exports.calculateDistance=math.calculateDistance;exports.calculateDistanceWithRadius=math.calculateDistanceWithRadius;exports.clamp=math.clamp;exports.damp=math.damp;exports.lerp=math.lerp;exports.mapRange=math.mapRange;exports.round=math.round;exports.smootherstep=math.smootherstep;exports.smoothstep=math.smoothstep;exports.step=math.step;exports.formatMediaDuration=metadata.formatMediaDuration;exports.ACTION_CREATE=morph.ACTION_CREATE;exports.ACTION_PRESERVE=morph.ACTION_PRESERVE;exports.ACTION_REMOVE=morph.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=morph.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=morph.ACTION_REPLACE;exports.ACTION_SET_ATTR=morph.ACTION_SET_ATTR;exports.ACTION_SKIP=morph.ACTION_SKIP;exports.ACTION_UPDATE=morph.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=morph.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=morph.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=morph.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=morph.NODE_TYPE_TEXT;exports.diff=morph.diff;exports.morph=morph.morph;exports.patch=morph.patch;exports.beautifyNumber=number.beautifyNumber;exports.loopNumber=number.loopNumber;exports.preciseNumber=number.preciseNumber;exports.roundNumberTo=number.roundNumberTo;exports.toStep=number.toStep;exports.cloneDeep=object.cloneDeep;exports.compareObjects=object.compareObjects;exports.isESClass=object.isESClass;exports.isNullish=object.isNullish;exports.isObject=object.isObject;exports.mergeDeep=object.mergeDeep;exports.mixin=object.mixin;exports.omit=object.omit;exports.pick=object.pick;exports.nullishCoalescing=polyfills.nullishCoalescing;exports.requestIdleCallback=polyfills.requestIdleCallback;exports.wait=promises.wait;exports.scrollToElement=scroll.scrollToElement;exports.getElementTransitionDurationMS=style.getElementTransitionDurationMS;exports.getElementTransitionDurationS=style.getElementTransitionDurationS;exports.changeHistory=url.changeHistory;exports.isLocalUrl=url.isLocalUrl;exports.normalizeBase=url.normalizeBase;exports.normalizeRelativeURLs=url.normalizeRelativeURLs;exports.normalizeURL=url.normalizeURL;exports.parseSearchParameters=url.parseSearchParameters;exports.searchParamsObjectToString=url.searchParamsObjectToString;exports.searchParamsToObject=url.searchParamsToObject;exports.splitPath=url.splitPath;exports.updateSearchParameter=url.updateSearchParameter;exports.cloneTemplateContent=cloneTemplateContent;exports.copyTextToClipboard=copyTextToClipboard;exports.decode=decode;exports.dotCircleCollision=dotCircleCollision;exports.dotPolygonCollision=dotPolygonCollision;exports.dotRectCollision=dotRectCollision;exports.encode=encode;exports.formatBytes=formatBytes;exports.getRootVariables=getRootVariables;exports.getStyleRuleActualValue=getStyleRuleActualValue;exports.insert=insert;exports.rgbToHex=rgbToHex;exports.setActiveContentClasses=setActiveContentClasses;exports.setElementsProgress=setElementsProgress;exports.setIntervalOnIntersection=setIntervalOnIntersection;exports.shiftArray=shiftArray;exports.splitPropgress=splitPropgress;exports.transliterate=transliterate;exports.tryCreateHrefFromContact=tryCreateHrefFromContact;
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attributes=require("../attributes-BADnRZpK.cjs"),Store=require("../Store-B96mD8mD.cjs"),canvas=require("../canvas-BP1ceie3.cjs"),coordinates=require("../coordinates-DQ9XV9M1.cjs"),customElements=require("../custom-elements-BfZCJde6.cjs"),dom=require("../dom-B40i6NXw.cjs"),Tweened=require("../Tweened--KJh27xY.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),file=require("../file-RHfA3OS-.cjs"),_function=require("../function-H4b_gTg6.cjs"),gestures=require("../gestures-DtYbQr49.cjs"),stylesheet=require("../stylesheet-DQv6_0na.cjs"),layout=require("../layout-CnGLl7oe.cjs"),loading=require("../loading-7Ju1mFST.cjs"),math=require("../math-C-knY2TL.cjs"),metadata=require("../metadata-BrHUfpV9.cjs"),morph=require("../morph-Buhxq-X0.cjs"),number=require("../number-Bu4sGvW7.cjs"),object=require("../object-DTY_W6xG.cjs"),polyfills=require("../polyfills-DZCuDBkA.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-BAlaPfiQ.cjs"),style=require("../style-IDJ6db6n.cjs"),ticker_index=require("../index-BoGx2BWX.cjs"),url=require("../url-CPCO10Sy.cjs");function insert(arr,index,...newItems){return[...arr.slice(0,index),...newItems,...arr.slice(index)]}__name(insert,"insert");function shiftArray(arr,positions){const len=arr.length;positions=positions%len;const result=new Array(len);for(let i=0;i<len;i++){const newPos=(i+positions)%len;result[newPos]=arr[i]}return result}__name(shiftArray,"shiftArray");function formatBytes(bytes,decimals=2){if(!+bytes)return"0 Bytes";const k=1024,dm=decimals<0?0:decimals,sizes=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(bytes)/Math.log(k));return`${parseFloat((bytes/Math.pow(k,i)).toFixed(dm))} ${sizes[i]}`}__name(formatBytes,"formatBytes");function copyTextToClipboard(text){if(navigator.clipboard)navigator.clipboard.writeText(text).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(err=>{console.error("Failed to copy text to clipboard:",err)});else{const textArea=document.createElement("textarea");textArea.value=text,textArea.style.position="fixed",textArea.style.top="0",textArea.style.left="0",document.body.appendChild(textArea),textArea.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(err){console.error("Failed to copy text to clipboard:",err)}document.body.removeChild(textArea)}}__name(copyTextToClipboard,"copyTextToClipboard");function dotRectCollision(dot,rect){return dot.x<rect.x+rect.width&&dot.x>rect.x&&dot.y<rect.y+rect.height&&dot.y>rect.y}__name(dotRectCollision,"dotRectCollision");function dotCircleCollision(dot,circle){return Math.sqrt((dot.x-circle.x)**2+(dot.y-circle.y)**2)<circle.radius}__name(dotCircleCollision,"dotCircleCollision");function dotPolygonCollision(dot,polygon){let inside=!1;const{x,y}=dot;for(let i=0,j=polygon.length-1;i<polygon.length;j=i++){const xi=polygon[i].x,yi=polygon[i].y,xj=polygon[j].x,yj=polygon[j].y;yi>y!=yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi&&(inside=!inside)}return inside}__name(dotPolygonCollision,"dotPolygonCollision");function rgbToHex(r,g,b){const toHex=__name(c=>{const hex=c.toString(16);return hex.length===1?"0"+hex:hex},"toHex");return`#${toHex(r)}${toHex(g)}${toHex(b)}`}__name(rgbToHex,"rgbToHex");function getStyleRuleActualValue(rule,name){const obj=rule.style.getPropertyValue(name);if(obj){const stringValue=obj.toString();return stringValue.startsWith("var")?getStyleRuleActualValue(rule,stringValue.slice(4,-1)):stringValue}}__name(getStyleRuleActualValue,"getStyleRuleActualValue");function getRootVariables(...names){const variables={};return Array.from(document.styleSheets).forEach(stylesheet2=>{Array.from(stylesheet2.cssRules).forEach(rule=>{rule instanceof CSSStyleRule&&rule.selectorText===":root"&&names.forEach(name=>{const value=getStyleRuleActualValue(rule,name);value&&(variables[name]=value)})})}),names.forEach(name=>{variables[name]||console.warn(`variable named ${name} not found`)}),variables}__name(getRootVariables,"getRootVariables");function encode(string){const decodedStr=window.atob(string);return decodeURIComponent(window.escape(decodedStr))}__name(encode,"encode");function decode(string){const encodedStr=window.unescape(encodeURIComponent(string));return window.btoa(encodedStr)}__name(decode,"decode");const phoneRegex=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,emailRegex=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function tryCreateHrefFromContact(contact){let href,type;return emailRegex.test(contact)?(href=`mailto:${contact.trim()}`,type="email"):phoneRegex.test(contact)&&(href=`tel:${contact.replace(/[^0-9\\.\\+]+/g,"")}`,type="phone"),{href,type,contact}}__name(tryCreateHrefFromContact,"tryCreateHrefFromContact");function transliterate(text,options={}){const{separator="-",lowercase=!0,replaceNumbers=!0,maxLength=60}=options,charMap={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"j",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"};let result=text.replace(/[а-яё]/gi,char=>{const lowerChar=char.toLowerCase(),replacement=charMap[lowerChar]||"";return char===lowerChar?replacement:replacement.toUpperCase()});if(replaceNumbers){const numberMap={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};result=result.replace(/[0-9]/g,num=>numberMap[num]||num)}return lowercase&&(result=result.toLowerCase()),result=result.replace(/[^\w\-]+/g,separator).replace(new RegExp(`\\${separator}+`,"g"),separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`,"g"),""),maxLength>0&&result.length>maxLength&&(result=result.substring(0,maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`),"")),result}__name(transliterate,"transliterate");function splitProgress(progress,items,initialItemsWithFullProgress=0){const totalItems=items-initialItemsWithFullProgress,splitted=[];for(let item=0;item<items;item++){const offset=item/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));splitted.push(itemProgress)}return splitted}__name(splitProgress,"splitProgress");function setElementsProgress(progress,elements,initialItemsWithFullProgress=0){const totalItems=elements.length-initialItemsWithFullProgress;elements.forEach((el,index)=>{const offset=index/totalItems-initialItemsWithFullProgress/totalItems,itemProgress=Math.min(1,Math.max(0,(progress-offset)*totalItems));el.style.setProperty("--item-progress",itemProgress.toString())})}__name(setElementsProgress,"setElementsProgress");function setActiveContentClasses(index,elements){elements.forEach((el,i)=>{i>index?(el.classList.remove("current","previous"),el.classList.add("next")):i<index?(el.classList.remove("current","next"),el.classList.add("previous")):(el.classList.remove("previous","next"),el.classList.add("current"))})}__name(setActiveContentClasses,"setActiveContentClasses");function cloneTemplateContent(templateElement,callback){if(templateElement){const element2=templateElement.content.cloneNode(!0).firstElementChild;return element2&&(callback==null||callback(element2)),element2}return null}__name(cloneTemplateContent,"cloneTemplateContent");function setIntervalOnIntersection(element2,delay,callback,options){let intervalId,isIntersecting=!1,current=0,previous=0,tickerUnsubsribe;const toggleInterval=__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe(),options!=null&&options.restartCounter&&(current=0),isIntersecting&&(callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker(),intervalId=setInterval(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),current++,callback({current,previous,progress:0}),previous=current,tickerUnsubsribe=restartTicker()},delay))},"toggleInterval"),restartTicker=__name(()=>ticker_index.ticker.subscribe(e=>{const progress=e.timeElapsedSinceSubscription/delay;callback({current,previous,progress})}),"restartTicker"),intersectorUnsubscribe=ticker_index.intersector.subscribe(element2,e=>{isIntersecting=e.isIntersecting,toggleInterval()});return{destroy:__name(()=>{tickerUnsubsribe==null||tickerUnsubsribe(),intersectorUnsubscribe(),clearInterval(intervalId)},"destroy"),restart:__name((currentValue,previousValue)=>{current=currentValue||0,previousValue&&(previous=previousValue),toggleInterval()},"restart"),stop:__name(()=>{clearInterval(intervalId),tickerUnsubsribe==null||tickerUnsubsribe()},"stop")}}__name(setIntervalOnIntersection,"setIntervalOnIntersection");exports.getElementAttributesAdvanced=attributes.getElementAttributesAdvanced;exports.parseAttribute=attributes.parseAttribute;exports.parseAttributeValue=attributes.parseAttributeValue;exports.parseAttributeValueAdvanced=attributes.parseAttributeValueAdvanced;exports.camelToKebab=Store.camelToKebab;exports.capitalize=Store.capitalize;exports.declension=Store.declension;exports.decodeHtmlEntities=Store.decodeHtmlEntities;exports.generateId=Store.generateId;exports.getRandomChar=Store.getRandomChar;exports.isBrowser=Store.isBrowser;exports.isUppercase=Store.isUppercase;exports.kebabToCamel=Store.kebabToCamel;exports.snakeToDotted=Store.snakeToDotted;exports.toPascalCase=Store.toPascalCase;exports.uncapitalize=Store.uncapitalize;exports.contain=canvas.contain;exports.cover=canvas.cover;exports.fixPosition=canvas.fixPosition;exports.measureText=canvas.measureText;exports.getPointerPosition=coordinates.getPointerPosition;exports.normalize=coordinates.normalize;exports.screenToCartesian=coordinates.screenToCartesian;exports.whenDefined=customElements.whenDefined;exports.createScriptElement=dom.createScriptElement;exports.deepQuerySelectorAll=dom.deepQuerySelectorAll;exports.excludeElements=dom.excludeElements;exports.findParentElement=dom.findParentElement;exports.findScrollParentElement=dom.findScrollParentElement;exports.getAllParentElements=dom.getAllParentElements;exports.getElement=dom.getElement;exports.intersectElements=dom.intersectElements;exports.traverseNodes=dom.traverseNodes;exports.traverseShadowRoots=dom.traverseShadowRoots;exports.easeInCubic=Tweened.easeInCubic;exports.easeInExpo=Tweened.easeInExpo;exports.easeInOutCubic=Tweened.easeInOutCubic;exports.easeInOutExpo=Tweened.easeInOutExpo;exports.easeInOutQuad=Tweened.easeInOutQuad;exports.easeInOutQuart=Tweened.easeInOutQuart;exports.easeInOutQuint=Tweened.easeInOutQuint;exports.easeInQuad=Tweened.easeInQuad;exports.easeInQuart=Tweened.easeInQuart;exports.easeInQuint=Tweened.easeInQuint;exports.easeOutCubic=Tweened.easeOutCubic;exports.easeOutExpo=Tweened.easeOutExpo;exports.easeOutQuad=Tweened.easeOutQuad;exports.easeOutQuart=Tweened.easeOutQuart;exports.easeOutQuint=Tweened.easeOutQuint;exports.easings=Tweened.easings;exports.linear=Tweened.linear;exports.isElementVisible=element.isElementVisible;exports.dispatchEvent=events.dispatchEvent;exports.createJSONAndSave=file.createJSONAndSave;exports.downloadURI=file.downloadURI;exports.debounce=_function.debounce;exports.throttle=_function.throttle;exports.setupDrag=gestures.setupDrag;exports.createStylesheet=stylesheet.createStylesheet;exports.styleToString=stylesheet.styleToString;exports.getCumulativeOffsetLeft=layout.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=layout.getCumulativeOffsetTop;exports.getCumulativePosition=layout.getCumulativePosition;exports.getStickyOffset=layout.getStickyOffset;exports.requestLoadingCallback=loading.requestLoadingCallback;exports.calculateDistance=math.calculateDistance;exports.calculateDistanceWithRadius=math.calculateDistanceWithRadius;exports.clamp=math.clamp;exports.damp=math.damp;exports.lerp=math.lerp;exports.mapRange=math.mapRange;exports.round=math.round;exports.smootherstep=math.smootherstep;exports.smoothstep=math.smoothstep;exports.step=math.step;exports.formatMediaDuration=metadata.formatMediaDuration;exports.ACTION_CREATE=morph.ACTION_CREATE;exports.ACTION_PRESERVE=morph.ACTION_PRESERVE;exports.ACTION_REMOVE=morph.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=morph.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=morph.ACTION_REPLACE;exports.ACTION_SET_ATTR=morph.ACTION_SET_ATTR;exports.ACTION_SKIP=morph.ACTION_SKIP;exports.ACTION_UPDATE=morph.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=morph.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=morph.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=morph.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=morph.NODE_TYPE_TEXT;exports.diff=morph.diff;exports.morph=morph.morph;exports.patch=morph.patch;exports.beautifyNumber=number.beautifyNumber;exports.loopNumber=number.loopNumber;exports.preciseNumber=number.preciseNumber;exports.roundNumberTo=number.roundNumberTo;exports.toStep=number.toStep;exports.cloneDeep=object.cloneDeep;exports.compareObjects=object.compareObjects;exports.isESClass=object.isESClass;exports.isNullish=object.isNullish;exports.isObject=object.isObject;exports.mergeDeep=object.mergeDeep;exports.mixin=object.mixin;exports.omit=object.omit;exports.pick=object.pick;exports.nullishCoalescing=polyfills.nullishCoalescing;exports.requestIdleCallback=polyfills.requestIdleCallback;exports.wait=promises.wait;exports.scrollToElement=scroll.scrollToElement;exports.getElementTransitionDurationMS=style.getElementTransitionDurationMS;exports.getElementTransitionDurationS=style.getElementTransitionDurationS;exports.changeHistory=url.changeHistory;exports.isLocalUrl=url.isLocalUrl;exports.normalizeBase=url.normalizeBase;exports.normalizeRelativeURLs=url.normalizeRelativeURLs;exports.normalizeURL=url.normalizeURL;exports.parseSearchParameters=url.parseSearchParameters;exports.searchParamsObjectToString=url.searchParamsObjectToString;exports.searchParamsToObject=url.searchParamsToObject;exports.splitPath=url.splitPath;exports.updateSearchParameter=url.updateSearchParameter;exports.cloneTemplateContent=cloneTemplateContent;exports.copyTextToClipboard=copyTextToClipboard;exports.decode=decode;exports.dotCircleCollision=dotCircleCollision;exports.dotPolygonCollision=dotPolygonCollision;exports.dotRectCollision=dotRectCollision;exports.encode=encode;exports.formatBytes=formatBytes;exports.getRootVariables=getRootVariables;exports.getStyleRuleActualValue=getStyleRuleActualValue;exports.insert=insert;exports.rgbToHex=rgbToHex;exports.setActiveContentClasses=setActiveContentClasses;exports.setElementsProgress=setElementsProgress;exports.setIntervalOnIntersection=setIntervalOnIntersection;exports.shiftArray=shiftArray;exports.splitProgress=splitProgress;exports.transliterate=transliterate;exports.tryCreateHrefFromContact=tryCreateHrefFromContact;
@@ -203,7 +203,7 @@ function transliterate(text, options = {}) {
203
203
  return lowercase && (result = result.toLowerCase()), result = result.replace(/[^\w\-]+/g, separator).replace(new RegExp(`\\${separator}+`, "g"), separator).replace(new RegExp(`(^\\${separator}|\\${separator}$)`, "g"), ""), maxLength > 0 && result.length > maxLength && (result = result.substring(0, maxLength).replace(new RegExp(`\\${separator}[^\\${separator}]*$`), "")), result;
204
204
  }
205
205
  __name(transliterate, "transliterate");
206
- function splitPropgress(progress, items, initialItemsWithFullProgress = 0) {
206
+ function splitProgress(progress, items, initialItemsWithFullProgress = 0) {
207
207
  const totalItems = items - initialItemsWithFullProgress, splitted = [];
208
208
  for (let item = 0; item < items; item++) {
209
209
  const offset = item / totalItems - initialItemsWithFullProgress / totalItems, itemProgress = Math.min(
@@ -214,7 +214,7 @@ function splitPropgress(progress, items, initialItemsWithFullProgress = 0) {
214
214
  }
215
215
  return splitted;
216
216
  }
217
- __name(splitPropgress, "splitPropgress");
217
+ __name(splitProgress, "splitProgress");
218
218
  function setElementsProgress(progress, elements, initialItemsWithFullProgress = 0) {
219
219
  const totalItems = elements.length - initialItemsWithFullProgress;
220
220
  elements.forEach((el, index) => {
@@ -404,7 +404,7 @@ export {
404
404
  a6 as smoothstep,
405
405
  s as snakeToDotted,
406
406
  c11 as splitPath,
407
- splitPropgress,
407
+ splitProgress,
408
408
  s5 as step,
409
409
  s4 as styleToString,
410
410
  t3 as throttle,
@@ -1,3 +1,3 @@
1
- export declare function splitPropgress(progress: number, items: number, initialItemsWithFullProgress?: number): number[];
1
+ export declare function splitProgress(progress: number, items: number, initialItemsWithFullProgress?: number): number[];
2
2
  export declare function setElementsProgress(progress: number, elements: Array<HTMLElement>, initialItemsWithFullProgress?: number): void;
3
3
  export declare function setActiveContentClasses(index: number, elements: Array<HTMLElement>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.90.3",
3
+ "version": "0.90.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"