/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{timeSinceUTCMidnight as t,makeUTCTime as n}from"../../../core/timeUtils.js";const e={spring:{dayOfMonth:20,month:2},summer:{dayOfMonth:21,month:5},fall:{dayOfMonth:23,month:8},winter:{dayOfMonth:21,month:11}},i=["spring","summer","fall","winter"];function r(t,n,i){const r=u(n,i),{dayOfMonth:o,month:m}=e[r],s=new Date(t);return s.setMonth(m,o),s}function o(t,n){return u(m(t),n)}function m(t){const n=t.getTime(),e=r(t,"spring",0).getTime(),i=r(t,"summer",0).getTime(),o=r(t,"fall",0).getTime(),m=r(t,"winter",0).getTime();return n>=e&&n<i?"spring":n>=i&&n<o?"summer":n>=o&&n<m?"fall":"winter"}function u(t,n){return 0===n?t:s(t)}function s(t){const n=i.indexOf(t);return i[(n+2)%4]}function f(t,e){return n(t,e,"minutes")}function c(n){return t(n,"minutes")}function g(t,n,e){const i=12e5,r=i/4,o=18e5,m=r/3*2,u=72e5;if(null==t||null==n||isNaN(t.getTime())&&isNaN(n.getTime()))return r;const s=e.getTime(),f=t.getTime(),c=n.getTime(),g=f-u/2,l=f+u/2,a=c-u/3*2,h=c+u/3;let T=r;return s>=g&&s<=l?T=s-g<=i?o-(s-g)/i*(o-m):l-s<=i/2?r-(l-s)/i*2*(r-m):m:s>=a&&s<=h?T=s-a<=i/2?r-(s-a)/i*2*(r-m):h-s<=i?o-(h-s)/i*(o-m):m:(s<f||s>c)&&(T=o),T}export{g as calculatePlaySpeed,c as dateTimeToSliderPos,s as flipSeasonHemisphere,u as getNorthernHemisphereSeason,r as getSeasonDate,o as getSeasonFromDate,i as orderedSeasons,f as sliderPosToDateTime};
