mario-education 2.4.404-multi → 2.4.405-multi
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/dist/components/Loading/LoadLanguage.d.ts +3 -0
- package/dist/components/layouts/HeaderSideBar.d.ts +2 -0
- package/dist/components/layouts/NotificationStepLogin.d.ts +14 -0
- package/dist/components/layouts/type.d.ts +20 -0
- package/dist/containers/ExternalApi/components/DetailTokenModel.d.ts +3 -0
- package/dist/containers/ExternalApi/components/PermissionSelected.d.ts +3 -0
- package/dist/containers/ExternalApi/configs/contants.d.ts +3 -0
- package/dist/containers/ExternalApi/configs/types.d.ts +24 -0
- package/dist/containers/ExternalApi/hooks/useExternalApi.d.ts +12 -0
- package/dist/containers/ExternalApi/views/ExternalApi.d.ts +2 -0
- package/dist/containers/SkillTest/components/SettingSkillTestModal.d.ts +14 -0
- package/dist/containers/SkillTest/hook/useSkillTest.d.ts +19 -0
- package/dist/containers/SkillTest/utils/constant.d.ts +17 -0
- package/dist/containers/SkillTest/utils/type.interface.d.ts +7 -0
- package/dist/containers/SkillTest/utils/ultis.d.ts +8 -0
- package/dist/containers/SkillTest/view/SkillTest.d.ts +2 -0
- package/dist/containers/SwitchTeacher/hooks/useSwitchTeacher.d.ts +9 -0
- package/dist/index.css +5370 -5370
- package/dist/index.js +536 -661
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +537 -662
- package/dist/index.modern.js.map +1 -1
- package/dist/services/externalApi.d.ts +4 -0
- package/dist/services/skillTestServices.d.ts +5 -0
- package/dist/services/userDeletedService.d.ts +1 -0
- package/package.json +104 -104
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api, BASE_URL, useTranslation as useTranslation$1, setAlert, CustomSelector, LinkEditButton, DeleteButtonIcon, EmptyDataAlert, CommonModal, RequiredLabel, ErrorHandler, useFilters, setLoading, setClassList, setModal, QuitPrompt, AddButton, CustomPagination, setConferenceRubricList, SearchBoxContainer, getTextFromHTML, DEFAULT_LANGUAGE_CODE, generateRandomString, SuggestionCategorySelector, CreatableSelector, setSuggestionList, setStrategyList, UploadFileButton, systemStudentBadge, setBadgeList, getFileUrl, setGoalExampleList, setSubjectList, setLearningSupportCategoryList, apiUpload, utcToLocalTime, setBandScoreList, EditButtonIcon, DATE_FORMAT, setSchoolBlankDayList, SearchBox, CustomTab, SkillList, QUESTION_TYPES, EMOTIONS, QUESTION_TYPES_OPTIONS, setQuestionList, QuestionCategorySelector, setQuestionByCategory, setSelectQuestion, setResetQuestionList, setMoveItemQuestion, setEditItemQuesion, DEFAULT_FILTER as DEFAULT_FILTER$2, setReflectionList, setReflectionResultList, DATE_RESULT, StarRatingSelector, QuestionTypeSelector, CategorySelector as CategorySelector$1, editorConfig, DetailActionButtons, setAssessmentList, FULL_DATE_RESULT, setFeedbackList, TINY_MCE_API_KEY, setTutorialScreenList, setQuestionCateList, setAssignmentList, setSessionTemplateList, setSessionTemplateGeneralClassList, setCustomAlertList, systemCertificateUpload, setCertificateList, getStaticFileUrl, ACCESS_TOKEN, reset, NOTIFICATION_ALERT_KEY, setUser, setSandboxMode, setLanguage, showMenuBar, showFontSize, NOTIFICATION_CHANNEL, setEnableIEP, setConversationOneToOne, setEnableSurvey, canAccessRoute, firstCheckToken, getInfo, Loading as Loading$1, Dashboard as Dashboard$1, TheContent, LICENSE_AGGRID } from 'mario-core';
|
|
2
2
|
import { LicenseManager } from '@ag-grid-enterprise/core';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { useState, useRef, useCallback, useEffect, forwardRef, useMemo, Fragment as Fragment$1, memo,
|
|
4
|
+
import React__default, { useState, useRef, useCallback, useEffect, forwardRef, useMemo, Fragment as Fragment$1, memo, useContext, createElement, createContext, Component } from 'react';
|
|
5
5
|
import { useDispatch, useSelector } from 'react-redux';
|
|
6
6
|
import { Table, Row, Col, Input as Input$1, Label, Button, CustomInput, Nav, NavItem, NavLink, Form, FormGroup, Card, CardBody, CardTitle, Alert, Modal, ModalHeader, ModalBody, ModalFooter, Progress, Collapse } from 'reactstrap';
|
|
7
7
|
import { Formik } from 'formik';
|
|
@@ -8024,6 +8024,9 @@ var changeTeacherOfStudent = function changeTeacherOfStudent(id, teacherUserId)
|
|
|
8024
8024
|
teacherUserId: teacherUserId
|
|
8025
8025
|
});
|
|
8026
8026
|
};
|
|
8027
|
+
var changeMultiTeacherOfStudent = function changeMultiTeacherOfStudent(studentId, params) {
|
|
8028
|
+
return api.put(USER_URL$1 + "/change-multi-teacher/" + studentId, params);
|
|
8029
|
+
};
|
|
8027
8030
|
var getTeachersByStudentId = function getTeachersByStudentId(studentId) {
|
|
8028
8031
|
return api.get(USER_URL$1 + "/teachers/" + studentId);
|
|
8029
8032
|
};
|
|
@@ -8428,7 +8431,8 @@ var initialUserChoice$1 = {
|
|
|
8428
8431
|
emailStudent: "",
|
|
8429
8432
|
teacherUserId: "",
|
|
8430
8433
|
emailTeacher: "",
|
|
8431
|
-
teacherName: ""
|
|
8434
|
+
teacherName: "",
|
|
8435
|
+
teachers: []
|
|
8432
8436
|
};
|
|
8433
8437
|
var TITLE$c = "Switch teacher list";
|
|
8434
8438
|
|
|
@@ -8457,6 +8461,13 @@ var useSwitchTeacher = function useSwitchTeacher() {
|
|
|
8457
8461
|
teacherChangeId = _useState5[0],
|
|
8458
8462
|
setTeacherChangeId = _useState5[1];
|
|
8459
8463
|
|
|
8464
|
+
var _useState6 = useState({
|
|
8465
|
+
teacher: null,
|
|
8466
|
+
teacherChange: null
|
|
8467
|
+
}),
|
|
8468
|
+
teacherGroupId = _useState6[0],
|
|
8469
|
+
setTeacherGroupId = _useState6[1];
|
|
8470
|
+
|
|
8460
8471
|
var dispatch = useDispatch();
|
|
8461
8472
|
var modal = useRef();
|
|
8462
8473
|
|
|
@@ -8586,6 +8597,54 @@ var useSwitchTeacher = function useSwitchTeacher() {
|
|
|
8586
8597
|
useEffect(function () {
|
|
8587
8598
|
userChoiced.id && getTeachersOfStudent(parseInt(userChoiced.id));
|
|
8588
8599
|
}, [userChoiced.id]);
|
|
8600
|
+
|
|
8601
|
+
var updateSwitchTeacher = function updateSwitchTeacher(teachers, studentId) {
|
|
8602
|
+
try {
|
|
8603
|
+
dispatch(setModal({
|
|
8604
|
+
isOpen: true,
|
|
8605
|
+
type: "warning",
|
|
8606
|
+
message: "Do you want to change teacher?",
|
|
8607
|
+
onConfirm: function () {
|
|
8608
|
+
try {
|
|
8609
|
+
var _temp13 = function _temp13() {
|
|
8610
|
+
dispatch(setLoading(false));
|
|
8611
|
+
};
|
|
8612
|
+
|
|
8613
|
+
dispatch(setLoading(true));
|
|
8614
|
+
|
|
8615
|
+
var _temp14 = _catch(function () {
|
|
8616
|
+
return Promise.resolve(changeMultiTeacherOfStudent(studentId, teachers)).then(function () {
|
|
8617
|
+
dispatch(setAlert({
|
|
8618
|
+
type: "success",
|
|
8619
|
+
message: "Change teacher successfully"
|
|
8620
|
+
}));
|
|
8621
|
+
openModal();
|
|
8622
|
+
resetData();
|
|
8623
|
+
changeFilters({
|
|
8624
|
+
currentPage: 1
|
|
8625
|
+
});
|
|
8626
|
+
});
|
|
8627
|
+
}, function (err) {
|
|
8628
|
+
var _err$response4, _err$response4$data;
|
|
8629
|
+
|
|
8630
|
+
dispatch(setAlert({
|
|
8631
|
+
type: "danger",
|
|
8632
|
+
message: ((_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.title) || err.message
|
|
8633
|
+
}));
|
|
8634
|
+
});
|
|
8635
|
+
|
|
8636
|
+
return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(_temp13) : _temp13(_temp14));
|
|
8637
|
+
} catch (e) {
|
|
8638
|
+
return Promise.reject(e);
|
|
8639
|
+
}
|
|
8640
|
+
}
|
|
8641
|
+
}));
|
|
8642
|
+
return Promise.resolve();
|
|
8643
|
+
} catch (e) {
|
|
8644
|
+
return Promise.reject(e);
|
|
8645
|
+
}
|
|
8646
|
+
};
|
|
8647
|
+
|
|
8589
8648
|
return {
|
|
8590
8649
|
userList: userList,
|
|
8591
8650
|
totalItems: totalItems,
|
|
@@ -8601,7 +8660,10 @@ var useSwitchTeacher = function useSwitchTeacher() {
|
|
|
8601
8660
|
setTeacherChangeId: setTeacherChangeId,
|
|
8602
8661
|
teacherChangeId: teacherChangeId,
|
|
8603
8662
|
removeData: removeData,
|
|
8604
|
-
resetData: resetData
|
|
8663
|
+
resetData: resetData,
|
|
8664
|
+
setTeacherGroupId: setTeacherGroupId,
|
|
8665
|
+
teacherGroupId: teacherGroupId,
|
|
8666
|
+
updateSwitchTeacher: updateSwitchTeacher
|
|
8605
8667
|
};
|
|
8606
8668
|
};
|
|
8607
8669
|
|
|
@@ -8612,7 +8674,10 @@ var SwitchTeacherModal = function SwitchTeacherModal(props, ref) {
|
|
|
8612
8674
|
userChoiced = props.userChoiced,
|
|
8613
8675
|
options = props.options,
|
|
8614
8676
|
teacherChangeId = props.teacherChangeId,
|
|
8615
|
-
setTeacherChangeId = props.setTeacherChangeId
|
|
8677
|
+
setTeacherChangeId = props.setTeacherChangeId,
|
|
8678
|
+
setTeacherGroupId = props.setTeacherGroupId,
|
|
8679
|
+
teacherGroupId = props.teacherGroupId,
|
|
8680
|
+
updateSwitchTeacher = props.updateSwitchTeacher;
|
|
8616
8681
|
|
|
8617
8682
|
var _useTranslation = useTranslation$1(),
|
|
8618
8683
|
t = _useTranslation.t;
|
|
@@ -8625,7 +8690,7 @@ var SwitchTeacherModal = function SwitchTeacherModal(props, ref) {
|
|
|
8625
8690
|
ref: ref,
|
|
8626
8691
|
confirmText: t("change_save"),
|
|
8627
8692
|
onConfirm: function onConfirm() {
|
|
8628
|
-
|
|
8693
|
+
userChoiced.teachers.length > 0 ? updateSwitchTeacher(teacherGroupId, userChoiced.id) : removeData(teacherChangeId, userChoiced.id);
|
|
8629
8694
|
},
|
|
8630
8695
|
onCancel: function onCancel() {
|
|
8631
8696
|
resetData();
|
|
@@ -8639,14 +8704,64 @@ var SwitchTeacherModal = function SwitchTeacherModal(props, ref) {
|
|
|
8639
8704
|
className: "font-weight-bold"
|
|
8640
8705
|
}, t("student_email")), React__default.createElement("p", null, userChoiced.emailStudent, " "), React__default.createElement("p", {
|
|
8641
8706
|
className: "font-weight-bold"
|
|
8642
|
-
}, t("current_teacher_name")), React__default.createElement("p", null, userChoiced.teacherName, " "),
|
|
8707
|
+
}, t("current_teacher_name")), React__default.createElement("p", null, userChoiced.teacherName, " "), userChoiced.teachers.length > 0 && userChoiced.teachers.map(function (e) {
|
|
8708
|
+
return React__default.createElement("p", null, e.mainTeacherName, " ");
|
|
8709
|
+
}), React__default.createElement("p", {
|
|
8643
8710
|
className: "font-weight-bold"
|
|
8644
|
-
}, t("current_teacher_email")), React__default.createElement("p", null, userChoiced.emailTeacher, " "),
|
|
8645
|
-
|
|
8646
|
-
|
|
8711
|
+
}, t("current_teacher_email")), React__default.createElement("p", null, userChoiced.emailTeacher, " "), userChoiced.teachers.length > 0 && userChoiced.teachers.map(function (e) {
|
|
8712
|
+
return React__default.createElement("p", null, e.mainTeacherEmail, " ");
|
|
8713
|
+
}), userChoiced.teachers.length > 0 && React__default.createElement("p", null, React__default.createElement("p", {
|
|
8714
|
+
className: "font-weight-bold"
|
|
8715
|
+
}, t("select_teacher")), React__default.createElement(CustomSelector, {
|
|
8716
|
+
options: userChoiced.teachers.map(function (record) {
|
|
8717
|
+
return {
|
|
8718
|
+
label: record.mainTeacherName + " - " + record.mainTeacherEmail,
|
|
8719
|
+
value: record.teacherUserId
|
|
8720
|
+
};
|
|
8721
|
+
}),
|
|
8722
|
+
value: userChoiced.teachers.map(function (record) {
|
|
8723
|
+
return {
|
|
8724
|
+
label: record.mainTeacherName + " - " + record.mainTeacherEmail,
|
|
8725
|
+
value: record.teacherUserId
|
|
8726
|
+
};
|
|
8727
|
+
}).find(function (item) {
|
|
8728
|
+
return item.value == teacherGroupId.teacher;
|
|
8729
|
+
}),
|
|
8730
|
+
placeholder: t("select_teacher"),
|
|
8731
|
+
onChange: function onChange(e) {
|
|
8732
|
+
return setTeacherGroupId(function (prev) {
|
|
8733
|
+
return Object.assign(prev, {
|
|
8734
|
+
teacher: e.value
|
|
8735
|
+
});
|
|
8736
|
+
});
|
|
8737
|
+
}
|
|
8738
|
+
})), userChoiced.teachers.length > 0 && React__default.createElement("p", {
|
|
8739
|
+
className: "font-weight-bold"
|
|
8740
|
+
}, t("select_teacher_change")), !!userChoiced && React__default.createElement(CustomSelector, {
|
|
8741
|
+
options: userChoiced.teachers.length > 0 ? options.filter(function (r) {
|
|
8742
|
+
return !userChoiced.teachers.map(function (e) {
|
|
8743
|
+
return e.teacherUserId;
|
|
8744
|
+
}).includes(r.value);
|
|
8745
|
+
}) : options,
|
|
8746
|
+
value: userChoiced.teachers.length > 0 ? valueDefault : userChoiced.teachers.map(function (record) {
|
|
8747
|
+
return {
|
|
8748
|
+
label: record.mainTeacherName + " - " + record.mainTeacherEmail,
|
|
8749
|
+
value: record.teacherUserId
|
|
8750
|
+
};
|
|
8751
|
+
}).find(function (item) {
|
|
8752
|
+
return item.value == teacherGroupId.teacherChange;
|
|
8753
|
+
}),
|
|
8647
8754
|
placeholder: t("select_teacher_change"),
|
|
8648
8755
|
onChange: function onChange(e) {
|
|
8649
|
-
|
|
8756
|
+
if (userChoiced.teachers.length > 0) {
|
|
8757
|
+
setTeacherGroupId(function (prev) {
|
|
8758
|
+
return Object.assign(prev, {
|
|
8759
|
+
teacherChange: e.value
|
|
8760
|
+
});
|
|
8761
|
+
});
|
|
8762
|
+
} else {
|
|
8763
|
+
setTeacherChangeId(e.value);
|
|
8764
|
+
}
|
|
8650
8765
|
}
|
|
8651
8766
|
}))));
|
|
8652
8767
|
};
|
|
@@ -8667,9 +8782,12 @@ var SwitchTeacherList = function SwitchTeacherList() {
|
|
|
8667
8782
|
userChoiced = _useSwitchTeacher.userChoiced,
|
|
8668
8783
|
options = _useSwitchTeacher.options,
|
|
8669
8784
|
setTeacherChangeId = _useSwitchTeacher.setTeacherChangeId,
|
|
8785
|
+
setTeacherGroupId = _useSwitchTeacher.setTeacherGroupId,
|
|
8670
8786
|
teacherChangeId = _useSwitchTeacher.teacherChangeId,
|
|
8787
|
+
teacherGroupId = _useSwitchTeacher.teacherGroupId,
|
|
8671
8788
|
removeData = _useSwitchTeacher.removeData,
|
|
8672
|
-
resetData = _useSwitchTeacher.resetData
|
|
8789
|
+
resetData = _useSwitchTeacher.resetData,
|
|
8790
|
+
updateSwitchTeacher = _useSwitchTeacher.updateSwitchTeacher;
|
|
8673
8791
|
|
|
8674
8792
|
var _useTranslation = useTranslation$1(),
|
|
8675
8793
|
t = _useTranslation.t;
|
|
@@ -8731,9 +8849,17 @@ var SwitchTeacherList = function SwitchTeacherList() {
|
|
|
8731
8849
|
className: "align-middle"
|
|
8732
8850
|
}, record.emailStudent), React__default.createElement("td", {
|
|
8733
8851
|
className: "align-middle"
|
|
8734
|
-
}, record.
|
|
8852
|
+
}, record.teachers.length > 0 ? record.teachers.map(function (e) {
|
|
8853
|
+
return React__default.createElement("p", {
|
|
8854
|
+
className: "m-0"
|
|
8855
|
+
}, e.mainTeacherName, " ");
|
|
8856
|
+
}) : record.teacherName), React__default.createElement("td", {
|
|
8735
8857
|
className: "align-middle"
|
|
8736
|
-
}, record.
|
|
8858
|
+
}, record.teachers.length > 0 ? record.teachers.map(function (e) {
|
|
8859
|
+
return React__default.createElement("p", {
|
|
8860
|
+
className: "m-0"
|
|
8861
|
+
}, e.mainTeacherEmail, " ");
|
|
8862
|
+
}) : record.emailTeacher));
|
|
8737
8863
|
})))) : React__default.createElement(EmptyDataAlert, {
|
|
8738
8864
|
label: t("user")
|
|
8739
8865
|
})), React__default.createElement(Col, {
|
|
@@ -8757,10 +8883,13 @@ var SwitchTeacherList = function SwitchTeacherList() {
|
|
|
8757
8883
|
onCancel: function onCancel() {},
|
|
8758
8884
|
userChoiced: userChoiced,
|
|
8759
8885
|
removeData: removeData,
|
|
8886
|
+
updateSwitchTeacher: updateSwitchTeacher,
|
|
8760
8887
|
options: options,
|
|
8761
8888
|
teacherChangeId: teacherChangeId,
|
|
8762
8889
|
setTeacherChangeId: setTeacherChangeId,
|
|
8763
|
-
|
|
8890
|
+
setTeacherGroupId: setTeacherGroupId,
|
|
8891
|
+
resetData: resetData,
|
|
8892
|
+
teacherGroupId: teacherGroupId
|
|
8764
8893
|
}));
|
|
8765
8894
|
};
|
|
8766
8895
|
|
|
@@ -36724,6 +36853,8 @@ function _inherits(subClass, superClass) {
|
|
|
36724
36853
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
36725
36854
|
}
|
|
36726
36855
|
|
|
36856
|
+
var isDevelopment = false;
|
|
36857
|
+
|
|
36727
36858
|
/*
|
|
36728
36859
|
|
|
36729
36860
|
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
@@ -36746,10 +36877,9 @@ styleSheet.flush()
|
|
|
36746
36877
|
- empties the stylesheet of all its contents
|
|
36747
36878
|
|
|
36748
36879
|
*/
|
|
36749
|
-
|
|
36880
|
+
|
|
36750
36881
|
function sheetForTag(tag) {
|
|
36751
36882
|
if (tag.sheet) {
|
|
36752
|
-
// $FlowFixMe
|
|
36753
36883
|
return tag.sheet;
|
|
36754
36884
|
} // this weirdness brought to you by firefox
|
|
36755
36885
|
|
|
@@ -36758,10 +36888,13 @@ function sheetForTag(tag) {
|
|
|
36758
36888
|
|
|
36759
36889
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
36760
36890
|
if (document.styleSheets[i].ownerNode === tag) {
|
|
36761
|
-
// $FlowFixMe
|
|
36762
36891
|
return document.styleSheets[i];
|
|
36763
36892
|
}
|
|
36764
|
-
}
|
|
36893
|
+
} // this function should always return with a value
|
|
36894
|
+
// TS can't understand it though so we make it stop complaining here
|
|
36895
|
+
|
|
36896
|
+
|
|
36897
|
+
return undefined;
|
|
36765
36898
|
}
|
|
36766
36899
|
|
|
36767
36900
|
function createStyleElement(options) {
|
|
@@ -36802,7 +36935,7 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
36802
36935
|
_this.tags.push(tag);
|
|
36803
36936
|
};
|
|
36804
36937
|
|
|
36805
|
-
this.isSpeedy = options.speedy === undefined ?
|
|
36938
|
+
this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;
|
|
36806
36939
|
this.tags = [];
|
|
36807
36940
|
this.ctr = 0;
|
|
36808
36941
|
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
@@ -36830,18 +36963,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
36830
36963
|
|
|
36831
36964
|
var tag = this.tags[this.tags.length - 1];
|
|
36832
36965
|
|
|
36833
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
36834
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
36835
|
-
|
|
36836
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
36837
|
-
// this would only cause problem in speedy mode
|
|
36838
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
36839
|
-
// so we report this error at all times
|
|
36840
|
-
console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
|
|
36841
|
-
}
|
|
36842
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
36843
|
-
}
|
|
36844
|
-
|
|
36845
36966
|
if (this.isSpeedy) {
|
|
36846
36967
|
var sheet = sheetForTag(tag);
|
|
36847
36968
|
|
|
@@ -36850,9 +36971,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
36850
36971
|
// the big drawback is that the css won't be editable in devtools
|
|
36851
36972
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
36852
36973
|
} catch (e) {
|
|
36853
|
-
if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
|
|
36854
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
36855
|
-
}
|
|
36856
36974
|
}
|
|
36857
36975
|
} else {
|
|
36858
36976
|
tag.appendChild(document.createTextNode(rule));
|
|
@@ -36862,16 +36980,13 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
36862
36980
|
};
|
|
36863
36981
|
|
|
36864
36982
|
_proto.flush = function flush() {
|
|
36865
|
-
// $FlowFixMe
|
|
36866
36983
|
this.tags.forEach(function (tag) {
|
|
36867
|
-
|
|
36984
|
+
var _tag$parentNode;
|
|
36985
|
+
|
|
36986
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
36868
36987
|
});
|
|
36869
36988
|
this.tags = [];
|
|
36870
36989
|
this.ctr = 0;
|
|
36871
|
-
|
|
36872
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
36873
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
36874
|
-
}
|
|
36875
36990
|
};
|
|
36876
36991
|
|
|
36877
36992
|
return StyleSheet;
|
|
@@ -36879,6 +36994,21 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
36879
36994
|
|
|
36880
36995
|
var e="-ms-";var r="-moz-";var a="-webkit-";var n="comm";var c="rule";var s="decl";var i="@import";var h="@keyframes";var $="@layer";var g=Math.abs;var k=String.fromCharCode;var m=Object.assign;function x(e,r){return O(e,0)^45?(((r<<2^O(e,0))<<2^O(e,1))<<2^O(e,2))<<2^O(e,3):0}function y(e){return e.trim()}function j(e,r){return (e=r.exec(e))?e[0]:e}function z(e,r,a){return e.replace(r,a)}function C(e,r){return e.indexOf(r)}function O(e,r){return e.charCodeAt(r)|0}function A(e,r,a){return e.slice(r,a)}function M(e){return e.length}function S(e){return e.length}function q(e,r){return r.push(e),e}function B(e,r){return e.map(r).join("")}var D=1;var E=1;var F=0;var G=0;var H=0;var I="";function J(e,r,a,n,c,s,t){return {value:e,root:r,parent:a,type:n,props:c,children:s,line:D,column:E,length:t,return:""}}function K(e,r){return m(J("",null,null,"",null,null,0),e,{length:-e.length},r)}function L(){return H}function N(){H=G>0?O(I,--G):0;if(E--,H===10)E=1,D--;return H}function P(){H=G<F?O(I,G++):0;if(E++,H===10)E=1,D++;return H}function Q(){return O(I,G)}function R(){return G}function T(e,r){return A(I,e,r)}function U(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function V(e){return D=E=1,F=M(I=e),G=0,[]}function W(e){return I="",e}function X(e){return y(T(G-1,re(e===91?e+2:e===40?e+1:e)))}function Z(e){while(H=Q())if(H<33)P();else break;return U(e)>2||U(H)>3?"":" "}function ee(e,r){while(--r&&P())if(H<48||H>102||H>57&&H<65||H>70&&H<97)break;return T(e,R()+(r<6&&Q()==32&&P()==32))}function re(e){while(P())switch(H){case e:return G;case 34:case 39:if(e!==34&&e!==39)re(H);break;case 40:if(e===41)re(e);break;case 92:P();break}return G}function ae(e,r){while(P())if(e+H===47+10)break;else if(e+H===42+42&&Q()===47)break;return "/*"+T(r,G-1)+"*"+k(e===47?e:P())}function ne(e){while(!U(Q()))P();return T(e,G)}function ce(e){return W(se("",null,null,null,[""],e=V(e),0,[0],e))}function se(e,r,a,n,c,s,t,u,i){var f=0;var o=0;var l=t;var v=0;var p=0;var h=0;var b=1;var w=1;var d=1;var $=0;var g="";var m=c;var x=s;var y=n;var j=g;while(w)switch(h=$,$=P()){case 40:if(h!=108&&O(j,l-1)==58){if(C(j+=z(X($),"&","&\f"),"&\f")!=-1)d=-1;break}case 34:case 39:case 91:j+=X($);break;case 9:case 10:case 13:case 32:j+=Z(h);break;case 92:j+=ee(R()-1,7);continue;case 47:switch(Q()){case 42:case 47:q(ue(ae(P(),R()),r,a),i);break;default:j+="/";}break;case 123*b:u[f++]=M(j)*d;case 125*b:case 59:case 0:switch($){case 0:case 125:w=0;case 59+o:if(d==-1)j=z(j,/\f/g,"");if(p>0&&M(j)-l)q(p>32?ie(j+";",n,a,l-1):ie(z(j," ","")+";",n,a,l-2),i);break;case 59:j+=";";default:q(y=te(j,r,a,f,o,c,u,g,m=[],x=[],l),s);if($===123)if(o===0)se(j,r,y,y,m,s,l,u,x);else switch(v===99&&O(j,3)===110?100:v){case 100:case 108:case 109:case 115:se(e,y,y,n&&q(te(e,y,y,0,0,c,u,g,c,m=[],l),x),c,x,l,u,n?m:x);break;default:se(j,y,y,y,[""],x,0,u,x);}}f=o=p=0,b=d=1,g=j="",l=t;break;case 58:l=1+M(j),p=h;default:if(b<1)if($==123)--b;else if($==125&&b++==0&&N()==125)continue;switch(j+=k($),$*b){case 38:d=o>0?1:(j+="\f",-1);break;case 44:u[f++]=(M(j)-1)*d,d=1;break;case 64:if(Q()===45)j+=X(P());v=Q(),o=l=M(g=j+=ne(R())),$++;break;case 45:if(h===45&&M(j)==2)b=0;}}return s}function te(e,r,a,n,s,t,u,i,f,o,l){var v=s-1;var p=s===0?t:[""];var h=S(p);for(var b=0,w=0,d=0;b<n;++b)for(var $=0,k=A(e,v+1,v=g(w=u[b])),m=e;$<h;++$)if(m=y(w>0?p[$]+" "+k:z(k,/&\f/g,p[$])))f[d++]=m;return J(e,r,a,s===0?c:i,f,o,l)}function ue(e,r,a){return J(e,r,a,n,k(L()),A(e,2,-2),0)}function ie(e,r,a,n){return J(e,r,a,s,A(e,0,n),A(e,n+1,-1),n)}function oe(e,r){var a="";var n=S(e);for(var c=0;c<n;c++)a+=r(e[c],c,e,r)||"";return a}function le(e,r,a,t){switch(e.type){case $:if(e.children.length)break;case i:case s:return e.return=e.return||e.value;case n:return "";case h:return e.return=e.value+"{"+oe(e.children,t)+"}";case c:e.value=e.props.join(",");}return M(a=oe(e.children,t))?e.return=e.value+"{"+a+"}":""}function ve(e){var r=S(e);return function(a,n,c,s){var t="";for(var u=0;u<r;u++)t+=e[u](a,n,c,s)||"";return t}}function pe(e){return function(r){if(!r.root)if(r=r.return)e(r);}}//# sourceMappingURL=stylis.mjs.map
|
|
36881
36996
|
|
|
36997
|
+
var weakMemoize = function weakMemoize(func) {
|
|
36998
|
+
var cache = new WeakMap();
|
|
36999
|
+
return function (arg) {
|
|
37000
|
+
if (cache.has(arg)) {
|
|
37001
|
+
// Use non-null assertion because we just checked that the cache `has` it
|
|
37002
|
+
// This allows us to remove `undefined` from the return value
|
|
37003
|
+
return cache.get(arg);
|
|
37004
|
+
}
|
|
37005
|
+
|
|
37006
|
+
var ret = func(arg);
|
|
37007
|
+
cache.set(arg, ret);
|
|
37008
|
+
return ret;
|
|
37009
|
+
};
|
|
37010
|
+
};
|
|
37011
|
+
|
|
36882
37012
|
function memoize(fn) {
|
|
36883
37013
|
var cache = Object.create(null);
|
|
36884
37014
|
return function (arg) {
|
|
@@ -36887,6 +37017,8 @@ function memoize(fn) {
|
|
|
36887
37017
|
};
|
|
36888
37018
|
}
|
|
36889
37019
|
|
|
37020
|
+
var isBrowser = typeof document !== 'undefined';
|
|
37021
|
+
|
|
36890
37022
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
36891
37023
|
var previous = 0;
|
|
36892
37024
|
var character = 0;
|
|
@@ -37011,114 +37143,6 @@ var removeLabel = function removeLabel(element) {
|
|
|
37011
37143
|
}
|
|
37012
37144
|
}
|
|
37013
37145
|
};
|
|
37014
|
-
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
37015
|
-
|
|
37016
|
-
var isIgnoringComment = function isIgnoringComment(element) {
|
|
37017
|
-
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
|
|
37018
|
-
};
|
|
37019
|
-
|
|
37020
|
-
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
|
|
37021
|
-
return function (element, index, children) {
|
|
37022
|
-
if (element.type !== 'rule' || cache.compat) return;
|
|
37023
|
-
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
37024
|
-
|
|
37025
|
-
if (unsafePseudoClasses) {
|
|
37026
|
-
var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
|
|
37027
|
-
//
|
|
37028
|
-
// considering this input:
|
|
37029
|
-
// .a {
|
|
37030
|
-
// .b /* comm */ {}
|
|
37031
|
-
// color: hotpink;
|
|
37032
|
-
// }
|
|
37033
|
-
// we get output corresponding to this:
|
|
37034
|
-
// .a {
|
|
37035
|
-
// & {
|
|
37036
|
-
// /* comm */
|
|
37037
|
-
// color: hotpink;
|
|
37038
|
-
// }
|
|
37039
|
-
// .b {}
|
|
37040
|
-
// }
|
|
37041
|
-
|
|
37042
|
-
var commentContainer = isNested ? element.parent.children : // global rule at the root level
|
|
37043
|
-
children;
|
|
37044
|
-
|
|
37045
|
-
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
37046
|
-
var node = commentContainer[i];
|
|
37047
|
-
|
|
37048
|
-
if (node.line < element.line) {
|
|
37049
|
-
break;
|
|
37050
|
-
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
|
|
37051
|
-
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
|
|
37052
|
-
// this will also match inputs like this:
|
|
37053
|
-
// .a {
|
|
37054
|
-
// /* comm */
|
|
37055
|
-
// .b {}
|
|
37056
|
-
// }
|
|
37057
|
-
//
|
|
37058
|
-
// but that is fine
|
|
37059
|
-
//
|
|
37060
|
-
// it would be the easiest to change the placement of the comment to be the first child of the rule:
|
|
37061
|
-
// .a {
|
|
37062
|
-
// .b { /* comm */ }
|
|
37063
|
-
// }
|
|
37064
|
-
// with such inputs we wouldn't have to search for the comment at all
|
|
37065
|
-
// TODO: consider changing this comment placement in the next major version
|
|
37066
|
-
|
|
37067
|
-
|
|
37068
|
-
if (node.column < element.column) {
|
|
37069
|
-
if (isIgnoringComment(node)) {
|
|
37070
|
-
return;
|
|
37071
|
-
}
|
|
37072
|
-
|
|
37073
|
-
break;
|
|
37074
|
-
}
|
|
37075
|
-
}
|
|
37076
|
-
|
|
37077
|
-
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
37078
|
-
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
|
|
37079
|
-
});
|
|
37080
|
-
}
|
|
37081
|
-
};
|
|
37082
|
-
};
|
|
37083
|
-
|
|
37084
|
-
var isImportRule = function isImportRule(element) {
|
|
37085
|
-
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
37086
|
-
};
|
|
37087
|
-
|
|
37088
|
-
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
|
|
37089
|
-
for (var i = index - 1; i >= 0; i--) {
|
|
37090
|
-
if (!isImportRule(children[i])) {
|
|
37091
|
-
return true;
|
|
37092
|
-
}
|
|
37093
|
-
}
|
|
37094
|
-
|
|
37095
|
-
return false;
|
|
37096
|
-
}; // use this to remove incorrect elements from further processing
|
|
37097
|
-
// so they don't get handed to the `sheet` (or anything else)
|
|
37098
|
-
// as that could potentially lead to additional logs which in turn could be overhelming to the user
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
var nullifyElement = function nullifyElement(element) {
|
|
37102
|
-
element.type = '';
|
|
37103
|
-
element.value = '';
|
|
37104
|
-
element["return"] = '';
|
|
37105
|
-
element.children = '';
|
|
37106
|
-
element.props = '';
|
|
37107
|
-
};
|
|
37108
|
-
|
|
37109
|
-
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
|
|
37110
|
-
if (!isImportRule(element)) {
|
|
37111
|
-
return;
|
|
37112
|
-
}
|
|
37113
|
-
|
|
37114
|
-
if (element.parent) {
|
|
37115
|
-
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
37116
|
-
nullifyElement(element);
|
|
37117
|
-
} else if (isPrependedWithRegularRules(index, children)) {
|
|
37118
|
-
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
37119
|
-
nullifyElement(element);
|
|
37120
|
-
}
|
|
37121
|
-
};
|
|
37122
37146
|
|
|
37123
37147
|
/* eslint-disable no-fallthrough */
|
|
37124
37148
|
|
|
@@ -37332,22 +37356,46 @@ var prefixer = function prefixer(element, index, children, callback) {
|
|
|
37332
37356
|
}
|
|
37333
37357
|
};
|
|
37334
37358
|
|
|
37359
|
+
/* import type { StylisPlugin } from './types' */
|
|
37360
|
+
|
|
37361
|
+
/*
|
|
37362
|
+
export type Options = {
|
|
37363
|
+
nonce?: string,
|
|
37364
|
+
stylisPlugins?: StylisPlugin[],
|
|
37365
|
+
key: string,
|
|
37366
|
+
container?: HTMLElement,
|
|
37367
|
+
speedy?: boolean,
|
|
37368
|
+
prepend?: boolean,
|
|
37369
|
+
insertionPoint?: HTMLElement
|
|
37370
|
+
}
|
|
37371
|
+
*/
|
|
37372
|
+
|
|
37373
|
+
var getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {
|
|
37374
|
+
return memoize(function () {
|
|
37375
|
+
var cache = {};
|
|
37376
|
+
return function (name) {
|
|
37377
|
+
return cache[name];
|
|
37378
|
+
};
|
|
37379
|
+
});
|
|
37380
|
+
});
|
|
37335
37381
|
var defaultStylisPlugins = [prefixer];
|
|
37336
37382
|
|
|
37337
|
-
var createCache = function
|
|
37383
|
+
var createCache = function
|
|
37384
|
+
/*: EmotionCache */
|
|
37385
|
+
createCache(options
|
|
37386
|
+
/*: Options */
|
|
37387
|
+
) {
|
|
37338
37388
|
var key = options.key;
|
|
37339
37389
|
|
|
37340
|
-
if (
|
|
37341
|
-
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
37342
|
-
}
|
|
37343
|
-
|
|
37344
|
-
if (key === 'css') {
|
|
37390
|
+
if (isBrowser && key === 'css') {
|
|
37345
37391
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
37346
37392
|
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
37347
37393
|
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
37348
37394
|
// that creating a cache works inside of render of a React component
|
|
37349
37395
|
|
|
37350
|
-
Array.prototype.forEach.call(ssrStyles, function (node
|
|
37396
|
+
Array.prototype.forEach.call(ssrStyles, function (node
|
|
37397
|
+
/*: HTMLStyleElement */
|
|
37398
|
+
) {
|
|
37351
37399
|
// we want to only move elements which have a space in the data-emotion attribute value
|
|
37352
37400
|
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
37353
37401
|
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
@@ -37359,6 +37407,7 @@ var createCache = function createCache(options) {
|
|
|
37359
37407
|
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
37360
37408
|
return;
|
|
37361
37409
|
}
|
|
37410
|
+
|
|
37362
37411
|
document.head.appendChild(node);
|
|
37363
37412
|
node.setAttribute('data-s', '');
|
|
37364
37413
|
});
|
|
@@ -37366,23 +37415,20 @@ var createCache = function createCache(options) {
|
|
|
37366
37415
|
|
|
37367
37416
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
37368
37417
|
|
|
37369
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
37370
|
-
// $FlowFixMe
|
|
37371
|
-
if (/[^a-z-]/.test(key)) {
|
|
37372
|
-
throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
|
|
37373
|
-
}
|
|
37374
|
-
}
|
|
37375
|
-
|
|
37376
37418
|
var inserted = {};
|
|
37377
37419
|
var container;
|
|
37420
|
+
/* : Node */
|
|
37421
|
+
|
|
37378
37422
|
var nodesToHydrate = [];
|
|
37379
37423
|
|
|
37380
|
-
{
|
|
37424
|
+
if (isBrowser) {
|
|
37381
37425
|
container = options.container || document.head;
|
|
37382
37426
|
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
37383
37427
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
37384
|
-
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
37385
|
-
|
|
37428
|
+
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
37429
|
+
/*: HTMLStyleElement */
|
|
37430
|
+
) {
|
|
37431
|
+
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
37386
37432
|
|
|
37387
37433
|
for (var i = 1; i < attrib.length; i++) {
|
|
37388
37434
|
inserted[attrib[i]] = true;
|
|
@@ -37393,31 +37439,19 @@ var createCache = function createCache(options) {
|
|
|
37393
37439
|
}
|
|
37394
37440
|
|
|
37395
37441
|
var _insert;
|
|
37442
|
+
/*: (
|
|
37443
|
+
selector: string,
|
|
37444
|
+
serialized: SerializedStyles,
|
|
37445
|
+
sheet: StyleSheet,
|
|
37446
|
+
shouldCache: boolean
|
|
37447
|
+
) => string | void */
|
|
37396
37448
|
|
|
37397
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
37398
|
-
|
|
37399
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
37400
|
-
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
37401
|
-
get compat() {
|
|
37402
|
-
return cache.compat;
|
|
37403
|
-
}
|
|
37404
37449
|
|
|
37405
|
-
|
|
37406
|
-
}
|
|
37450
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
37407
37451
|
|
|
37408
|
-
{
|
|
37452
|
+
if (isBrowser) {
|
|
37409
37453
|
var currentSheet;
|
|
37410
|
-
var finalizingPlugins = [le,
|
|
37411
|
-
if (!element.root) {
|
|
37412
|
-
if (element["return"]) {
|
|
37413
|
-
currentSheet.insert(element["return"]);
|
|
37414
|
-
} else if (element.value && element.type !== n) {
|
|
37415
|
-
// insert empty rule in non-production environments
|
|
37416
|
-
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
|
|
37417
|
-
currentSheet.insert(element.value + "{}");
|
|
37418
|
-
}
|
|
37419
|
-
}
|
|
37420
|
-
} : pe(function (rule) {
|
|
37454
|
+
var finalizingPlugins = [le, pe(function (rule) {
|
|
37421
37455
|
currentSheet.insert(rule);
|
|
37422
37456
|
})];
|
|
37423
37457
|
var serializer = ve(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
@@ -37426,26 +37460,95 @@ var createCache = function createCache(options) {
|
|
|
37426
37460
|
return oe(ce(styles), serializer);
|
|
37427
37461
|
};
|
|
37428
37462
|
|
|
37429
|
-
_insert = function
|
|
37463
|
+
_insert = function
|
|
37464
|
+
/*: void */
|
|
37465
|
+
insert(selector
|
|
37466
|
+
/*: string */
|
|
37467
|
+
, serialized
|
|
37468
|
+
/*: SerializedStyles */
|
|
37469
|
+
, sheet
|
|
37470
|
+
/*: StyleSheet */
|
|
37471
|
+
, shouldCache
|
|
37472
|
+
/*: boolean */
|
|
37473
|
+
) {
|
|
37430
37474
|
currentSheet = sheet;
|
|
37431
37475
|
|
|
37432
|
-
if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
|
|
37433
|
-
currentSheet = {
|
|
37434
|
-
insert: function insert(rule) {
|
|
37435
|
-
sheet.insert(rule + serialized.map);
|
|
37436
|
-
}
|
|
37437
|
-
};
|
|
37438
|
-
}
|
|
37439
|
-
|
|
37440
37476
|
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
37441
37477
|
|
|
37442
37478
|
if (shouldCache) {
|
|
37443
37479
|
cache.inserted[serialized.name] = true;
|
|
37444
37480
|
}
|
|
37445
37481
|
};
|
|
37482
|
+
} else {
|
|
37483
|
+
var _finalizingPlugins = [le];
|
|
37484
|
+
|
|
37485
|
+
var _serializer = ve(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
|
|
37486
|
+
|
|
37487
|
+
var _stylis = function _stylis(styles) {
|
|
37488
|
+
return oe(ce(styles), _serializer);
|
|
37489
|
+
};
|
|
37490
|
+
|
|
37491
|
+
var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
|
|
37492
|
+
|
|
37493
|
+
var getRules = function
|
|
37494
|
+
/*: string */
|
|
37495
|
+
getRules(selector
|
|
37496
|
+
/*: string */
|
|
37497
|
+
, serialized
|
|
37498
|
+
/*: SerializedStyles */
|
|
37499
|
+
) {
|
|
37500
|
+
var name = serialized.name;
|
|
37501
|
+
|
|
37502
|
+
if (serverStylisCache[name] === undefined) {
|
|
37503
|
+
serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
37504
|
+
}
|
|
37505
|
+
|
|
37506
|
+
return serverStylisCache[name];
|
|
37507
|
+
};
|
|
37508
|
+
|
|
37509
|
+
_insert = function
|
|
37510
|
+
/*: string | void */
|
|
37511
|
+
_insert(selector
|
|
37512
|
+
/*: string */
|
|
37513
|
+
, serialized
|
|
37514
|
+
/*: SerializedStyles */
|
|
37515
|
+
, sheet
|
|
37516
|
+
/*: StyleSheet */
|
|
37517
|
+
, shouldCache
|
|
37518
|
+
/*: boolean */
|
|
37519
|
+
) {
|
|
37520
|
+
var name = serialized.name;
|
|
37521
|
+
var rules = getRules(selector, serialized);
|
|
37522
|
+
|
|
37523
|
+
if (cache.compat === undefined) {
|
|
37524
|
+
// in regular mode, we don't set the styles on the inserted cache
|
|
37525
|
+
// since we don't need to and that would be wasting memory
|
|
37526
|
+
// we return them so that they are rendered in a style tag
|
|
37527
|
+
if (shouldCache) {
|
|
37528
|
+
cache.inserted[name] = true;
|
|
37529
|
+
}
|
|
37530
|
+
|
|
37531
|
+
return rules;
|
|
37532
|
+
} else {
|
|
37533
|
+
// in compat mode, we put the styles on the inserted cache so
|
|
37534
|
+
// that emotion-server can pull out the styles
|
|
37535
|
+
// except when we don't want to cache it which was in Global but now
|
|
37536
|
+
// is nowhere but we don't want to do a major right now
|
|
37537
|
+
// and just in case we're going to leave the case here
|
|
37538
|
+
// it's also not affecting client side bundle size
|
|
37539
|
+
// so it's really not a big deal
|
|
37540
|
+
if (shouldCache) {
|
|
37541
|
+
cache.inserted[name] = rules;
|
|
37542
|
+
} else {
|
|
37543
|
+
return rules;
|
|
37544
|
+
}
|
|
37545
|
+
}
|
|
37546
|
+
};
|
|
37446
37547
|
}
|
|
37447
37548
|
|
|
37448
|
-
var cache
|
|
37549
|
+
var cache
|
|
37550
|
+
/*: EmotionCache */
|
|
37551
|
+
= {
|
|
37449
37552
|
key: key,
|
|
37450
37553
|
sheet: new StyleSheet({
|
|
37451
37554
|
key: key,
|
|
@@ -37692,7 +37795,8 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
37692
37795
|
}
|
|
37693
37796
|
});
|
|
37694
37797
|
|
|
37695
|
-
var isBrowser =
|
|
37798
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
37799
|
+
|
|
37696
37800
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
37697
37801
|
var rawClassName = '';
|
|
37698
37802
|
classNames.split(' ').forEach(function (className) {
|
|
@@ -37716,7 +37820,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
|
37716
37820
|
// in node since emotion-server relies on whether a style is in
|
|
37717
37821
|
// the registered cache to know whether a style is global or not
|
|
37718
37822
|
// also, note that this check will be dead code eliminated in the browser
|
|
37719
|
-
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
37823
|
+
isBrowser$1 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
37720
37824
|
cache.registered[className] = serialized.styles;
|
|
37721
37825
|
}
|
|
37722
37826
|
};
|
|
@@ -37725,13 +37829,22 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
37725
37829
|
var className = cache.key + "-" + serialized.name;
|
|
37726
37830
|
|
|
37727
37831
|
if (cache.inserted[serialized.name] === undefined) {
|
|
37832
|
+
var stylesForSSR = '';
|
|
37728
37833
|
var current = serialized;
|
|
37729
37834
|
|
|
37730
37835
|
do {
|
|
37731
|
-
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
37836
|
+
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
37837
|
+
|
|
37838
|
+
if (!isBrowser$1 && maybeStyles !== undefined) {
|
|
37839
|
+
stylesForSSR += maybeStyles;
|
|
37840
|
+
}
|
|
37732
37841
|
|
|
37733
37842
|
current = current.next;
|
|
37734
37843
|
} while (current !== undefined);
|
|
37844
|
+
|
|
37845
|
+
if (!isBrowser$1 && stylesForSSR.length !== 0) {
|
|
37846
|
+
return stylesForSSR;
|
|
37847
|
+
}
|
|
37735
37848
|
}
|
|
37736
37849
|
};
|
|
37737
37850
|
|
|
@@ -37839,8 +37952,16 @@ var unitlessKeys = {
|
|
|
37839
37952
|
strokeWidth: 1
|
|
37840
37953
|
};
|
|
37841
37954
|
|
|
37842
|
-
|
|
37843
|
-
var
|
|
37955
|
+
function memoize$1(fn) {
|
|
37956
|
+
var cache = Object.create(null);
|
|
37957
|
+
return function (arg) {
|
|
37958
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
37959
|
+
return cache[arg];
|
|
37960
|
+
};
|
|
37961
|
+
}
|
|
37962
|
+
|
|
37963
|
+
var isDevelopment$1 = false;
|
|
37964
|
+
|
|
37844
37965
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
37845
37966
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
37846
37967
|
|
|
@@ -37852,7 +37973,7 @@ var isProcessableValue = function isProcessableValue(value) {
|
|
|
37852
37973
|
return value != null && typeof value !== 'boolean';
|
|
37853
37974
|
};
|
|
37854
37975
|
|
|
37855
|
-
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
|
|
37976
|
+
var processStyleName = /* #__PURE__ */memoize$1(function (styleName) {
|
|
37856
37977
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
37857
37978
|
});
|
|
37858
37979
|
|
|
@@ -37881,34 +38002,6 @@ var processStyleValue = function processStyleValue(key, value) {
|
|
|
37881
38002
|
return value;
|
|
37882
38003
|
};
|
|
37883
38004
|
|
|
37884
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
37885
|
-
var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
37886
|
-
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
|
|
37887
|
-
var oldProcessStyleValue = processStyleValue;
|
|
37888
|
-
var msPattern = /^-ms-/;
|
|
37889
|
-
var hyphenPattern = /-(.)/g;
|
|
37890
|
-
var hyphenatedCache = {};
|
|
37891
|
-
|
|
37892
|
-
processStyleValue = function processStyleValue(key, value) {
|
|
37893
|
-
if (key === 'content') {
|
|
37894
|
-
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
37895
|
-
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
37896
|
-
}
|
|
37897
|
-
}
|
|
37898
|
-
|
|
37899
|
-
var processed = oldProcessStyleValue(key, value);
|
|
37900
|
-
|
|
37901
|
-
if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
|
|
37902
|
-
hyphenatedCache[key] = true;
|
|
37903
|
-
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
|
|
37904
|
-
return _char.toUpperCase();
|
|
37905
|
-
}) + "?");
|
|
37906
|
-
}
|
|
37907
|
-
|
|
37908
|
-
return processed;
|
|
37909
|
-
};
|
|
37910
|
-
}
|
|
37911
|
-
|
|
37912
38005
|
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
|
|
37913
38006
|
|
|
37914
38007
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
@@ -37916,12 +38009,11 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
37916
38009
|
return '';
|
|
37917
38010
|
}
|
|
37918
38011
|
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
|
|
37922
|
-
}
|
|
38012
|
+
var componentSelector = interpolation;
|
|
38013
|
+
|
|
38014
|
+
if (componentSelector.__emotion_styles !== undefined) {
|
|
37923
38015
|
|
|
37924
|
-
return
|
|
38016
|
+
return componentSelector;
|
|
37925
38017
|
}
|
|
37926
38018
|
|
|
37927
38019
|
switch (typeof interpolation) {
|
|
@@ -37932,17 +38024,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
37932
38024
|
|
|
37933
38025
|
case 'object':
|
|
37934
38026
|
{
|
|
37935
|
-
|
|
38027
|
+
var keyframes = interpolation;
|
|
38028
|
+
|
|
38029
|
+
if (keyframes.anim === 1) {
|
|
37936
38030
|
cursor = {
|
|
37937
|
-
name:
|
|
37938
|
-
styles:
|
|
38031
|
+
name: keyframes.name,
|
|
38032
|
+
styles: keyframes.styles,
|
|
37939
38033
|
next: cursor
|
|
37940
38034
|
};
|
|
37941
|
-
return
|
|
38035
|
+
return keyframes.name;
|
|
37942
38036
|
}
|
|
37943
38037
|
|
|
37944
|
-
|
|
37945
|
-
|
|
38038
|
+
var serializedStyles = interpolation;
|
|
38039
|
+
|
|
38040
|
+
if (serializedStyles.styles !== undefined) {
|
|
38041
|
+
var next = serializedStyles.next;
|
|
37946
38042
|
|
|
37947
38043
|
if (next !== undefined) {
|
|
37948
38044
|
// not the most efficient thing ever but this is a pretty rare case
|
|
@@ -37957,11 +38053,7 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
37957
38053
|
}
|
|
37958
38054
|
}
|
|
37959
38055
|
|
|
37960
|
-
var styles =
|
|
37961
|
-
|
|
37962
|
-
if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
|
|
37963
|
-
styles += interpolation.map;
|
|
37964
|
-
}
|
|
38056
|
+
var styles = serializedStyles.styles + ";";
|
|
37965
38057
|
|
|
37966
38058
|
return styles;
|
|
37967
38059
|
}
|
|
@@ -37976,37 +38068,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
37976
38068
|
var result = interpolation(mergedProps);
|
|
37977
38069
|
cursor = previousCursor;
|
|
37978
38070
|
return handleInterpolation(mergedProps, registered, result);
|
|
37979
|
-
} else if (process.env.NODE_ENV !== 'production') {
|
|
37980
|
-
console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
|
|
37981
38071
|
}
|
|
37982
38072
|
|
|
37983
38073
|
break;
|
|
37984
38074
|
}
|
|
37985
|
-
|
|
37986
|
-
case 'string':
|
|
37987
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
37988
|
-
var matched = [];
|
|
37989
|
-
var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
|
|
37990
|
-
var fakeVarName = "animation" + matched.length;
|
|
37991
|
-
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
|
|
37992
|
-
return "${" + fakeVarName + "}";
|
|
37993
|
-
});
|
|
37994
|
-
|
|
37995
|
-
if (matched.length) {
|
|
37996
|
-
console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
|
|
37997
|
-
}
|
|
37998
|
-
}
|
|
37999
|
-
|
|
38000
|
-
break;
|
|
38001
38075
|
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
38002
38076
|
|
|
38003
38077
|
|
|
38078
|
+
var asString = interpolation;
|
|
38079
|
+
|
|
38004
38080
|
if (registered == null) {
|
|
38005
|
-
return
|
|
38081
|
+
return asString;
|
|
38006
38082
|
}
|
|
38007
38083
|
|
|
38008
|
-
var cached = registered[
|
|
38009
|
-
return cached !== undefined ? cached :
|
|
38084
|
+
var cached = registered[asString];
|
|
38085
|
+
return cached !== undefined ? cached : asString;
|
|
38010
38086
|
}
|
|
38011
38087
|
|
|
38012
38088
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
@@ -38017,44 +38093,43 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
38017
38093
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
38018
38094
|
}
|
|
38019
38095
|
} else {
|
|
38020
|
-
for (var
|
|
38021
|
-
var value = obj[
|
|
38096
|
+
for (var key in obj) {
|
|
38097
|
+
var value = obj[key];
|
|
38022
38098
|
|
|
38023
38099
|
if (typeof value !== 'object') {
|
|
38024
|
-
|
|
38025
|
-
|
|
38026
|
-
|
|
38027
|
-
string +=
|
|
38100
|
+
var asString = value;
|
|
38101
|
+
|
|
38102
|
+
if (registered != null && registered[asString] !== undefined) {
|
|
38103
|
+
string += key + "{" + registered[asString] + "}";
|
|
38104
|
+
} else if (isProcessableValue(asString)) {
|
|
38105
|
+
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
38028
38106
|
}
|
|
38029
38107
|
} else {
|
|
38030
|
-
if (
|
|
38108
|
+
if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment$1) {
|
|
38031
38109
|
throw new Error(noComponentSelectorMessage);
|
|
38032
38110
|
}
|
|
38033
38111
|
|
|
38034
38112
|
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
38035
38113
|
for (var _i = 0; _i < value.length; _i++) {
|
|
38036
38114
|
if (isProcessableValue(value[_i])) {
|
|
38037
|
-
string += processStyleName(
|
|
38115
|
+
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
38038
38116
|
}
|
|
38039
38117
|
}
|
|
38040
38118
|
} else {
|
|
38041
38119
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
38042
38120
|
|
|
38043
|
-
switch (
|
|
38121
|
+
switch (key) {
|
|
38044
38122
|
case 'animation':
|
|
38045
38123
|
case 'animationName':
|
|
38046
38124
|
{
|
|
38047
|
-
string += processStyleName(
|
|
38125
|
+
string += processStyleName(key) + ":" + interpolated + ";";
|
|
38048
38126
|
break;
|
|
38049
38127
|
}
|
|
38050
38128
|
|
|
38051
38129
|
default:
|
|
38052
38130
|
{
|
|
38053
|
-
if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
|
|
38054
|
-
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
38055
|
-
}
|
|
38056
38131
|
|
|
38057
|
-
string +=
|
|
38132
|
+
string += key + "{" + interpolated + "}";
|
|
38058
38133
|
}
|
|
38059
38134
|
}
|
|
38060
38135
|
}
|
|
@@ -38066,16 +38141,11 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
38066
38141
|
}
|
|
38067
38142
|
|
|
38068
38143
|
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
38069
|
-
var sourceMapPattern;
|
|
38070
|
-
|
|
38071
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38072
|
-
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
38073
|
-
} // this is the cursor for keyframes
|
|
38074
38144
|
// keyframes are stored on the SerializedStyles object as a linked list
|
|
38075
38145
|
|
|
38076
38146
|
|
|
38077
38147
|
var cursor;
|
|
38078
|
-
|
|
38148
|
+
function serializeStyles(args, registered, mergedProps) {
|
|
38079
38149
|
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
38080
38150
|
return args[0];
|
|
38081
38151
|
}
|
|
@@ -38089,11 +38159,9 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
38089
38159
|
stringMode = false;
|
|
38090
38160
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
38091
38161
|
} else {
|
|
38092
|
-
|
|
38093
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
38094
|
-
}
|
|
38162
|
+
var asTemplateStringsArr = strings;
|
|
38095
38163
|
|
|
38096
|
-
styles +=
|
|
38164
|
+
styles += asTemplateStringsArr[0];
|
|
38097
38165
|
} // we start at 1 since we've already handled the first arg
|
|
38098
38166
|
|
|
38099
38167
|
|
|
@@ -38101,66 +38169,47 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
38101
38169
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
38102
38170
|
|
|
38103
38171
|
if (stringMode) {
|
|
38104
|
-
|
|
38105
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
38106
|
-
}
|
|
38172
|
+
var templateStringsArr = strings;
|
|
38107
38173
|
|
|
38108
|
-
styles +=
|
|
38174
|
+
styles += templateStringsArr[i];
|
|
38109
38175
|
}
|
|
38110
38176
|
}
|
|
38111
38177
|
|
|
38112
|
-
var sourceMap;
|
|
38113
|
-
|
|
38114
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38115
|
-
styles = styles.replace(sourceMapPattern, function (match) {
|
|
38116
|
-
sourceMap = match;
|
|
38117
|
-
return '';
|
|
38118
|
-
});
|
|
38119
|
-
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
38120
|
-
|
|
38121
38178
|
|
|
38122
38179
|
labelPattern.lastIndex = 0;
|
|
38123
38180
|
var identifierName = '';
|
|
38124
38181
|
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
38125
38182
|
|
|
38126
38183
|
while ((match = labelPattern.exec(styles)) !== null) {
|
|
38127
|
-
identifierName += '-' +
|
|
38128
|
-
match[1];
|
|
38184
|
+
identifierName += '-' + match[1];
|
|
38129
38185
|
}
|
|
38130
38186
|
|
|
38131
38187
|
var name = murmur2(styles) + identifierName;
|
|
38132
38188
|
|
|
38133
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38134
|
-
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
|
|
38135
|
-
return {
|
|
38136
|
-
name: name,
|
|
38137
|
-
styles: styles,
|
|
38138
|
-
map: sourceMap,
|
|
38139
|
-
next: cursor,
|
|
38140
|
-
toString: function toString() {
|
|
38141
|
-
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
38142
|
-
}
|
|
38143
|
-
};
|
|
38144
|
-
}
|
|
38145
|
-
|
|
38146
38189
|
return {
|
|
38147
38190
|
name: name,
|
|
38148
38191
|
styles: styles,
|
|
38149
38192
|
next: cursor
|
|
38150
38193
|
};
|
|
38151
|
-
}
|
|
38194
|
+
}
|
|
38195
|
+
|
|
38196
|
+
var isBrowser$2 = typeof document !== 'undefined';
|
|
38152
38197
|
|
|
38153
38198
|
var syncFallback = function syncFallback(create) {
|
|
38154
38199
|
return create();
|
|
38155
38200
|
};
|
|
38156
38201
|
|
|
38157
38202
|
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
|
|
38158
|
-
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
38159
|
-
var useInsertionEffectWithLayoutFallback = useInsertionEffect || useLayoutEffect;
|
|
38203
|
+
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : useInsertionEffect || syncFallback;
|
|
38160
38204
|
|
|
38161
|
-
var
|
|
38205
|
+
var isDevelopment$2 = false;
|
|
38206
|
+
|
|
38207
|
+
var isBrowser$3 = typeof document !== 'undefined';
|
|
38162
38208
|
|
|
38163
|
-
|
|
38209
|
+
/* import { type EmotionCache } from '@emotion/utils' */
|
|
38210
|
+
var EmotionCacheContext
|
|
38211
|
+
/*: React.Context<EmotionCache | null> */
|
|
38212
|
+
= /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
38164
38213
|
// because this module is primarily intended for the browser and node
|
|
38165
38214
|
// but it's also required in react native and similar environments sometimes
|
|
38166
38215
|
// and we could have a special build just for that
|
|
@@ -38170,77 +38219,70 @@ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
|
38170
38219
|
key: 'css'
|
|
38171
38220
|
}) : null);
|
|
38172
38221
|
|
|
38173
|
-
|
|
38174
|
-
|
|
38175
|
-
|
|
38176
|
-
|
|
38177
|
-
|
|
38178
|
-
|
|
38179
|
-
|
|
38222
|
+
var withEmotionCache = function withEmotionCache
|
|
38223
|
+
/* <Props, Ref: React.Ref<*>> */
|
|
38224
|
+
(func
|
|
38225
|
+
/*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */
|
|
38226
|
+
)
|
|
38227
|
+
/*: React.AbstractComponent<Props> */
|
|
38228
|
+
{
|
|
38229
|
+
return /*#__PURE__*/forwardRef(function (props
|
|
38230
|
+
/*: Props */
|
|
38231
|
+
, ref
|
|
38232
|
+
/*: Ref */
|
|
38233
|
+
) {
|
|
38180
38234
|
// the cache will never be null in the browser
|
|
38181
38235
|
var cache = useContext(EmotionCacheContext);
|
|
38182
38236
|
return func(props, cache, ref);
|
|
38183
38237
|
});
|
|
38184
38238
|
};
|
|
38185
38239
|
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
38189
|
-
|
|
38240
|
+
if (!isBrowser$3) {
|
|
38241
|
+
withEmotionCache = function withEmotionCache
|
|
38242
|
+
/* <Props> */
|
|
38243
|
+
(func
|
|
38244
|
+
/*: (props: Props, cache: EmotionCache) => React.Node */
|
|
38245
|
+
)
|
|
38246
|
+
/*: React.StatelessFunctionalComponent<Props> */
|
|
38247
|
+
{
|
|
38248
|
+
return function (props
|
|
38249
|
+
/*: Props */
|
|
38250
|
+
) {
|
|
38251
|
+
var cache = useContext(EmotionCacheContext);
|
|
38252
|
+
|
|
38253
|
+
if (cache === null) {
|
|
38254
|
+
// yes, we're potentially creating this on every render
|
|
38255
|
+
// it doesn't actually matter though since it's only on the server
|
|
38256
|
+
// so there will only every be a single render
|
|
38257
|
+
// that could change in the future because of suspense and etc. but for now,
|
|
38258
|
+
// this works and i don't want to optimise for a future thing that we aren't sure about
|
|
38259
|
+
cache = createCache({
|
|
38260
|
+
key: 'css'
|
|
38261
|
+
});
|
|
38262
|
+
return /*#__PURE__*/createElement(EmotionCacheContext.Provider, {
|
|
38263
|
+
value: cache
|
|
38264
|
+
}, func(props, cache));
|
|
38265
|
+
} else {
|
|
38266
|
+
return func(props, cache);
|
|
38267
|
+
}
|
|
38268
|
+
};
|
|
38269
|
+
};
|
|
38190
38270
|
}
|
|
38191
38271
|
|
|
38192
|
-
var
|
|
38193
|
-
// The match may be something like 'Object.createEmotionProps' or
|
|
38194
|
-
// 'Loader.prototype.render'
|
|
38195
|
-
var parts = functionName.split('.');
|
|
38196
|
-
return parts[parts.length - 1];
|
|
38197
|
-
};
|
|
38198
|
-
|
|
38199
|
-
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
|
|
38200
|
-
// V8
|
|
38201
|
-
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
38202
|
-
if (match) return getLastPart(match[1]); // Safari / Firefox
|
|
38203
|
-
|
|
38204
|
-
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
38205
|
-
if (match) return getLastPart(match[1]);
|
|
38206
|
-
return undefined;
|
|
38207
|
-
};
|
|
38208
|
-
|
|
38209
|
-
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
|
|
38210
|
-
// identifiers, thus we only need to replace what is a valid character for JS,
|
|
38211
|
-
// but not for CSS.
|
|
38212
|
-
|
|
38213
|
-
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
|
|
38214
|
-
return identifier.replace(/\$/g, '-');
|
|
38215
|
-
};
|
|
38216
|
-
|
|
38217
|
-
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
|
|
38218
|
-
if (!stackTrace) return undefined;
|
|
38219
|
-
var lines = stackTrace.split('\n');
|
|
38220
|
-
|
|
38221
|
-
for (var i = 0; i < lines.length; i++) {
|
|
38222
|
-
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
|
|
38223
|
-
|
|
38224
|
-
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
|
|
38225
|
-
|
|
38226
|
-
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
|
|
38227
|
-
// uppercase letter
|
|
38228
|
-
|
|
38229
|
-
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
|
|
38230
|
-
}
|
|
38272
|
+
var ThemeContext = /* #__PURE__ */createContext({});
|
|
38231
38273
|
|
|
38232
|
-
|
|
38233
|
-
};
|
|
38274
|
+
var hasOwn = {}.hasOwnProperty;
|
|
38234
38275
|
|
|
38235
38276
|
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
38236
|
-
var
|
|
38237
|
-
|
|
38238
|
-
|
|
38239
|
-
|
|
38240
|
-
|
|
38241
|
-
}
|
|
38277
|
+
var createEmotionProps = function createEmotionProps(type
|
|
38278
|
+
/*: React.ElementType */
|
|
38279
|
+
, props
|
|
38280
|
+
/*: Object */
|
|
38281
|
+
) {
|
|
38242
38282
|
|
|
38243
|
-
var newProps
|
|
38283
|
+
var newProps
|
|
38284
|
+
/*: any */
|
|
38285
|
+
= {};
|
|
38244
38286
|
|
|
38245
38287
|
for (var key in props) {
|
|
38246
38288
|
if (hasOwn.call(props, key)) {
|
|
@@ -38248,13 +38290,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
38248
38290
|
}
|
|
38249
38291
|
}
|
|
38250
38292
|
|
|
38251
|
-
newProps[typePropName] = type; //
|
|
38252
|
-
// the label hasn't already been computed
|
|
38253
|
-
|
|
38254
|
-
if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
|
|
38255
|
-
var label = getLabelFromStackTrace(new Error().stack);
|
|
38256
|
-
if (label) newProps[labelPropName] = label;
|
|
38257
|
-
}
|
|
38293
|
+
newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
|
|
38258
38294
|
|
|
38259
38295
|
return newProps;
|
|
38260
38296
|
};
|
|
@@ -38264,14 +38300,32 @@ var Insertion = function Insertion(_ref) {
|
|
|
38264
38300
|
serialized = _ref.serialized,
|
|
38265
38301
|
isStringTag = _ref.isStringTag;
|
|
38266
38302
|
registerStyles(cache, serialized, isStringTag);
|
|
38267
|
-
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
38303
|
+
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
38268
38304
|
return insertStyles(cache, serialized, isStringTag);
|
|
38269
38305
|
});
|
|
38270
38306
|
|
|
38307
|
+
if (!isBrowser$3 && rules !== undefined) {
|
|
38308
|
+
var _ref2;
|
|
38309
|
+
|
|
38310
|
+
var serializedNames = serialized.name;
|
|
38311
|
+
var next = serialized.next;
|
|
38312
|
+
|
|
38313
|
+
while (next !== undefined) {
|
|
38314
|
+
serializedNames += ' ' + next.name;
|
|
38315
|
+
next = next.next;
|
|
38316
|
+
}
|
|
38317
|
+
|
|
38318
|
+
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
38319
|
+
__html: rules
|
|
38320
|
+
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
38321
|
+
}
|
|
38322
|
+
|
|
38271
38323
|
return null;
|
|
38272
38324
|
};
|
|
38273
38325
|
|
|
38274
|
-
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
38326
|
+
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
38327
|
+
/* <any, any> */
|
|
38328
|
+
function (props, cache, ref) {
|
|
38275
38329
|
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
38276
38330
|
// not passing the registered cache to serializeStyles because it would
|
|
38277
38331
|
// make certain babel optimisations not possible
|
|
@@ -38292,25 +38346,21 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
38292
38346
|
|
|
38293
38347
|
var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));
|
|
38294
38348
|
|
|
38295
|
-
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
38296
|
-
var labelFromStack = props[labelPropName];
|
|
38297
|
-
|
|
38298
|
-
if (labelFromStack) {
|
|
38299
|
-
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
38300
|
-
}
|
|
38301
|
-
}
|
|
38302
|
-
|
|
38303
38349
|
className += cache.key + "-" + serialized.name;
|
|
38304
38350
|
var newProps = {};
|
|
38305
38351
|
|
|
38306
38352
|
for (var key in props) {
|
|
38307
|
-
if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (
|
|
38353
|
+
if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment$2 )) {
|
|
38308
38354
|
newProps[key] = props[key];
|
|
38309
38355
|
}
|
|
38310
38356
|
}
|
|
38311
38357
|
|
|
38312
|
-
newProps.ref = ref;
|
|
38313
38358
|
newProps.className = className;
|
|
38359
|
+
|
|
38360
|
+
if (ref) {
|
|
38361
|
+
newProps.ref = ref;
|
|
38362
|
+
}
|
|
38363
|
+
|
|
38314
38364
|
return /*#__PURE__*/createElement(Fragment$1, null, /*#__PURE__*/createElement(Insertion, {
|
|
38315
38365
|
cache: cache,
|
|
38316
38366
|
serialized: serialized,
|
|
@@ -38318,10 +38368,6 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
38318
38368
|
}), /*#__PURE__*/createElement(WrappedComponent, newProps));
|
|
38319
38369
|
});
|
|
38320
38370
|
|
|
38321
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38322
|
-
Emotion.displayName = 'EmotionCssPropInternal';
|
|
38323
|
-
}
|
|
38324
|
-
|
|
38325
38371
|
var Emotion$1 = Emotion;
|
|
38326
38372
|
|
|
38327
38373
|
var _extends_1 = createCommonjsModule(function (module) {
|
|
@@ -38339,143 +38385,18 @@ module.exports = _extends, module.exports.__esModule = true, module.exports["def
|
|
|
38339
38385
|
|
|
38340
38386
|
unwrapExports(_extends_1);
|
|
38341
38387
|
|
|
38342
|
-
var
|
|
38343
|
-
|
|
38344
|
-
|
|
38345
|
-
|
|
38346
|
-
|
|
38347
|
-
|
|
38348
|
-
|
|
38349
|
-
|
|
38350
|
-
|
|
38351
|
-
".": {
|
|
38352
|
-
module: {
|
|
38353
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
38354
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
38355
|
-
"default": "./dist/emotion-react.esm.js"
|
|
38356
|
-
},
|
|
38357
|
-
"import": "./dist/emotion-react.cjs.mjs",
|
|
38358
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
38359
|
-
},
|
|
38360
|
-
"./jsx-runtime": {
|
|
38361
|
-
module: {
|
|
38362
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
38363
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
38364
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
38365
|
-
},
|
|
38366
|
-
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
|
|
38367
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
38368
|
-
},
|
|
38369
|
-
"./_isolated-hnrs": {
|
|
38370
|
-
module: {
|
|
38371
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
38372
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
38373
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
38374
|
-
},
|
|
38375
|
-
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
|
|
38376
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
38377
|
-
},
|
|
38378
|
-
"./jsx-dev-runtime": {
|
|
38379
|
-
module: {
|
|
38380
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
38381
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
38382
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
38383
|
-
},
|
|
38384
|
-
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
|
|
38385
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
38386
|
-
},
|
|
38387
|
-
"./package.json": "./package.json",
|
|
38388
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
38389
|
-
"./macro": {
|
|
38390
|
-
types: {
|
|
38391
|
-
"import": "./macro.d.mts",
|
|
38392
|
-
"default": "./macro.d.ts"
|
|
38393
|
-
},
|
|
38394
|
-
"default": "./macro.js"
|
|
38395
|
-
}
|
|
38396
|
-
},
|
|
38397
|
-
types: "types/index.d.ts",
|
|
38398
|
-
files: [
|
|
38399
|
-
"src",
|
|
38400
|
-
"dist",
|
|
38401
|
-
"jsx-runtime",
|
|
38402
|
-
"jsx-dev-runtime",
|
|
38403
|
-
"_isolated-hnrs",
|
|
38404
|
-
"types/*.d.ts",
|
|
38405
|
-
"macro.*"
|
|
38406
|
-
],
|
|
38407
|
-
sideEffects: false,
|
|
38408
|
-
author: "Emotion Contributors",
|
|
38409
|
-
license: "MIT",
|
|
38410
|
-
scripts: {
|
|
38411
|
-
"test:typescript": "dtslint types"
|
|
38412
|
-
},
|
|
38413
|
-
dependencies: {
|
|
38414
|
-
"@babel/runtime": "^7.18.3",
|
|
38415
|
-
"@emotion/babel-plugin": "^11.11.0",
|
|
38416
|
-
"@emotion/cache": "^11.11.0",
|
|
38417
|
-
"@emotion/serialize": "^1.1.3",
|
|
38418
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
38419
|
-
"@emotion/utils": "^1.2.1",
|
|
38420
|
-
"@emotion/weak-memoize": "^0.3.1",
|
|
38421
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
38422
|
-
},
|
|
38423
|
-
peerDependencies: {
|
|
38424
|
-
react: ">=16.8.0"
|
|
38425
|
-
},
|
|
38426
|
-
peerDependenciesMeta: {
|
|
38427
|
-
"@types/react": {
|
|
38428
|
-
optional: true
|
|
38429
|
-
}
|
|
38430
|
-
},
|
|
38431
|
-
devDependencies: {
|
|
38432
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
38433
|
-
"@emotion/css": "11.11.2",
|
|
38434
|
-
"@emotion/css-prettifier": "1.1.3",
|
|
38435
|
-
"@emotion/server": "11.11.0",
|
|
38436
|
-
"@emotion/styled": "11.11.0",
|
|
38437
|
-
"html-tag-names": "^1.1.2",
|
|
38438
|
-
react: "16.14.0",
|
|
38439
|
-
"svg-tag-names": "^1.1.1",
|
|
38440
|
-
typescript: "^4.5.5"
|
|
38441
|
-
},
|
|
38442
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
38443
|
-
publishConfig: {
|
|
38444
|
-
access: "public"
|
|
38445
|
-
},
|
|
38446
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
38447
|
-
preconstruct: {
|
|
38448
|
-
entrypoints: [
|
|
38449
|
-
"./index.js",
|
|
38450
|
-
"./jsx-runtime.js",
|
|
38451
|
-
"./jsx-dev-runtime.js",
|
|
38452
|
-
"./_isolated-hnrs.js"
|
|
38453
|
-
],
|
|
38454
|
-
umdName: "emotionReact",
|
|
38455
|
-
exports: {
|
|
38456
|
-
envConditions: [
|
|
38457
|
-
"browser",
|
|
38458
|
-
"worker"
|
|
38459
|
-
],
|
|
38460
|
-
extra: {
|
|
38461
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
38462
|
-
"./macro": {
|
|
38463
|
-
types: {
|
|
38464
|
-
"import": "./macro.d.mts",
|
|
38465
|
-
"default": "./macro.d.ts"
|
|
38466
|
-
},
|
|
38467
|
-
"default": "./macro.js"
|
|
38468
|
-
}
|
|
38469
|
-
}
|
|
38470
|
-
}
|
|
38471
|
-
}
|
|
38472
|
-
};
|
|
38473
|
-
|
|
38474
|
-
var jsx = function jsx(type, props) {
|
|
38388
|
+
var jsx
|
|
38389
|
+
/*: typeof React.createElement */
|
|
38390
|
+
= function jsx
|
|
38391
|
+
/*: typeof React.createElement */
|
|
38392
|
+
(type
|
|
38393
|
+
/*: React.ElementType */
|
|
38394
|
+
, props
|
|
38395
|
+
/*: Object */
|
|
38396
|
+
) {
|
|
38475
38397
|
var args = arguments;
|
|
38476
38398
|
|
|
38477
38399
|
if (props == null || !hasOwn.call(props, 'css')) {
|
|
38478
|
-
// $FlowFixMe
|
|
38479
38400
|
return createElement.apply(undefined, args);
|
|
38480
38401
|
}
|
|
38481
38402
|
|
|
@@ -38486,95 +38407,16 @@ var jsx = function jsx(type, props) {
|
|
|
38486
38407
|
|
|
38487
38408
|
for (var i = 2; i < argsLength; i++) {
|
|
38488
38409
|
createElementArgArray[i] = args[i];
|
|
38489
|
-
}
|
|
38490
|
-
|
|
38410
|
+
}
|
|
38491
38411
|
|
|
38492
38412
|
return createElement.apply(null, createElementArgArray);
|
|
38493
38413
|
};
|
|
38494
38414
|
|
|
38495
|
-
|
|
38496
|
-
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
|
38497
|
-
// initial client-side render from SSR, use place of hydrating tag
|
|
38498
|
-
|
|
38499
|
-
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
38500
|
-
if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
|
|
38501
|
-
// probably using the custom createElement which
|
|
38502
|
-
// means it will be turned into a className prop
|
|
38503
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
38504
|
-
props.className || props.css)) {
|
|
38505
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
38506
|
-
warnedAboutCssPropForGlobal = true;
|
|
38507
|
-
}
|
|
38415
|
+
/* import type { Interpolation, SerializedStyles } from '@emotion/utils' */
|
|
38508
38416
|
|
|
38509
|
-
|
|
38510
|
-
|
|
38511
|
-
|
|
38512
|
-
// it's effectively like having two implementations and switching them out
|
|
38513
|
-
// so it's not actually breaking anything
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
var sheetRef = useRef();
|
|
38517
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
38518
|
-
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
38519
|
-
|
|
38520
|
-
var sheet = new cache.sheet.constructor({
|
|
38521
|
-
key: key,
|
|
38522
|
-
nonce: cache.sheet.nonce,
|
|
38523
|
-
container: cache.sheet.container,
|
|
38524
|
-
speedy: cache.sheet.isSpeedy
|
|
38525
|
-
});
|
|
38526
|
-
var rehydrating = false; // $FlowFixMe
|
|
38527
|
-
|
|
38528
|
-
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
|
|
38529
|
-
|
|
38530
|
-
if (cache.sheet.tags.length) {
|
|
38531
|
-
sheet.before = cache.sheet.tags[0];
|
|
38532
|
-
}
|
|
38533
|
-
|
|
38534
|
-
if (node !== null) {
|
|
38535
|
-
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
|
|
38536
|
-
|
|
38537
|
-
node.setAttribute('data-emotion', key);
|
|
38538
|
-
sheet.hydrate([node]);
|
|
38539
|
-
}
|
|
38540
|
-
|
|
38541
|
-
sheetRef.current = [sheet, rehydrating];
|
|
38542
|
-
return function () {
|
|
38543
|
-
sheet.flush();
|
|
38544
|
-
};
|
|
38545
|
-
}, [cache]);
|
|
38546
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
38547
|
-
var sheetRefCurrent = sheetRef.current;
|
|
38548
|
-
var sheet = sheetRefCurrent[0],
|
|
38549
|
-
rehydrating = sheetRefCurrent[1];
|
|
38550
|
-
|
|
38551
|
-
if (rehydrating) {
|
|
38552
|
-
sheetRefCurrent[1] = false;
|
|
38553
|
-
return;
|
|
38554
|
-
}
|
|
38555
|
-
|
|
38556
|
-
if (serialized.next !== undefined) {
|
|
38557
|
-
// insert keyframes
|
|
38558
|
-
insertStyles(cache, serialized.next, true);
|
|
38559
|
-
}
|
|
38560
|
-
|
|
38561
|
-
if (sheet.tags.length) {
|
|
38562
|
-
// if this doesn't exist then it will be null so the style element will be appended
|
|
38563
|
-
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
38564
|
-
sheet.before = element;
|
|
38565
|
-
sheet.flush();
|
|
38566
|
-
}
|
|
38567
|
-
|
|
38568
|
-
cache.insert("", serialized, sheet, false);
|
|
38569
|
-
}, [cache, serialized.name]);
|
|
38570
|
-
return null;
|
|
38571
|
-
});
|
|
38572
|
-
|
|
38573
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38574
|
-
Global.displayName = 'EmotionGlobal';
|
|
38575
|
-
}
|
|
38576
|
-
|
|
38577
|
-
function css() {
|
|
38417
|
+
function css()
|
|
38418
|
+
/*: SerializedStyles */
|
|
38419
|
+
{
|
|
38578
38420
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38579
38421
|
args[_key] = arguments[_key];
|
|
38580
38422
|
}
|
|
@@ -38582,10 +38424,20 @@ function css() {
|
|
|
38582
38424
|
return serializeStyles(args);
|
|
38583
38425
|
}
|
|
38584
38426
|
|
|
38585
|
-
|
|
38586
|
-
|
|
38587
|
-
|
|
38427
|
+
/*
|
|
38428
|
+
type Keyframes = {|
|
|
38429
|
+
name: string,
|
|
38430
|
+
styles: string,
|
|
38431
|
+
anim: 1,
|
|
38432
|
+
toString: () => string
|
|
38433
|
+
|} & string
|
|
38434
|
+
*/
|
|
38588
38435
|
|
|
38436
|
+
var keyframes = function
|
|
38437
|
+
/*: Keyframes */
|
|
38438
|
+
keyframes() {
|
|
38439
|
+
var insertable = css.apply(void 0, arguments);
|
|
38440
|
+
var name = "animation-" + insertable.name;
|
|
38589
38441
|
return {
|
|
38590
38442
|
name: name,
|
|
38591
38443
|
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
@@ -38596,7 +38448,21 @@ var keyframes = function keyframes() {
|
|
|
38596
38448
|
};
|
|
38597
38449
|
};
|
|
38598
38450
|
|
|
38599
|
-
|
|
38451
|
+
/*
|
|
38452
|
+
type ClassNameArg =
|
|
38453
|
+
| string
|
|
38454
|
+
| boolean
|
|
38455
|
+
| { [key: string]: boolean }
|
|
38456
|
+
| Array<ClassNameArg>
|
|
38457
|
+
| null
|
|
38458
|
+
| void
|
|
38459
|
+
*/
|
|
38460
|
+
|
|
38461
|
+
var classnames = function
|
|
38462
|
+
/*: string */
|
|
38463
|
+
classnames(args
|
|
38464
|
+
/*: Array<ClassNameArg> */
|
|
38465
|
+
) {
|
|
38600
38466
|
var len = args.length;
|
|
38601
38467
|
var i = 0;
|
|
38602
38468
|
var cls = '';
|
|
@@ -38615,9 +38481,6 @@ var classnames = function classnames(args) {
|
|
|
38615
38481
|
if (Array.isArray(arg)) {
|
|
38616
38482
|
toAdd = classnames(arg);
|
|
38617
38483
|
} else {
|
|
38618
|
-
if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
|
|
38619
|
-
console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.');
|
|
38620
|
-
}
|
|
38621
38484
|
|
|
38622
38485
|
toAdd = '';
|
|
38623
38486
|
|
|
@@ -38647,7 +38510,13 @@ var classnames = function classnames(args) {
|
|
|
38647
38510
|
return cls;
|
|
38648
38511
|
};
|
|
38649
38512
|
|
|
38650
|
-
function merge(registered
|
|
38513
|
+
function merge(registered
|
|
38514
|
+
/*: Object */
|
|
38515
|
+
, css
|
|
38516
|
+
/*: (...args: Array<any>) => string */
|
|
38517
|
+
, className
|
|
38518
|
+
/*: string */
|
|
38519
|
+
) {
|
|
38651
38520
|
var registeredStyles = [];
|
|
38652
38521
|
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
38653
38522
|
|
|
@@ -38661,22 +38530,52 @@ function merge(registered, css, className) {
|
|
|
38661
38530
|
var Insertion$1 = function Insertion(_ref) {
|
|
38662
38531
|
var cache = _ref.cache,
|
|
38663
38532
|
serializedArr = _ref.serializedArr;
|
|
38664
|
-
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
38533
|
+
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
38534
|
+
var rules = '';
|
|
38665
38535
|
|
|
38666
38536
|
for (var i = 0; i < serializedArr.length; i++) {
|
|
38667
|
-
insertStyles(cache, serializedArr[i], false);
|
|
38537
|
+
var res = insertStyles(cache, serializedArr[i], false);
|
|
38538
|
+
|
|
38539
|
+
if (!isBrowser$3 && res !== undefined) {
|
|
38540
|
+
rules += res;
|
|
38541
|
+
}
|
|
38542
|
+
}
|
|
38543
|
+
|
|
38544
|
+
if (!isBrowser$3) {
|
|
38545
|
+
return rules;
|
|
38668
38546
|
}
|
|
38669
38547
|
});
|
|
38670
38548
|
|
|
38549
|
+
if (!isBrowser$3 && rules.length !== 0) {
|
|
38550
|
+
var _ref2;
|
|
38551
|
+
|
|
38552
|
+
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
38553
|
+
return serialized.name;
|
|
38554
|
+
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
38555
|
+
__html: rules
|
|
38556
|
+
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
38557
|
+
}
|
|
38558
|
+
|
|
38671
38559
|
return null;
|
|
38672
38560
|
};
|
|
38673
|
-
|
|
38674
|
-
|
|
38561
|
+
/*
|
|
38562
|
+
type Props = {
|
|
38563
|
+
children: ({
|
|
38564
|
+
css: (...args: any) => string,
|
|
38565
|
+
cx: (...args: Array<ClassNameArg>) => string,
|
|
38566
|
+
theme: Object
|
|
38567
|
+
}) => React.Node
|
|
38568
|
+
} */
|
|
38569
|
+
|
|
38570
|
+
|
|
38571
|
+
var ClassNames
|
|
38572
|
+
/*: React.AbstractComponent<Props>*/
|
|
38573
|
+
= /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
38675
38574
|
var hasRendered = false;
|
|
38676
38575
|
var serializedArr = [];
|
|
38677
38576
|
|
|
38678
38577
|
var css = function css() {
|
|
38679
|
-
if (hasRendered &&
|
|
38578
|
+
if (hasRendered && isDevelopment$2) {
|
|
38680
38579
|
throw new Error('css can only be used during render');
|
|
38681
38580
|
}
|
|
38682
38581
|
|
|
@@ -38692,7 +38591,7 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
38692
38591
|
};
|
|
38693
38592
|
|
|
38694
38593
|
var cx = function cx() {
|
|
38695
|
-
if (hasRendered &&
|
|
38594
|
+
if (hasRendered && isDevelopment$2) {
|
|
38696
38595
|
throw new Error('cx can only be used during render');
|
|
38697
38596
|
}
|
|
38698
38597
|
|
|
@@ -38716,30 +38615,6 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
|
38716
38615
|
}), ele);
|
|
38717
38616
|
});
|
|
38718
38617
|
|
|
38719
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38720
|
-
ClassNames.displayName = 'EmotionClassNames';
|
|
38721
|
-
}
|
|
38722
|
-
|
|
38723
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
38724
|
-
var isBrowser$1 = "object" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked
|
|
38725
|
-
|
|
38726
|
-
var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';
|
|
38727
|
-
|
|
38728
|
-
if (isBrowser$1 && !isTestEnv) {
|
|
38729
|
-
// globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
|
|
38730
|
-
var globalContext = // $FlowIgnore
|
|
38731
|
-
typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
|
|
38732
|
-
: isBrowser$1 ? window : global;
|
|
38733
|
-
var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
|
|
38734
|
-
|
|
38735
|
-
if (globalContext[globalKey]) {
|
|
38736
|
-
console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');
|
|
38737
|
-
}
|
|
38738
|
-
|
|
38739
|
-
globalContext[globalKey] = true;
|
|
38740
|
-
}
|
|
38741
|
-
}
|
|
38742
|
-
|
|
38743
38618
|
function _taggedTemplateLiteral(strings, raw) {
|
|
38744
38619
|
if (!raw) {
|
|
38745
38620
|
raw = strings.slice(0);
|