@hhgtech/hhg-components 1.20.3 → 1.20.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.
- package/build/ageGenerate-6693c606.js +1 -0
- package/build/components.js +1 -1
- package/build/core.js +1 -1
- package/build/esm/ageGenerate-152271f0.js +1 -0
- package/build/esm/components.js +1 -1
- package/build/esm/core.js +1 -1
- package/build/esm/{index-863ad334.js → index-be014426.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-ee3aa6f5.js → types-68e75f01.js} +1 -1
- package/build/{index-19857024.js → index-2c0ae5fa.js} +1 -1
- package/build/index.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-7bcf4cd6.js → types-1f423cc5.js} +1 -1
- package/package.json +1 -1
- package/build/ageGenerate-42a9fa31.js +0 -1
- package/build/esm/ageGenerate-84a7d02d.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./lazyLoad-0454885d.js"),t=require("./tslib.es6-f7929e76.js"),r=require("react"),n=require("./cookieHelper-612b90fa.js"),i=require("date-fns"),o=Object.freeze({__proto__:null,get Gender(){return e.Gender},get BabyGrowthChartType(){return e.BabyGrowthChartType},get BabyGrowthChartDuration(){return e.BabyGrowthChartDuration},get BabyGrowthResultTab(){return e.BabyGrowthResultTab},get LOCALE(){return e.LOCALE}});function a(e){var t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}exports.ageGenerate=function(e,t){void 0===t&&(t=new Date);var r=i.differenceInWeeks(t,e,{roundingMethod:"ceil"}),n=i.differenceInMonths(t,e);return{year:Math.floor(n/12),month:n%12,week:r}},exports.index=o,exports.useFbDataLayer=function(e){r.useEffect((function(){var r=null;return(null==e?void 0:e.id)&&t.__awaiter(void 0,void 0,void 0,(function(){var i,o,u,s,c,l,d,f,h,w;return t.__generator(this,(function(_){switch(_.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(i=_.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:i=_.sent(),_.label=3;case 3:return[4,Promise.all([e.email?a(e.email):null,e.phone?a(e.phone):null,e.birthday?a(e.birthday.split("-").join("")):null,e.gender?a(e.gender?"m":"f"):null,e.city_name?a(e.city_name).then((function(e){return e.replace(/\s/g,"")})):null])];case 4:return o=_.sent(),u=o[0],s=o[1],c=o[2],l=o[3],d=o[4],f={fbc:n.getCookie("_fbc")||"",fbp:n.getCookie("_fbp")||"",client_ip_address:(null==i?void 0:i.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},u&&(f.em=u),s&&(f.ph=s),c&&(f.db=c),l&&(f.ge=l),d&&(f.ct=d),null===(w=null===(h=window.localStorage)||void 0===h?void 0:h.setItem)||void 0===w||w.call(h,"fbDataLayer_userInfo",JSON.stringify(f)),window.dataLayer=window.dataLayer||[],window.dataLayer.push(t.__assign(t.__assign({},f),{event:"FB Conversion"})),function e(){return t.__awaiter(this,void 0,void 0,(function(){return t.__generator(this,(function(t){return window.fbq?window.fbq("trackCustom","FB Conversion",{action_source:"website",event_source_url:window.location.href,user_data:[f]}):r=setTimeout(e,2e3),[2]}))}))}(),[2]}}))})),function(){r&&clearTimeout(r)}}),[e])};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as e,B as t,a as n,b as r,L as o}from"./lazyLoad-d80d3fd1.js";import{_ as a,a as i,b as u}from"./tslib.es6-6ae0d506.js";import{useEffect as s}from"react";import{g as c}from"./cookieHelper-0e8521c3.js";import{differenceInWeeks as l,differenceInMonths as d}from"date-fns";var f=Object.freeze({__proto__:null,get Gender(){return e},get BabyGrowthChartType(){return t},get BabyGrowthChartDuration(){return n},get BabyGrowthResultTab(){return r},get LOCALE(){return o}});function h(e){var t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((function(e){return Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}))}var p=function(e){s((function(){var t=null;return(null==e?void 0:e.id)&&a(void 0,void 0,void 0,(function(){var n,r,o,s,l,d,f,p,m,w;return i(this,(function(b){switch(b.label){case 0:return[4,fetch("https://api.ipify.org").then((function(e){return e.text()}))];case 1:return(n=b.sent())?[3,3]:[4,fetch("https://icanhazip.com").then((function(e){return e.text()}))];case 2:n=b.sent(),b.label=3;case 3:return[4,Promise.all([e.email?h(e.email):null,e.phone?h(e.phone):null,e.birthday?h(e.birthday.split("-").join("")):null,e.gender?h(e.gender?"m":"f"):null,e.city_name?h(e.city_name).then((function(e){return e.replace(/\s/g,"")})):null])];case 4:return r=b.sent(),o=r[0],s=r[1],l=r[2],d=r[3],f=r[4],p={fbc:c("_fbc")||"",fbp:c("_fbp")||"",client_ip_address:(null==n?void 0:n.replace("\n",""))||"",client_user_agent:navigator.userAgent||""},o&&(p.em=o),s&&(p.ph=s),l&&(p.db=l),d&&(p.ge=d),f&&(p.ct=f),null===(w=null===(m=window.localStorage)||void 0===m?void 0:m.setItem)||void 0===w||w.call(m,"fbDataLayer_userInfo",JSON.stringify(p)),window.dataLayer=window.dataLayer||[],window.dataLayer.push(u(u({},p),{event:"FB Conversion"})),function e(){return a(this,void 0,void 0,(function(){return i(this,(function(n){return window.fbq?window.fbq("trackCustom","FB Conversion",{action_source:"website",event_source_url:window.location.href,user_data:[p]}):t=setTimeout(e,2e3),[2]}))}))}(),[2]}}))})),function(){t&&clearTimeout(t)}}),[e])},m=function(e,t){void 0===t&&(t=new Date);var n=l(t,e,{roundingMethod:"ceil"}),r=d(t,e);return{year:Math.floor(r/12),month:r%12,week:n}};export{m as a,f as i,p as u};
|