@pendo/agent 2.321.2 → 2.322.0
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/dom.esm.js +1 -1
- package/dist/pendo.module.js +518 -516
- package/dist/pendo.module.min.js +5 -103
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/pendo.module.js
CHANGED
|
@@ -3967,8 +3967,8 @@ let SERVER = '';
|
|
|
3967
3967
|
let ASSET_HOST = '';
|
|
3968
3968
|
let ASSET_PATH = '';
|
|
3969
3969
|
let DESIGNER_SERVER = '';
|
|
3970
|
-
let VERSION = '2.
|
|
3971
|
-
let PACKAGE_VERSION = '2.
|
|
3970
|
+
let VERSION = '2.322.0_';
|
|
3971
|
+
let PACKAGE_VERSION = '2.322.0';
|
|
3972
3972
|
let LOADER = 'xhr';
|
|
3973
3973
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
3974
3974
|
/**
|
|
@@ -11677,9 +11677,9 @@ function isTrustedOrigin(host) {
|
|
|
11677
11677
|
/^https:\/\/hotfix-(ops|app)-([0-9]+-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11678
11678
|
/^https:\/\/pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)-static\.storage\.googleapis\.com$/,
|
|
11679
11679
|
/^https:\/\/([a-zA-Z0-9-]+\.)*pendo-dev\.com$/,
|
|
11680
|
-
/^https:\/\/([a-zA-Z0-9-]+-dot-)?pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat|au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11680
|
+
/^https:\/\/([a-zA-Z0-9-]+-dot-)?pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mango|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat|au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11681
11681
|
/^https:\/\/(via|adopt|local)\.pendo\.(local|io):\d{4}$/,
|
|
11682
|
-
/^https:\/\/pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat)-static\.storage\.googleapis\.com$/
|
|
11682
|
+
/^https:\/\/pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mango|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat)-static\.storage\.googleapis\.com$/
|
|
11683
11683
|
]; // eslint-disable-line web-sdk-eslint-rules/no-gulp-env-references
|
|
11684
11684
|
var adoptHost = ConfigReader.get('adoptHost');
|
|
11685
11685
|
if (adoptHost) {
|
|
@@ -35469,11 +35469,8 @@ var DesignerConnect = (function () {
|
|
|
35469
35469
|
globalPendo.log(pendo.app_name + ': listening to messages');
|
|
35470
35470
|
window.addEventListener('message', messageReceiver, false);
|
|
35471
35471
|
}
|
|
35472
|
-
if (window.opener && globalPendo._.isFunction(window.opener.postMessage)) {
|
|
35473
|
-
const designerTargetOrigin = pendo.getConfigValue('secureDesignerConnect') ? DESIGNER_SERVER : '*';
|
|
35474
|
-
window.opener.postMessage({ type: 'pendo::ready' }, designerTargetOrigin);
|
|
35475
|
-
}
|
|
35476
35472
|
globalPendo.onConnectMessage = onConnectMessage; // Designer still uses this in selection.js
|
|
35473
|
+
pluginAPI.Events.ready.on(onReady);
|
|
35477
35474
|
}
|
|
35478
35475
|
function teardown() {
|
|
35479
35476
|
removeListeners();
|
|
@@ -35488,6 +35485,13 @@ var DesignerConnect = (function () {
|
|
|
35488
35485
|
if (tempLaunchToken) {
|
|
35489
35486
|
tempLaunchToken = undefined;
|
|
35490
35487
|
}
|
|
35488
|
+
pluginAPI.Events.ready.off(onReady);
|
|
35489
|
+
}
|
|
35490
|
+
function onReady() {
|
|
35491
|
+
if (window.opener && globalPendo._.isFunction(window.opener.postMessage)) {
|
|
35492
|
+
const designerTargetOrigin = globalPendo.getConfigValue('secureDesignerConnect') ? DESIGNER_SERVER : '*';
|
|
35493
|
+
window.opener.postMessage({ type: 'pendo::ready' }, designerTargetOrigin);
|
|
35494
|
+
}
|
|
35491
35495
|
}
|
|
35492
35496
|
function onConnectMessage(data, msg) {
|
|
35493
35497
|
if (!globalPendo.designer) {
|
|
@@ -35536,6 +35540,10 @@ var DesignerConnect = (function () {
|
|
|
35536
35540
|
var token = msg.data.token;
|
|
35537
35541
|
if (!token)
|
|
35538
35542
|
return;
|
|
35543
|
+
if (token.publicAppId && token.publicAppId !== globalPendo.publicAppId) {
|
|
35544
|
+
globalPendo.log(`Designer launch information received was for public app ID ${token.publicAppId}, which does not match the current app ID ${globalPendo.publicAppId}. Ignoring launch request.`);
|
|
35545
|
+
return;
|
|
35546
|
+
}
|
|
35539
35547
|
tempLaunchToken = token;
|
|
35540
35548
|
registerMessageHandler('pendo-designer-launch::get-token', sendToken);
|
|
35541
35549
|
var defaultLaunchBucket = token.DADesigner ? 'da-designer' : 'in-app-designer';
|
|
@@ -40770,20 +40778,20 @@ function getZoneSafeMethod(_, method, target) {
|
|
|
40770
40778
|
}
|
|
40771
40779
|
|
|
40772
40780
|
// Does not support submit and go to
|
|
40773
|
-
|
|
40774
|
-
|
|
40781
|
+
var goToRegex = new RegExp(guideMarkdownUtil.goToString);
|
|
40782
|
+
var PollBranching = {
|
|
40775
40783
|
name: 'PollBranching',
|
|
40776
|
-
script(step, guide, pendo) {
|
|
40777
|
-
|
|
40778
|
-
|
|
40784
|
+
script: function (step, guide, pendo) {
|
|
40785
|
+
var isAdvanceIntercepted = false;
|
|
40786
|
+
var branchingQuestions = initialBranchingSetup(step, pendo);
|
|
40779
40787
|
if (branchingQuestions) {
|
|
40780
40788
|
// If there are too many branching questions saved, exit and run the guide normally.
|
|
40781
40789
|
if (pendo._.size(branchingQuestions) > 1)
|
|
40782
40790
|
return;
|
|
40783
|
-
this.on('beforeAdvance', (evt)
|
|
40784
|
-
|
|
40785
|
-
|
|
40786
|
-
|
|
40791
|
+
this.on('beforeAdvance', function (evt) {
|
|
40792
|
+
var noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
|
|
40793
|
+
var responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
|
|
40794
|
+
var noGotoLabel;
|
|
40787
40795
|
if (responseLabel) {
|
|
40788
40796
|
noGotoLabel = pendo._.isNull(responseLabel.getAttribute('goToStep'));
|
|
40789
40797
|
}
|
|
@@ -40794,58 +40802,58 @@ const PollBranching = {
|
|
|
40794
40802
|
});
|
|
40795
40803
|
}
|
|
40796
40804
|
},
|
|
40797
|
-
test(step, guide, pendo) {
|
|
40805
|
+
test: function (step, guide, pendo) {
|
|
40798
40806
|
var _a;
|
|
40799
|
-
|
|
40807
|
+
var branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
40800
40808
|
return !pendo._.isUndefined(branchingQuestions) && pendo._.size(branchingQuestions);
|
|
40801
40809
|
},
|
|
40802
|
-
designerListener(pendo) {
|
|
40803
|
-
|
|
40804
|
-
|
|
40810
|
+
designerListener: function (pendo) {
|
|
40811
|
+
var target = pendo.dom.getBody();
|
|
40812
|
+
var config = {
|
|
40805
40813
|
attributeFilter: ['data-layout'],
|
|
40806
40814
|
attributes: true,
|
|
40807
40815
|
childList: true,
|
|
40808
40816
|
characterData: true,
|
|
40809
40817
|
subtree: true
|
|
40810
40818
|
};
|
|
40811
|
-
|
|
40812
|
-
|
|
40819
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
40820
|
+
var observer = new MutationObserver(applyBranchingIndicators);
|
|
40813
40821
|
observer.observe(target, config);
|
|
40814
40822
|
function applyBranchingIndicators(mutations) {
|
|
40815
40823
|
pendo._.each(mutations, function (mutation) {
|
|
40816
40824
|
var _a;
|
|
40817
|
-
|
|
40825
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
|
|
40818
40826
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
40819
40827
|
if (mutation.addedNodes[0].querySelector('._pendo-multi-choice-poll-select-border')) {
|
|
40820
40828
|
if (pendo._.size(pendo.dom('._pendo-multi-choice-poll-question:contains("{branching/}")'))) {
|
|
40821
40829
|
pendo
|
|
40822
40830
|
.dom('._pendo-multi-choice-poll-question:contains("{branching/}")')
|
|
40823
|
-
.each((question, index)
|
|
40824
|
-
pendo._.each(pendo.dom(
|
|
40831
|
+
.each(function (question, index) {
|
|
40832
|
+
pendo._.each(pendo.dom("#".concat(question.id, " *")), function (element) {
|
|
40825
40833
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
40826
40834
|
});
|
|
40827
40835
|
pendo
|
|
40828
|
-
.dom(
|
|
40836
|
+
.dom("#".concat(question.id, " p"))
|
|
40829
40837
|
.css({ display: 'inline-block !important' })
|
|
40830
40838
|
.append(branchingIcon('#999', '20px'))
|
|
40831
40839
|
.attr({ title: 'Custom Branching Added' });
|
|
40832
|
-
|
|
40833
|
-
if (pendo.dom(
|
|
40840
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
40841
|
+
if (pendo.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]) {
|
|
40834
40842
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40835
40843
|
pendo
|
|
40836
|
-
.dom(
|
|
40844
|
+
.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]
|
|
40837
40845
|
.textContent.trim();
|
|
40838
40846
|
}
|
|
40839
|
-
|
|
40847
|
+
var pollLabels = pendo.dom("label[for*=".concat(dataPendoPollId, "]"));
|
|
40840
40848
|
if (pendo._.size(pollLabels)) {
|
|
40841
|
-
pendo._.forEach(pollLabels, (label)
|
|
40849
|
+
pendo._.forEach(pollLabels, function (label) {
|
|
40842
40850
|
if (goToRegex.test(label.textContent)) {
|
|
40843
|
-
|
|
40851
|
+
var labelTitle = goToRegex.exec(label.textContent)[2];
|
|
40844
40852
|
guideMarkdownUtil.removeMarkdownSyntax(label, goToRegex, '', pendo);
|
|
40845
40853
|
pendo
|
|
40846
40854
|
.dom(label)
|
|
40847
40855
|
.append(branchingIcon('#999', '14px'))
|
|
40848
|
-
.attr({ title:
|
|
40856
|
+
.attr({ title: "Branching to step ".concat(labelTitle) });
|
|
40849
40857
|
}
|
|
40850
40858
|
});
|
|
40851
40859
|
}
|
|
@@ -40853,9 +40861,9 @@ const PollBranching = {
|
|
|
40853
40861
|
pendo
|
|
40854
40862
|
.dom(question)
|
|
40855
40863
|
.append(branchingErrorHTML(question.dataset.pendoPollId));
|
|
40856
|
-
pendo.dom(
|
|
40864
|
+
pendo.dom("#".concat(question.id, " #pendo-ps-branching-svg")).remove();
|
|
40857
40865
|
pendo
|
|
40858
|
-
.dom(
|
|
40866
|
+
.dom("#".concat(question.id, " p"))
|
|
40859
40867
|
.css({ display: 'inline-block !important' })
|
|
40860
40868
|
.append(branchingIcon('red', '20px'))
|
|
40861
40869
|
.attr({ title: 'Unsupported Branching configuration' });
|
|
@@ -40867,49 +40875,31 @@ const PollBranching = {
|
|
|
40867
40875
|
});
|
|
40868
40876
|
}
|
|
40869
40877
|
function branchingErrorHTML(dataPendoPollId) {
|
|
40870
|
-
return
|
|
40871
|
-
font-style: italic; margin-top: 0px;" class="branching-wrapper"
|
|
40872
|
-
name="${dataPendoPollId}">
|
|
40873
|
-
* Branching Error: Multiple branching polls not supported</div>`;
|
|
40878
|
+
return "<div style=\"text-align:lrft; font-size: 14px; color: red;\n font-style: italic; margin-top: 0px;\" class=\"branching-wrapper\"\n name=\"".concat(dataPendoPollId, "\">\n * Branching Error: Multiple branching polls not supported</div>");
|
|
40874
40879
|
}
|
|
40875
40880
|
function branchingIcon(color, size) {
|
|
40876
|
-
return
|
|
40877
|
-
style="margin-left: 5px;
|
|
40878
|
-
height:${size}; width:${size}; display:inline; vertical-align:middle;" xmlns="http://www.w3.org/2000/svg">
|
|
40879
|
-
<g stroke-width="0"></g>
|
|
40880
|
-
<g stroke-linecap="round" stroke-linejoin="round"></g>
|
|
40881
|
-
<g> <circle cx="4" cy="7" r="2" stroke="${color}"
|
|
40882
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40883
|
-
<circle cx="20" cy="7" r="2" stroke="${color}"
|
|
40884
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40885
|
-
<circle cx="20" cy="17" r="2" stroke="${color}" stroke-width="2"
|
|
40886
|
-
stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40887
|
-
<path d="M18 7H6" stroke="${color}" stroke-width="2"
|
|
40888
|
-
stroke-linecap="round" stroke-linejoin="round"></path>
|
|
40889
|
-
<path d="M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18"
|
|
40890
|
-
stroke="${color}" stroke-width="2" stroke-linecap="round"
|
|
40891
|
-
stroke-linejoin="round"></path> </g></svg>`;
|
|
40881
|
+
return "<svg id=\"pendo-ps-branching-svg\" viewBox=\"0 0 24 24\" fill=\"none\"\n style=\"margin-left: 5px;\n height:".concat(size, "; width:").concat(size, "; display:inline; vertical-align:middle;\" xmlns=\"http://www.w3.org/2000/svg\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g> <circle cx=\"4\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"17\" r=\"2\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <path d=\"M18 7H6\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18\"\n stroke=\"").concat(color, "\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path> </g></svg>");
|
|
40892
40882
|
}
|
|
40893
40883
|
}
|
|
40894
40884
|
};
|
|
40895
40885
|
function initialBranchingSetup(step, pendo) {
|
|
40896
|
-
|
|
40897
|
-
pendo._.forEach(questions, (question)
|
|
40898
|
-
|
|
40899
|
-
pendo._.each(step.guideElement.find(
|
|
40886
|
+
var questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
40887
|
+
pendo._.forEach(questions, function (question) {
|
|
40888
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
40889
|
+
pendo._.each(step.guideElement.find("#".concat(question.id, " *")), function (element) {
|
|
40900
40890
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
40901
40891
|
});
|
|
40902
|
-
|
|
40903
|
-
pendo._.forEach(pollLabels, (label)
|
|
40892
|
+
var pollLabels = step.guideElement.find("label[for*=".concat(dataPendoPollId, "]"));
|
|
40893
|
+
pendo._.forEach(pollLabels, function (label) {
|
|
40904
40894
|
if (pendo._.isNull(goToRegex.exec(label.textContent))) {
|
|
40905
40895
|
return;
|
|
40906
40896
|
}
|
|
40907
|
-
|
|
40908
|
-
|
|
40897
|
+
var gotoSubstring = goToRegex.exec(label.textContent)[1];
|
|
40898
|
+
var gotoIndex = goToRegex.exec(label.textContent)[2];
|
|
40909
40899
|
label.setAttribute('goToStep', gotoIndex);
|
|
40910
40900
|
guideMarkdownUtil.removeMarkdownSyntax(label, gotoSubstring, '', pendo);
|
|
40911
40901
|
});
|
|
40912
|
-
|
|
40902
|
+
var pollChoiceContainer = step.guideElement.find("[data-pendo-poll-id=".concat(dataPendoPollId, "]._pendo-multi-choice-poll-select-border"));
|
|
40913
40903
|
if (pollChoiceContainer && pollChoiceContainer.length) {
|
|
40914
40904
|
pollChoiceContainer[0].setAttribute('branching', '');
|
|
40915
40905
|
}
|
|
@@ -40918,24 +40908,24 @@ function initialBranchingSetup(step, pendo) {
|
|
|
40918
40908
|
}
|
|
40919
40909
|
function branchingGoToStep(event, step, guide, pendo) {
|
|
40920
40910
|
var _a;
|
|
40921
|
-
|
|
40922
|
-
|
|
40923
|
-
|
|
40924
|
-
|
|
40911
|
+
var checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
40912
|
+
var checkedPollLabel = step.guideElement.find("label[for=\"".concat(checkedPollInputId, "\"]"))[0];
|
|
40913
|
+
var checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
|
|
40914
|
+
var pollStepIndex = checkedPollLabelStepIndex - 1;
|
|
40925
40915
|
if (pollStepIndex < 0)
|
|
40926
40916
|
return;
|
|
40927
|
-
|
|
40917
|
+
var destinationObject = {
|
|
40928
40918
|
destinationStepId: guide.steps[pollStepIndex].id,
|
|
40929
|
-
step
|
|
40919
|
+
step: step
|
|
40930
40920
|
};
|
|
40931
40921
|
pendo.goToStep(destinationObject);
|
|
40932
40922
|
event.cancel = true;
|
|
40933
40923
|
}
|
|
40934
40924
|
|
|
40935
|
-
|
|
40925
|
+
var MetadataSubstitution = {
|
|
40936
40926
|
name: 'MetadataSubstitution',
|
|
40937
|
-
script(step, guide, pendo) {
|
|
40938
|
-
|
|
40927
|
+
script: function (step, guide, pendo) {
|
|
40928
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40939
40929
|
if (step.domJson) {
|
|
40940
40930
|
findSubstitutableUrlsInJson(step.domJson, placeholderData, pendo);
|
|
40941
40931
|
}
|
|
@@ -40943,22 +40933,22 @@ const MetadataSubstitution = {
|
|
|
40943
40933
|
pendo._.each(placeholderData, function (placeholder) {
|
|
40944
40934
|
processPlaceholder(placeholder, pendo);
|
|
40945
40935
|
});
|
|
40946
|
-
|
|
40947
|
-
|
|
40948
|
-
updateGuideContainer(containerId,
|
|
40936
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40937
|
+
var context_1 = step.guideElement;
|
|
40938
|
+
updateGuideContainer(containerId, context_1, pendo);
|
|
40949
40939
|
}
|
|
40950
40940
|
},
|
|
40951
|
-
designerListener(pendo) {
|
|
40952
|
-
|
|
40941
|
+
designerListener: function (pendo) {
|
|
40942
|
+
var target = pendo.dom.getBody();
|
|
40953
40943
|
if (pendo.designerv2) {
|
|
40954
40944
|
pendo.designerv2.runMetadataSubstitutionForDesignerPreview = function runMetadataSubstitutionForDesignerPreview() {
|
|
40955
40945
|
var _a;
|
|
40956
40946
|
if (!document.querySelector(guideMarkdownUtil.containerSelector))
|
|
40957
40947
|
return;
|
|
40958
|
-
|
|
40948
|
+
var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
40959
40949
|
if (!step)
|
|
40960
40950
|
return;
|
|
40961
|
-
|
|
40951
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40962
40952
|
if (step.buildingBlocks) {
|
|
40963
40953
|
findSubstitutableUrlsInJson(step.buildingBlocks, placeholderData, pendo);
|
|
40964
40954
|
}
|
|
@@ -40968,32 +40958,32 @@ const MetadataSubstitution = {
|
|
|
40968
40958
|
return;
|
|
40969
40959
|
processPlaceholder(placeholder, pendo);
|
|
40970
40960
|
});
|
|
40971
|
-
|
|
40972
|
-
|
|
40973
|
-
updateGuideContainer(containerId,
|
|
40961
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40962
|
+
var context_2 = step.guideElement;
|
|
40963
|
+
updateGuideContainer(containerId, context_2, pendo);
|
|
40974
40964
|
}
|
|
40975
40965
|
};
|
|
40976
40966
|
}
|
|
40977
|
-
|
|
40967
|
+
var config = {
|
|
40978
40968
|
attributeFilter: ['data-layout'],
|
|
40979
40969
|
attributes: true,
|
|
40980
40970
|
childList: true,
|
|
40981
40971
|
characterData: true,
|
|
40982
40972
|
subtree: true
|
|
40983
40973
|
};
|
|
40984
|
-
|
|
40985
|
-
|
|
40974
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
40975
|
+
var observer = new MutationObserver(applySubstitutionIndicators);
|
|
40986
40976
|
observer.observe(target, config);
|
|
40987
40977
|
function applySubstitutionIndicators(mutations) {
|
|
40988
40978
|
pendo._.each(mutations, function (mutation) {
|
|
40989
40979
|
var _a;
|
|
40990
40980
|
if (mutation.addedNodes.length) {
|
|
40991
40981
|
if (document.querySelector(guideMarkdownUtil.containerSelector)) {
|
|
40992
|
-
|
|
40993
|
-
|
|
40982
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40983
|
+
var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
40994
40984
|
if (!step)
|
|
40995
40985
|
return;
|
|
40996
|
-
|
|
40986
|
+
var pendoBlocks = step.buildingBlocks;
|
|
40997
40987
|
if (!pendo._.isUndefined(pendoBlocks)) {
|
|
40998
40988
|
findSubstitutableUrlsInJson(pendoBlocks, placeholderData, pendo);
|
|
40999
40989
|
}
|
|
@@ -41003,9 +40993,9 @@ const MetadataSubstitution = {
|
|
|
41003
40993
|
return;
|
|
41004
40994
|
processPlaceholder(placeholder, pendo);
|
|
41005
40995
|
});
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
updateGuideContainer(containerId,
|
|
40996
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40997
|
+
var context_3 = step.guideElement;
|
|
40998
|
+
updateGuideContainer(containerId, context_3, pendo);
|
|
41009
40999
|
}
|
|
41010
41000
|
}
|
|
41011
41001
|
}
|
|
@@ -41014,18 +41004,18 @@ const MetadataSubstitution = {
|
|
|
41014
41004
|
}
|
|
41015
41005
|
};
|
|
41016
41006
|
function processPlaceholder(placeholder, pendo) {
|
|
41017
|
-
|
|
41018
|
-
|
|
41019
|
-
|
|
41007
|
+
var match;
|
|
41008
|
+
var data = placeholder.data, target = placeholder.target;
|
|
41009
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41020
41010
|
while ((match = matchPlaceholder(placeholder, subRegex))) {
|
|
41021
|
-
|
|
41022
|
-
|
|
41011
|
+
var usedArrayPath = Array.isArray(match) && match.length >= 2;
|
|
41012
|
+
var currentStr = target === 'textContent'
|
|
41023
41013
|
? data[target]
|
|
41024
41014
|
: decodeURI((data.getAttribute && (target === 'href' || target === 'value') ? (data.getAttribute(target) || '') : data[target]));
|
|
41025
|
-
|
|
41015
|
+
var matched = usedArrayPath ? match : subRegex.exec(currentStr);
|
|
41026
41016
|
if (!matched)
|
|
41027
41017
|
continue;
|
|
41028
|
-
|
|
41018
|
+
var mdValue = getSubstituteValue(matched, pendo);
|
|
41029
41019
|
substituteMetadataByTarget(data, target, mdValue, matched);
|
|
41030
41020
|
}
|
|
41031
41021
|
}
|
|
@@ -41034,48 +41024,48 @@ function matchPlaceholder(placeholder, regex) {
|
|
|
41034
41024
|
return placeholder.data[placeholder.target].match(regex);
|
|
41035
41025
|
}
|
|
41036
41026
|
else {
|
|
41037
|
-
|
|
41027
|
+
var raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
|
|
41038
41028
|
? (placeholder.data.getAttribute(placeholder.target) || '')
|
|
41039
41029
|
: placeholder.data[placeholder.target];
|
|
41040
41030
|
return decodeURI(raw).match(regex);
|
|
41041
41031
|
}
|
|
41042
41032
|
}
|
|
41043
41033
|
function getMetadataValueCaseInsensitive(metadata, type, property) {
|
|
41044
|
-
|
|
41034
|
+
var kind = metadata && metadata[type];
|
|
41045
41035
|
if (!kind || typeof kind !== 'object')
|
|
41046
41036
|
return undefined;
|
|
41047
|
-
|
|
41037
|
+
var direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
|
|
41048
41038
|
if (direct !== undefined) {
|
|
41049
41039
|
return direct;
|
|
41050
41040
|
}
|
|
41051
|
-
|
|
41052
|
-
|
|
41053
|
-
|
|
41041
|
+
var propLower = property.toLowerCase();
|
|
41042
|
+
var key = Object.keys(kind).find(function (k) { return k.toLowerCase() === propLower; });
|
|
41043
|
+
var value = key !== undefined ? kind[key] : undefined;
|
|
41054
41044
|
return value;
|
|
41055
41045
|
}
|
|
41056
41046
|
function getSubstituteValue(match, pendo) {
|
|
41057
41047
|
if (pendo._.isUndefined(match[1]) || pendo._.isUndefined(match[2])) {
|
|
41058
41048
|
return;
|
|
41059
41049
|
}
|
|
41060
|
-
|
|
41061
|
-
|
|
41062
|
-
|
|
41050
|
+
var type = match[1];
|
|
41051
|
+
var property = match[2];
|
|
41052
|
+
var defaultValue = match[3];
|
|
41063
41053
|
if (pendo._.isUndefined(type) || pendo._.isUndefined(property)) {
|
|
41064
41054
|
return;
|
|
41065
41055
|
}
|
|
41066
|
-
|
|
41067
|
-
|
|
41056
|
+
var metadata = pendo.getSerializedMetadata();
|
|
41057
|
+
var mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
|
|
41068
41058
|
if (mdValue === undefined || mdValue === null)
|
|
41069
41059
|
mdValue = defaultValue || '';
|
|
41070
41060
|
return mdValue;
|
|
41071
41061
|
}
|
|
41072
41062
|
function substituteMetadataByTarget(data, target, mdValue, matched) {
|
|
41073
|
-
|
|
41074
|
-
|
|
41063
|
+
var isElement = data && typeof data.getAttribute === 'function';
|
|
41064
|
+
var current = (target === 'href' || target === 'value') && isElement
|
|
41075
41065
|
? (data.getAttribute(target) || '')
|
|
41076
41066
|
: data[target];
|
|
41077
41067
|
if (target === 'href' || target === 'value') {
|
|
41078
|
-
|
|
41068
|
+
var safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
|
|
41079
41069
|
data[target] = decodeURI(current).replace(matched[0], safeValue);
|
|
41080
41070
|
}
|
|
41081
41071
|
else {
|
|
@@ -41089,8 +41079,9 @@ function updateGuideContainer(containerId, context, pendo) {
|
|
|
41089
41079
|
pendo.flexElement(pendo.dom(guideMarkdownUtil.containerSelector));
|
|
41090
41080
|
pendo.BuildingBlocks.BuildingBlockGuides.recalculateGuideHeight(containerId, context);
|
|
41091
41081
|
}
|
|
41092
|
-
function findSubstitutableUrlsInJson(originalData, placeholderData
|
|
41093
|
-
|
|
41082
|
+
function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
|
|
41083
|
+
if (placeholderData === void 0) { placeholderData = []; }
|
|
41084
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41094
41085
|
if ((originalData.name === 'url' || originalData.name === 'href') && originalData.value) {
|
|
41095
41086
|
if (subRegex.test(originalData.value)) {
|
|
41096
41087
|
placeholderData.push({
|
|
@@ -41100,37 +41091,37 @@ function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo)
|
|
|
41100
41091
|
}
|
|
41101
41092
|
}
|
|
41102
41093
|
if (originalData.properties && originalData.id === 'href_link_block') {
|
|
41103
|
-
pendo._.each(originalData.properties, (prop)
|
|
41094
|
+
pendo._.each(originalData.properties, function (prop) {
|
|
41104
41095
|
findSubstitutableUrlsInJson(prop, placeholderData, pendo);
|
|
41105
41096
|
});
|
|
41106
41097
|
}
|
|
41107
41098
|
if (originalData.views) {
|
|
41108
|
-
pendo._.each(originalData.views, (view)
|
|
41099
|
+
pendo._.each(originalData.views, function (view) {
|
|
41109
41100
|
findSubstitutableUrlsInJson(view, placeholderData, pendo);
|
|
41110
41101
|
});
|
|
41111
41102
|
}
|
|
41112
41103
|
if (originalData.parameters) {
|
|
41113
|
-
pendo._.each(originalData.parameters, (param)
|
|
41104
|
+
pendo._.each(originalData.parameters, function (param) {
|
|
41114
41105
|
findSubstitutableUrlsInJson(param, placeholderData, pendo);
|
|
41115
41106
|
});
|
|
41116
41107
|
}
|
|
41117
41108
|
if (originalData.actions) {
|
|
41118
|
-
pendo._.each(originalData.actions, (action)
|
|
41109
|
+
pendo._.each(originalData.actions, function (action) {
|
|
41119
41110
|
findSubstitutableUrlsInJson(action, placeholderData, pendo);
|
|
41120
41111
|
});
|
|
41121
41112
|
}
|
|
41122
41113
|
if (originalData.children) {
|
|
41123
|
-
pendo._.each(originalData.children, (child)
|
|
41114
|
+
pendo._.each(originalData.children, function (child) {
|
|
41124
41115
|
findSubstitutableUrlsInJson(child, placeholderData, pendo);
|
|
41125
41116
|
});
|
|
41126
41117
|
}
|
|
41127
41118
|
return placeholderData;
|
|
41128
41119
|
}
|
|
41129
41120
|
function findSubstitutableElements(pendo) {
|
|
41130
|
-
|
|
41121
|
+
var elements = pendo.dom("".concat(guideMarkdownUtil.containerSelector, " *:not(.pendo-inline-ui)"));
|
|
41131
41122
|
return pendo._.chain(elements)
|
|
41132
41123
|
.filter(function (placeholder) {
|
|
41133
|
-
|
|
41124
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41134
41125
|
if (placeholder.localName === 'a') {
|
|
41135
41126
|
return subRegex.test(decodeURI(placeholder.href)) || subRegex.test(placeholder.textContent);
|
|
41136
41127
|
}
|
|
@@ -41186,51 +41177,25 @@ function findSubstitutableElements(pendo) {
|
|
|
41186
41177
|
.value();
|
|
41187
41178
|
}
|
|
41188
41179
|
function substitutionIcon(color, size) {
|
|
41189
|
-
return (
|
|
41190
|
-
|
|
41191
|
-
|
|
41192
|
-
|
|
41193
|
-
|
|
41194
|
-
|
|
41195
|
-
transform="matrix(1, 0, 0, 1, 0, 0)rotate(0)">
|
|
41196
|
-
<g stroke-width="0"></g>
|
|
41197
|
-
<g stroke-linecap="round" stroke-linejoin="round"
|
|
41198
|
-
stroke="${color}" stroke-width="0.528"></g>
|
|
41199
|
-
<g><path fill-rule="evenodd" clip-rule="evenodd"
|
|
41200
|
-
d="M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284
|
|
41201
|
-
4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5
|
|
41202
|
-
10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761
|
|
41203
|
-
11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5
|
|
41204
|
-
8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5
|
|
41205
|
-
6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386
|
|
41206
|
-
4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614
|
|
41207
|
-
10.5 8.5 10.2761 8.5 10V7Z" fill="${color}"></path>
|
|
41208
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
41209
|
-
d="M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5
|
|
41210
|
-
6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5
|
|
41211
|
-
16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284
|
|
41212
|
-
18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5
|
|
41213
|
-
19 12.5H16C15.1716 12.5 14.5 13.1716 14.5
|
|
41214
|
-
14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16
|
|
41215
|
-
17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5
|
|
41216
|
-
13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5
|
|
41217
|
-
13.7239 15.5 14V17Z" fill="${color}"></path> </g></svg></div>`);
|
|
41218
|
-
}
|
|
41219
|
-
|
|
41220
|
-
const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
41221
|
-
const requiredSyntax = '{required/}';
|
|
41222
|
-
const RequiredQuestions = {
|
|
41180
|
+
return ("<div title=\"Metadata Substitution added\">\n <svg id=\"pendo-ps-substitution-icon\" viewBox=\"0 0 24 24\"\n preserveAspectRatio=\"xMidYMid meet\"\n height=".concat(size, " width=").concat(size, " title=\"Metadata Substitution\"\n style=\"bottom:5px; right:10px; position: absolute;\"\n fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"").concat(color, "\"\n transform=\"matrix(1, 0, 0, 1, 0, 0)rotate(0)\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"\n stroke=\"").concat(color, "\" stroke-width=\"0.528\"></g>\n <g><path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284\n 4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5\n 10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761\n 11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5\n 8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5\n 6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386\n 4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614\n 10.5 8.5 10.2761 8.5 10V7Z\" fill=\"").concat(color, "\"></path>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5\n 6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5\n 16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284\n 18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5\n 19 12.5H16C15.1716 12.5 14.5 13.1716 14.5\n 14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16\n 17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5\n 13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5\n 13.7239 15.5 14V17Z\" fill=\"").concat(color, "\"></path> </g></svg></div>"));
|
|
41181
|
+
}
|
|
41182
|
+
|
|
41183
|
+
var requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
41184
|
+
var requiredSyntax = '{required/}';
|
|
41185
|
+
var RequiredQuestions = {
|
|
41223
41186
|
name: 'RequiredQuestions',
|
|
41224
|
-
script(step, guide, pendo) {
|
|
41187
|
+
script: function (step, guide, pendo) {
|
|
41225
41188
|
var _a;
|
|
41226
|
-
|
|
41227
|
-
|
|
41228
|
-
|
|
41189
|
+
var requiredPollIds = [];
|
|
41190
|
+
var submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(function (button) {
|
|
41191
|
+
return button.actions.find(function (action) { return action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'; });
|
|
41192
|
+
});
|
|
41193
|
+
var requiredQuestions = processRequiredQuestions();
|
|
41229
41194
|
if (requiredQuestions) {
|
|
41230
|
-
pendo._.forEach(requiredQuestions, (question)
|
|
41195
|
+
pendo._.forEach(requiredQuestions, function (question) {
|
|
41231
41196
|
if (question.classList.contains('_pendo-open-text-poll-question')) {
|
|
41232
|
-
|
|
41233
|
-
step.attachEvent(step.guideElement.find(
|
|
41197
|
+
var pollId = question.dataset.pendoPollId;
|
|
41198
|
+
step.attachEvent(step.guideElement.find("[data-pendo-poll-id=".concat(pollId, "]._pendo-open-text-poll-input"))[0], 'input', function () {
|
|
41234
41199
|
evaluateRequiredQuestions(requiredQuestions);
|
|
41235
41200
|
});
|
|
41236
41201
|
}
|
|
@@ -41242,8 +41207,8 @@ const RequiredQuestions = {
|
|
|
41242
41207
|
});
|
|
41243
41208
|
}
|
|
41244
41209
|
function getEligibleQuestions() {
|
|
41245
|
-
|
|
41246
|
-
return pendo._.reduce(allQuestions, (eligibleQuestions, question)
|
|
41210
|
+
var allQuestions = step.guideElement.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
|
|
41211
|
+
return pendo._.reduce(allQuestions, function (eligibleQuestions, question) {
|
|
41247
41212
|
if (question.classList.contains('_pendo-yes-no-poll-question'))
|
|
41248
41213
|
return eligibleQuestions;
|
|
41249
41214
|
eligibleQuestions.push(question);
|
|
@@ -41251,27 +41216,19 @@ const RequiredQuestions = {
|
|
|
41251
41216
|
}, []);
|
|
41252
41217
|
}
|
|
41253
41218
|
function processRequiredQuestions() {
|
|
41254
|
-
|
|
41219
|
+
var questions = getEligibleQuestions();
|
|
41255
41220
|
if (questions) {
|
|
41256
|
-
pendo._.forEach(questions, question
|
|
41257
|
-
|
|
41221
|
+
pendo._.forEach(questions, function (question) {
|
|
41222
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
41258
41223
|
requiredPollIds.push(dataPendoPollId);
|
|
41259
|
-
pendo._.each(step.guideElement.find(
|
|
41224
|
+
pendo._.each(step.guideElement.find("#".concat(question.id, " *, #").concat(question.id)), function (element) {
|
|
41260
41225
|
guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
|
|
41261
41226
|
});
|
|
41262
|
-
step.guideElement.find(
|
|
41227
|
+
step.guideElement.find("#".concat(question.id, " p")).append(requiredElement);
|
|
41263
41228
|
});
|
|
41264
41229
|
}
|
|
41265
41230
|
if (pendo._.size(requiredPollIds)) {
|
|
41266
|
-
|
|
41267
|
-
id=_pendo-guide-required-disabled>
|
|
41268
|
-
._pendo-button:disabled, ._pendo-buttons[disabled] {
|
|
41269
|
-
border: 1px solid #999999 !important;
|
|
41270
|
-
background-color: #cccccc !important;
|
|
41271
|
-
color: #666666 !important;
|
|
41272
|
-
pointer-events: none !important;
|
|
41273
|
-
}
|
|
41274
|
-
</style>`;
|
|
41231
|
+
var disabledButtonStyles = "<style type=text/css\n id=_pendo-guide-required-disabled>\n ._pendo-button:disabled, ._pendo-buttons[disabled] {\n border: 1px solid #999999 !important;\n background-color: #cccccc !important;\n color: #666666 !important;\n pointer-events: none !important;\n }\n </style>";
|
|
41275
41232
|
if (pendo.dom('#_pendo-guide-required-disabled').length === 0) {
|
|
41276
41233
|
pendo.dom('head').append(disabledButtonStyles);
|
|
41277
41234
|
}
|
|
@@ -41282,15 +41239,11 @@ const RequiredQuestions = {
|
|
|
41282
41239
|
function evaluateRequiredQuestions(questions) {
|
|
41283
41240
|
if (questions.length === 0)
|
|
41284
41241
|
return;
|
|
41285
|
-
|
|
41286
|
-
|
|
41287
|
-
responses = responses.concat(pendo._.map(questions, (question)
|
|
41288
|
-
|
|
41289
|
-
|
|
41290
|
-
[data-pendo-poll-id=${pollId}] textarea,
|
|
41291
|
-
[data-pendo-poll-id=${pollId}] input:text,
|
|
41292
|
-
[data-pendo-poll-id=${pollId}] select,
|
|
41293
|
-
[data-pendo-poll-id=${pollId}] input:radio:checked`);
|
|
41242
|
+
var allRequiredComplete = true;
|
|
41243
|
+
var responses = [];
|
|
41244
|
+
responses = responses.concat(pendo._.map(questions, function (question) {
|
|
41245
|
+
var pollId = question.getAttribute('data-pendo-poll-id');
|
|
41246
|
+
var input = step.guideElement.find("\n [data-pendo-poll-id=".concat(pollId, "] textarea,\n [data-pendo-poll-id=").concat(pollId, "] input:text,\n [data-pendo-poll-id=").concat(pollId, "] select,\n [data-pendo-poll-id=").concat(pollId, "] input:radio:checked"));
|
|
41294
41247
|
if (input && input.length && input[0].value) {
|
|
41295
41248
|
return input[0].value;
|
|
41296
41249
|
}
|
|
@@ -41307,48 +41260,48 @@ const RequiredQuestions = {
|
|
|
41307
41260
|
}
|
|
41308
41261
|
function disableEligibleButtons(buttons) {
|
|
41309
41262
|
pendo._.each(buttons, function (button) {
|
|
41310
|
-
if (step.guideElement.find(
|
|
41311
|
-
step.guideElement.find(
|
|
41312
|
-
step.guideElement.find(
|
|
41263
|
+
if (step.guideElement.find("#".concat(button.props.id))[0]) {
|
|
41264
|
+
step.guideElement.find("#".concat(button.props.id))[0].disabled = true;
|
|
41265
|
+
step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = 'Please complete all required questions.';
|
|
41313
41266
|
}
|
|
41314
41267
|
});
|
|
41315
41268
|
}
|
|
41316
41269
|
function enableEligibleButtons(buttons) {
|
|
41317
41270
|
pendo._.each(buttons, function (button) {
|
|
41318
|
-
if (step.guideElement.find(
|
|
41319
|
-
step.guideElement.find(
|
|
41320
|
-
step.guideElement.find(
|
|
41271
|
+
if (step.guideElement.find("#".concat(button.props.id))[0]) {
|
|
41272
|
+
step.guideElement.find("#".concat(button.props.id))[0].disabled = false;
|
|
41273
|
+
step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = '';
|
|
41321
41274
|
}
|
|
41322
41275
|
});
|
|
41323
41276
|
}
|
|
41324
41277
|
},
|
|
41325
|
-
test(step, guide, pendo) {
|
|
41278
|
+
test: function (step, guide, pendo) {
|
|
41326
41279
|
var _a;
|
|
41327
|
-
|
|
41280
|
+
var requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
|
|
41328
41281
|
return !pendo._.isUndefined(requiredQuestions) && pendo._.size(requiredQuestions);
|
|
41329
41282
|
},
|
|
41330
|
-
designerListener(pendo) {
|
|
41331
|
-
|
|
41332
|
-
|
|
41333
|
-
|
|
41283
|
+
designerListener: function (pendo) {
|
|
41284
|
+
var requiredQuestions = [];
|
|
41285
|
+
var target = pendo.dom.getBody();
|
|
41286
|
+
var config = {
|
|
41334
41287
|
attributeFilter: ['data-layout'],
|
|
41335
41288
|
attributes: true,
|
|
41336
41289
|
childList: true,
|
|
41337
41290
|
characterData: true,
|
|
41338
41291
|
subtree: true
|
|
41339
41292
|
};
|
|
41340
|
-
|
|
41341
|
-
|
|
41293
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41294
|
+
var observer = new MutationObserver(applyRequiredIndicators);
|
|
41342
41295
|
observer.observe(target, config);
|
|
41343
41296
|
function applyRequiredIndicators(mutations) {
|
|
41344
41297
|
pendo._.each(mutations, function (mutation) {
|
|
41345
41298
|
var _a;
|
|
41346
|
-
|
|
41299
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
41347
41300
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
41348
|
-
|
|
41301
|
+
var eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
|
|
41349
41302
|
if (eligiblePolls) {
|
|
41350
41303
|
pendo._.each(eligiblePolls, function (poll) {
|
|
41351
|
-
|
|
41304
|
+
var dataPendoPollId;
|
|
41352
41305
|
if (poll.classList.contains('_pendo-open-text-poll-wrapper') ||
|
|
41353
41306
|
poll.classList.contains('_pendo-number-scale-poll-wrapper')) {
|
|
41354
41307
|
dataPendoPollId = poll.getAttribute('name');
|
|
@@ -41356,27 +41309,27 @@ const RequiredQuestions = {
|
|
|
41356
41309
|
else {
|
|
41357
41310
|
dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
|
|
41358
41311
|
}
|
|
41359
|
-
|
|
41360
|
-
|
|
41312
|
+
var questionText;
|
|
41313
|
+
var pollQuesiton = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0];
|
|
41361
41314
|
if (pollQuesiton) {
|
|
41362
|
-
questionText = pendo.dom(
|
|
41315
|
+
questionText = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0].textContent;
|
|
41363
41316
|
}
|
|
41364
|
-
|
|
41317
|
+
var requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
|
|
41365
41318
|
if (requiredSyntaxIndex > -1) {
|
|
41366
|
-
pendo._.each(pendo.dom(
|
|
41367
|
-
pendo._.each(pendo.dom(
|
|
41319
|
+
pendo._.each(pendo.dom("[data-pendo-poll-id=".concat(dataPendoPollId, "]:not(.pendo-radio)")), function (element) {
|
|
41320
|
+
pendo._.each(pendo.dom("#".concat(element.id, " *:not(\".pendo-radio\"), #").concat(element.id, ":not(\".pendo-radio\")")), function (item) {
|
|
41368
41321
|
guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
|
|
41369
41322
|
});
|
|
41370
41323
|
});
|
|
41371
|
-
if (pendo.dom(
|
|
41372
|
-
pendo.dom(
|
|
41373
|
-
pendo.dom(
|
|
41324
|
+
if (pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).length !== 0 || pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).length !== 0) {
|
|
41325
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).append(requiredElement);
|
|
41326
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).append(requiredElement);
|
|
41374
41327
|
}
|
|
41375
41328
|
else {
|
|
41376
|
-
pendo.dom(
|
|
41329
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "]")).append(requiredElement);
|
|
41377
41330
|
}
|
|
41378
41331
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
41379
|
-
|
|
41332
|
+
var questionIndex = requiredQuestions.indexOf(dataPendoPollId);
|
|
41380
41333
|
if (questionIndex !== -1) {
|
|
41381
41334
|
requiredQuestions.splice(questionIndex, 1);
|
|
41382
41335
|
}
|
|
@@ -41387,7 +41340,7 @@ const RequiredQuestions = {
|
|
|
41387
41340
|
}
|
|
41388
41341
|
else {
|
|
41389
41342
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
41390
|
-
|
|
41343
|
+
var index = requiredQuestions.indexOf(dataPendoPollId);
|
|
41391
41344
|
if (index !== -1) {
|
|
41392
41345
|
requiredQuestions.splice(index, 1);
|
|
41393
41346
|
}
|
|
@@ -41401,54 +41354,54 @@ const RequiredQuestions = {
|
|
|
41401
41354
|
}
|
|
41402
41355
|
};
|
|
41403
41356
|
|
|
41404
|
-
|
|
41405
|
-
|
|
41406
|
-
script(step, guide, pendo) {
|
|
41407
|
-
|
|
41408
|
-
|
|
41409
|
-
|
|
41410
|
-
|
|
41411
|
-
|
|
41357
|
+
var skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
|
|
41358
|
+
var SkipToEligibleStep = {
|
|
41359
|
+
script: function (step, guide, pendo) {
|
|
41360
|
+
var isAdvanceIntercepted = false;
|
|
41361
|
+
var isPreviousIntercepted = false;
|
|
41362
|
+
var guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
|
|
41363
|
+
var guideContainerAriaLabel = guideContainer.attr('aria-label');
|
|
41364
|
+
var stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
|
|
41412
41365
|
if (guideContainer) {
|
|
41413
41366
|
guideContainer.attr({ 'aria-label': guideContainer.attr('aria-label').replace(skipStepRegex, '') });
|
|
41414
41367
|
}
|
|
41415
|
-
this.on('beforeAdvance', (evt)
|
|
41368
|
+
this.on('beforeAdvance', function (evt) {
|
|
41416
41369
|
if (guide.getPositionOfStep(step) === guide.steps.length || pendo._.isUndefined(stepNumberOrAuto))
|
|
41417
41370
|
return; // exit on the last step of a guide or when we don't have an argument
|
|
41418
|
-
|
|
41371
|
+
var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
|
|
41419
41372
|
if (!isAdvanceIntercepted && stepNumberOrAuto) {
|
|
41420
41373
|
isAdvanceIntercepted = true;
|
|
41421
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
41374
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
|
|
41422
41375
|
evt.cancel = true;
|
|
41423
41376
|
}
|
|
41424
41377
|
});
|
|
41425
|
-
this.on('beforePrevious', (evt)
|
|
41378
|
+
this.on('beforePrevious', function (evt) {
|
|
41426
41379
|
if (pendo._.isUndefined(stepNumberOrAuto))
|
|
41427
41380
|
return;
|
|
41428
|
-
|
|
41381
|
+
var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
|
|
41429
41382
|
if (!isPreviousIntercepted && stepNumberOrAuto) {
|
|
41430
41383
|
isPreviousIntercepted = true;
|
|
41431
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
41384
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
|
|
41432
41385
|
evt.cancel = true;
|
|
41433
41386
|
}
|
|
41434
41387
|
});
|
|
41435
41388
|
function findEligibleSkipStep(stepNumber, direction) {
|
|
41436
41389
|
// Find the next eligible step by using getPosition of step (1 based)
|
|
41437
41390
|
// getPosition - 2 gives the previous step
|
|
41438
|
-
|
|
41439
|
-
|
|
41391
|
+
var skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
|
|
41392
|
+
var skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
|
|
41440
41393
|
if (skipForwardStep && direction == 'next') {
|
|
41441
|
-
pendo.goToStep({ destinationStepId: skipForwardStep, step });
|
|
41394
|
+
pendo.goToStep({ destinationStepId: skipForwardStep, step: step });
|
|
41442
41395
|
}
|
|
41443
41396
|
if (skipPreviousStep && direction == 'previous') {
|
|
41444
|
-
pendo.goToStep({ destinationStepId: skipPreviousStep, step });
|
|
41397
|
+
pendo.goToStep({ destinationStepId: skipPreviousStep, step: step });
|
|
41445
41398
|
}
|
|
41446
41399
|
return direction === 'next' ? skipForwardStep : skipPreviousStep;
|
|
41447
41400
|
}
|
|
41448
41401
|
function findStepOnPage(stepIndex, direction, stepNumber) {
|
|
41449
41402
|
if (pendo._.isNaN(stepIndex))
|
|
41450
41403
|
return;
|
|
41451
|
-
|
|
41404
|
+
var $step = guide.steps[stepIndex];
|
|
41452
41405
|
if ($step && !$step.canShow()) {
|
|
41453
41406
|
if (stepNumber !== 'auto') {
|
|
41454
41407
|
return guide.steps[stepNumber - 1];
|
|
@@ -41465,34 +41418,34 @@ const SkipToEligibleStep = {
|
|
|
41465
41418
|
}
|
|
41466
41419
|
}
|
|
41467
41420
|
},
|
|
41468
|
-
test(step, guide, pendo) {
|
|
41421
|
+
test: function (step, guide, pendo) {
|
|
41469
41422
|
var _a;
|
|
41470
|
-
|
|
41423
|
+
var guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
|
|
41471
41424
|
return pendo._.isString(guideContainerAriaLabel) && guideContainerAriaLabel.indexOf('{skipStep') !== -1;
|
|
41472
41425
|
},
|
|
41473
|
-
designerListener(pendo) {
|
|
41474
|
-
|
|
41475
|
-
|
|
41426
|
+
designerListener: function (pendo) {
|
|
41427
|
+
var target = pendo.dom.getBody();
|
|
41428
|
+
var config = {
|
|
41476
41429
|
attributeFilter: ['data-layout'],
|
|
41477
41430
|
attributes: true,
|
|
41478
41431
|
childList: true,
|
|
41479
41432
|
characterData: true,
|
|
41480
41433
|
subtree: true
|
|
41481
41434
|
};
|
|
41482
|
-
|
|
41483
|
-
|
|
41435
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41436
|
+
var observer = new MutationObserver(applySkipStepIndicator);
|
|
41484
41437
|
observer.observe(target, config);
|
|
41485
41438
|
// create an observer instance
|
|
41486
41439
|
function applySkipStepIndicator(mutations) {
|
|
41487
41440
|
pendo._.each(mutations, function (mutation) {
|
|
41488
41441
|
var _a, _b;
|
|
41489
|
-
|
|
41442
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
41490
41443
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
41491
|
-
|
|
41492
|
-
|
|
41444
|
+
var guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
|
|
41445
|
+
var guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
|
|
41493
41446
|
if (guideContainerAriaLabel) {
|
|
41494
41447
|
if (guideContainerAriaLabel.match(skipStepRegex)) {
|
|
41495
|
-
|
|
41448
|
+
var fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
|
|
41496
41449
|
guideContainerAriaLabel.replace(fullSkipStepString, '');
|
|
41497
41450
|
if (!pendo.dom('#_pendoSkipIcon').length) {
|
|
41498
41451
|
pendo.dom(guideMarkdownUtil.containerSelector).append(skipIcon('#999', '30px').trim());
|
|
@@ -41503,48 +41456,30 @@ const SkipToEligibleStep = {
|
|
|
41503
41456
|
});
|
|
41504
41457
|
}
|
|
41505
41458
|
function skipIcon(color, size) {
|
|
41506
|
-
return (
|
|
41507
|
-
width="${size}" height="${size}" viewBox="0 0 512.000000 512.000000"
|
|
41508
|
-
preserveAspectRatio="xMidYMid meet" style="bottom:5px; right:10px; position: absolute;">
|
|
41509
|
-
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
|
41510
|
-
fill="${color}" stroke="none">
|
|
41511
|
-
<path d="M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357
|
|
41512
|
-
-343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0
|
|
41513
|
-
160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137
|
|
41514
|
-
2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236
|
|
41515
|
-
235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767
|
|
41516
|
-
-1869 1868 -117 12 -298 12 -416 0z"/>
|
|
41517
|
-
<path d="M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41518
|
-
<path d="M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41519
|
-
<path d="M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41520
|
-
<path d="M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41521
|
-
<path d="M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41522
|
-
<path d="M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z"/>
|
|
41523
|
-
</g></svg></div>
|
|
41524
|
-
`);
|
|
41459
|
+
return ("<div title=\"Skip step added\"><svg id=\"_pendoSkipIcon\" version=\"1.0\" xmlns=\"http://www.w3.org/2000/svg\"\n width=\"".concat(size, "\" height=\"").concat(size, "\" viewBox=\"0 0 512.000000 512.000000\"\n preserveAspectRatio=\"xMidYMid meet\" style=\"bottom:5px; right:10px; position: absolute;\">\n <g transform=\"translate(0.000000,512.000000) scale(0.100000,-0.100000)\"\n fill=\"").concat(color, "\" stroke=\"none\">\n <path d=\"M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357\n -343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0\n 160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137\n 2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236\n 235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767\n -1869 1868 -117 12 -298 12 -416 0z\"/>\n <path d=\"M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z\"/>\n </g></svg></div>\n "));
|
|
41525
41460
|
}
|
|
41526
41461
|
}
|
|
41527
41462
|
};
|
|
41528
41463
|
|
|
41529
41464
|
function GuideMarkdown() {
|
|
41530
|
-
|
|
41531
|
-
|
|
41532
|
-
|
|
41465
|
+
var guideMarkdown;
|
|
41466
|
+
var pluginApi;
|
|
41467
|
+
var globalPendo;
|
|
41533
41468
|
return {
|
|
41534
41469
|
name: 'GuideMarkdown',
|
|
41535
41470
|
initialize: init,
|
|
41536
|
-
teardown
|
|
41471
|
+
teardown: teardown
|
|
41537
41472
|
};
|
|
41538
41473
|
function init(pendo, PluginAPI) {
|
|
41539
41474
|
globalPendo = pendo;
|
|
41540
41475
|
pluginApi = PluginAPI;
|
|
41541
|
-
|
|
41542
|
-
|
|
41476
|
+
var configReader = PluginAPI.ConfigReader;
|
|
41477
|
+
var GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
|
|
41543
41478
|
configReader.addOption(GUIDEMARKDOWN_CONFIG, [
|
|
41544
41479
|
configReader.sources.SNIPPET_SRC,
|
|
41545
41480
|
configReader.sources.PENDO_CONFIG_SRC
|
|
41546
41481
|
], false);
|
|
41547
|
-
|
|
41482
|
+
var markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
|
|
41548
41483
|
if (!markdownScriptsEnabled)
|
|
41549
41484
|
return;
|
|
41550
41485
|
guideMarkdown = [PollBranching, MetadataSubstitution, RequiredQuestions, SkipToEligibleStep];
|
|
@@ -42543,11 +42478,24 @@ function VocPortal() {
|
|
|
42543
42478
|
}
|
|
42544
42479
|
}`, container);
|
|
42545
42480
|
resizePortalIframe();
|
|
42481
|
+
clampContainerToViewport(container);
|
|
42546
42482
|
}
|
|
42547
42483
|
catch (err) {
|
|
42548
42484
|
pluginAPI.log.error('Error while adjusting RC module', err);
|
|
42549
42485
|
}
|
|
42550
42486
|
}
|
|
42487
|
+
function clampContainerToViewport(container) {
|
|
42488
|
+
if (!container)
|
|
42489
|
+
return;
|
|
42490
|
+
const leftPadding = 10;
|
|
42491
|
+
const rect = container.getBoundingClientRect();
|
|
42492
|
+
if (rect.left < leftPadding) {
|
|
42493
|
+
container.style.transform = `translateX(${leftPadding - rect.left}px)`;
|
|
42494
|
+
}
|
|
42495
|
+
else {
|
|
42496
|
+
container.style.transform = '';
|
|
42497
|
+
}
|
|
42498
|
+
}
|
|
42551
42499
|
function teardown() {
|
|
42552
42500
|
if (this.removeResizeEvent)
|
|
42553
42501
|
this.removeResizeEvent();
|
|
@@ -42570,8 +42518,8 @@ function Feedback() {
|
|
|
42570
42518
|
var widgetLoaded = false;
|
|
42571
42519
|
var feedbackAllowedProductId = '';
|
|
42572
42520
|
var initialized = false;
|
|
42573
|
-
|
|
42574
|
-
|
|
42521
|
+
var PING_COOKIE = 'feedback_ping_sent';
|
|
42522
|
+
var PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
|
|
42575
42523
|
var overflowMediaQuery = '@media only screen and (max-device-width:1112px){#feedback-widget{overflow-y:scroll}}';
|
|
42576
42524
|
var slideIn = '@-webkit-keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}@keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}';
|
|
42577
42525
|
var slideInLeft = '@-webkit-keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}@keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}';
|
|
@@ -42591,28 +42539,28 @@ function Feedback() {
|
|
|
42591
42539
|
feedbackStyles: 'pendo-feedback-styles',
|
|
42592
42540
|
feedbackFrameStyles: 'pendo-feedback-visible-buttons-styles'
|
|
42593
42541
|
};
|
|
42594
|
-
|
|
42595
|
-
|
|
42542
|
+
var globalPendo;
|
|
42543
|
+
var pluginApi;
|
|
42596
42544
|
return {
|
|
42597
42545
|
name: 'Feedback',
|
|
42598
|
-
initialize,
|
|
42599
|
-
teardown,
|
|
42600
|
-
validate
|
|
42546
|
+
initialize: initialize,
|
|
42547
|
+
teardown: teardown,
|
|
42548
|
+
validate: validate
|
|
42601
42549
|
};
|
|
42602
42550
|
function initialize(pendo, PluginAPI) {
|
|
42603
42551
|
globalPendo = pendo;
|
|
42604
42552
|
pluginApi = PluginAPI;
|
|
42605
42553
|
var publicFeedback = {
|
|
42606
|
-
ping,
|
|
42607
|
-
init,
|
|
42554
|
+
ping: ping,
|
|
42555
|
+
init: init,
|
|
42608
42556
|
initialized: getInitialized,
|
|
42609
|
-
loginAndRedirect,
|
|
42610
|
-
openFeedback,
|
|
42611
|
-
initializeFeedbackOnce,
|
|
42612
|
-
isFeedbackLoaded,
|
|
42613
|
-
convertPendoToFeedbackOptions,
|
|
42557
|
+
loginAndRedirect: loginAndRedirect,
|
|
42558
|
+
openFeedback: openFeedback,
|
|
42559
|
+
initializeFeedbackOnce: initializeFeedbackOnce,
|
|
42560
|
+
isFeedbackLoaded: isFeedbackLoaded,
|
|
42561
|
+
convertPendoToFeedbackOptions: convertPendoToFeedbackOptions,
|
|
42614
42562
|
isUnsupportedIE: pendo._.partial(isUnsupportedIE, PluginAPI),
|
|
42615
|
-
removeFeedbackWidget
|
|
42563
|
+
removeFeedbackWidget: removeFeedbackWidget
|
|
42616
42564
|
};
|
|
42617
42565
|
pendo.feedback = publicFeedback;
|
|
42618
42566
|
pendo.getFeedbackSettings = getFeedbackSettings;
|
|
@@ -42640,7 +42588,7 @@ function Feedback() {
|
|
|
42640
42588
|
*/
|
|
42641
42589
|
PluginAPI.agentStorage.registry.addLocal(PING_COOKIE, { duration: PING_COOKIE_EXPIRATION });
|
|
42642
42590
|
return {
|
|
42643
|
-
validate
|
|
42591
|
+
validate: validate
|
|
42644
42592
|
};
|
|
42645
42593
|
}
|
|
42646
42594
|
function teardown() {
|
|
@@ -42660,18 +42608,18 @@ function Feedback() {
|
|
|
42660
42608
|
return result;
|
|
42661
42609
|
}
|
|
42662
42610
|
function pingOrInitialize() {
|
|
42663
|
-
|
|
42611
|
+
var options = getPendoOptions();
|
|
42664
42612
|
if (initialized) {
|
|
42665
|
-
|
|
42613
|
+
var feedbackOptions = convertPendoToFeedbackOptions(options);
|
|
42666
42614
|
ping(feedbackOptions);
|
|
42667
42615
|
}
|
|
42668
42616
|
else if (shouldInitializeFeedback() && !globalPendo._.isEmpty(options)) {
|
|
42669
|
-
|
|
42670
|
-
init(options, settings)
|
|
42617
|
+
var settings = pluginApi.ConfigReader.get('feedbackSettings');
|
|
42618
|
+
init(options, settings)["catch"](globalPendo._.noop);
|
|
42671
42619
|
}
|
|
42672
42620
|
}
|
|
42673
42621
|
function handleIdentityChange(event) {
|
|
42674
|
-
|
|
42622
|
+
var visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
|
|
42675
42623
|
if (globalPendo.isAnonymousVisitor(visitorId)) {
|
|
42676
42624
|
removeFeedbackWidget();
|
|
42677
42625
|
return;
|
|
@@ -42741,9 +42689,9 @@ function Feedback() {
|
|
|
42741
42689
|
if (toSend.data && toSend.data !== '{}' && toSend.data !== 'null') {
|
|
42742
42690
|
return globalPendo.ajax
|
|
42743
42691
|
.postJSON(getFullUrl('/widget/pendo_ping'), toSend)
|
|
42744
|
-
.then((response)
|
|
42692
|
+
.then(function (response) {
|
|
42745
42693
|
onWidgetPingResponse(response);
|
|
42746
|
-
})
|
|
42694
|
+
})["catch"](function () { onPingFailure(); });
|
|
42747
42695
|
}
|
|
42748
42696
|
}
|
|
42749
42697
|
return pluginApi.q.resolve();
|
|
@@ -42877,10 +42825,10 @@ function Feedback() {
|
|
|
42877
42825
|
return globalPendo.ajax.postJSON(getFullUrl('/analytics'), toSend);
|
|
42878
42826
|
}
|
|
42879
42827
|
function addOverlay() {
|
|
42880
|
-
|
|
42828
|
+
var widget = globalPendo.dom("#".concat(elemIds.feedbackWidget));
|
|
42881
42829
|
if (!widget)
|
|
42882
42830
|
return;
|
|
42883
|
-
|
|
42831
|
+
var overlayStyles = {
|
|
42884
42832
|
'position': 'fixed',
|
|
42885
42833
|
'top': '0',
|
|
42886
42834
|
'right': '0',
|
|
@@ -42892,7 +42840,7 @@ function Feedback() {
|
|
|
42892
42840
|
'animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both',
|
|
42893
42841
|
'-webkit-animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both'
|
|
42894
42842
|
};
|
|
42895
|
-
|
|
42843
|
+
var overlayElement = globalPendo.dom(document.createElement('div'));
|
|
42896
42844
|
overlayElement.attr('id', 'feedback-overlay');
|
|
42897
42845
|
overlayElement.css(overlayStyles);
|
|
42898
42846
|
overlayElement.appendTo(widget.getParent());
|
|
@@ -42997,22 +42945,22 @@ function Feedback() {
|
|
|
42997
42945
|
}
|
|
42998
42946
|
}
|
|
42999
42947
|
function buildOuterTriggerDiv(positionInfo) {
|
|
43000
|
-
|
|
43001
|
-
|
|
43002
|
-
|
|
42948
|
+
var horizontalStyles = getHorizontalPositionStyles(positionInfo);
|
|
42949
|
+
var verticalStyles = getVerticalPositionStyles(positionInfo);
|
|
42950
|
+
var styles = globalPendo._.extend({
|
|
43003
42951
|
'position': 'fixed',
|
|
43004
42952
|
'height': '43px',
|
|
43005
42953
|
'opacity': '1 !important',
|
|
43006
42954
|
'z-index': '9001'
|
|
43007
42955
|
}, horizontalStyles, verticalStyles);
|
|
43008
|
-
|
|
42956
|
+
var outerTrigger = globalPendo.dom(document.createElement('div'));
|
|
43009
42957
|
outerTrigger.attr('id', elemIds.feedbackTrigger);
|
|
43010
42958
|
outerTrigger.css(styles);
|
|
43011
42959
|
outerTrigger.attr('data-turbolinks-permanent', '');
|
|
43012
42960
|
return outerTrigger;
|
|
43013
42961
|
}
|
|
43014
42962
|
function buildNotification() {
|
|
43015
|
-
|
|
42963
|
+
var styles = {
|
|
43016
42964
|
'background-color': '#D85039',
|
|
43017
42965
|
'color': '#fff',
|
|
43018
42966
|
'border-radius': '50%',
|
|
@@ -43029,20 +42977,20 @@ function Feedback() {
|
|
|
43029
42977
|
'animation-delay': '1s',
|
|
43030
42978
|
'animation-iteration-count': '1'
|
|
43031
42979
|
};
|
|
43032
|
-
|
|
42980
|
+
var notification = globalPendo.dom(document.createElement('span'));
|
|
43033
42981
|
notification.attr('id', 'feedback-trigger-notification');
|
|
43034
42982
|
notification.css(styles);
|
|
43035
42983
|
return notification;
|
|
43036
42984
|
}
|
|
43037
42985
|
function buildTriggerButton(settings, positionInfo) {
|
|
43038
|
-
|
|
42986
|
+
var borderRadius;
|
|
43039
42987
|
if (positionInfo.horizontalPosition === 'left') {
|
|
43040
42988
|
borderRadius = '0 0 5px 5px';
|
|
43041
42989
|
}
|
|
43042
42990
|
else {
|
|
43043
42991
|
borderRadius = '3px 3px 0 0';
|
|
43044
42992
|
}
|
|
43045
|
-
|
|
42993
|
+
var styles = {
|
|
43046
42994
|
'border': 'none',
|
|
43047
42995
|
'padding': '11px 18px 14px 18px',
|
|
43048
42996
|
'background-color': settings.triggerColor,
|
|
@@ -43053,32 +43001,21 @@ function Feedback() {
|
|
|
43053
43001
|
'cursor': 'pointer',
|
|
43054
43002
|
'text-align': 'left'
|
|
43055
43003
|
};
|
|
43056
|
-
|
|
43004
|
+
var triggerButton = globalPendo.dom(document.createElement('button'));
|
|
43057
43005
|
triggerButton.attr('id', elemIds.feedbackTriggerButton);
|
|
43058
43006
|
triggerButton.css(styles);
|
|
43059
43007
|
triggerButton.text(settings.triggerText);
|
|
43060
43008
|
return triggerButton;
|
|
43061
43009
|
}
|
|
43062
43010
|
function addTriggerPseudoStyles() {
|
|
43063
|
-
|
|
43064
|
-
#feedback-trigger button:hover {
|
|
43065
|
-
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43066
|
-
outline: none !important;
|
|
43067
|
-
background: #3e566f !important;
|
|
43068
|
-
}
|
|
43069
|
-
#feedback-trigger button:focus {
|
|
43070
|
-
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43071
|
-
outline: none !important;
|
|
43072
|
-
background: #3e566f !important;
|
|
43073
|
-
}
|
|
43074
|
-
`;
|
|
43011
|
+
var pseudoStyles = "\n #feedback-trigger button:hover {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n #feedback-trigger button:focus {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n ";
|
|
43075
43012
|
pluginApi.util.addInlineStyles('pendo-feedback-trigger-styles', pseudoStyles);
|
|
43076
43013
|
}
|
|
43077
43014
|
function createTrigger(settings, positionInfo) {
|
|
43078
43015
|
addTriggerPseudoStyles();
|
|
43079
|
-
|
|
43080
|
-
|
|
43081
|
-
|
|
43016
|
+
var triggerElement = buildOuterTriggerDiv(positionInfo);
|
|
43017
|
+
var notificationElement = buildNotification();
|
|
43018
|
+
var triggerButtonElement = buildTriggerButton(settings, positionInfo);
|
|
43082
43019
|
triggerElement.append(notificationElement);
|
|
43083
43020
|
triggerElement.append(triggerButtonElement);
|
|
43084
43021
|
triggerElement.appendTo(globalPendo.dom.getBody());
|
|
@@ -43102,7 +43039,7 @@ function Feedback() {
|
|
|
43102
43039
|
iframeWrapper.css(getWidgetOriginalStyles());
|
|
43103
43040
|
iframeWrapper.attr('id', elemIds.feedbackWidget);
|
|
43104
43041
|
iframeWrapper.attr('data-turbolinks-permanent', 'true');
|
|
43105
|
-
iframeWrapper.addClass(
|
|
43042
|
+
iframeWrapper.addClass("buttonIs-".concat(horizontalPosition));
|
|
43106
43043
|
return iframeWrapper;
|
|
43107
43044
|
}
|
|
43108
43045
|
function buildIframeContainer() {
|
|
@@ -43119,22 +43056,13 @@ function Feedback() {
|
|
|
43119
43056
|
return iframeContainer;
|
|
43120
43057
|
}
|
|
43121
43058
|
function addWidgetVisibleButtonStyles(buttonStylePosition) {
|
|
43122
|
-
|
|
43123
|
-
|
|
43124
|
-
.buttonIs-${side}.visible {
|
|
43125
|
-
${side}: 0 !important;
|
|
43126
|
-
width: 470px !important;
|
|
43127
|
-
animation-direction: alternate-reverse !important;
|
|
43128
|
-
animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
43129
|
-
-webkit-animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
43130
|
-
z-index: 9002 !important;
|
|
43131
|
-
}
|
|
43132
|
-
`;
|
|
43059
|
+
var side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
|
|
43060
|
+
var styles = "\n .buttonIs-".concat(side, ".visible {\n ").concat(side, ": 0 !important;\n width: 470px !important;\n animation-direction: alternate-reverse !important;\n animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n -webkit-animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n z-index: 9002 !important;\n }\n ");
|
|
43133
43061
|
pluginApi.util.addInlineStyles(elemIds.feedbackFrameStyles, styles);
|
|
43134
43062
|
}
|
|
43135
43063
|
function initialiseWidgetFrame(horizontalPosition) {
|
|
43136
43064
|
addWidgetVisibleButtonStyles(horizontalPosition);
|
|
43137
|
-
|
|
43065
|
+
var iframeElement = buildIframeWrapper(horizontalPosition);
|
|
43138
43066
|
iframeElement.append(buildIframeContainer());
|
|
43139
43067
|
iframeElement.appendTo(globalPendo.dom.getBody());
|
|
43140
43068
|
subscribeToIframeMessages();
|
|
@@ -43158,7 +43086,7 @@ function Feedback() {
|
|
|
43158
43086
|
return widgetLoaded;
|
|
43159
43087
|
}
|
|
43160
43088
|
function getPendoOptions() {
|
|
43161
|
-
|
|
43089
|
+
var options = pluginApi.ConfigReader.getLocalConfig();
|
|
43162
43090
|
if (!globalPendo._.isObject(options))
|
|
43163
43091
|
options = {};
|
|
43164
43092
|
if (!globalPendo._.isObject(options.visitor))
|
|
@@ -43186,7 +43114,7 @@ function Feedback() {
|
|
|
43186
43114
|
return true;
|
|
43187
43115
|
}
|
|
43188
43116
|
function getQueryParam(url, paramName) {
|
|
43189
|
-
|
|
43117
|
+
var results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
|
|
43190
43118
|
if (results == null) {
|
|
43191
43119
|
return null;
|
|
43192
43120
|
}
|
|
@@ -43203,13 +43131,13 @@ function Feedback() {
|
|
|
43203
43131
|
return pluginApi.q.reject();
|
|
43204
43132
|
if (!canInitFeedback(pendoOptions))
|
|
43205
43133
|
return pluginApi.q.reject();
|
|
43206
|
-
|
|
43134
|
+
var feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
|
|
43207
43135
|
try {
|
|
43208
|
-
|
|
43209
|
-
if (
|
|
43136
|
+
var fdbkDst_1 = getQueryParam(globalPendo.url.get(), 'fdbkDst');
|
|
43137
|
+
if (fdbkDst_1 && fdbkDst_1.startsWith('case')) {
|
|
43210
43138
|
initialized = true;
|
|
43211
43139
|
getFeedbackLoginUrl().then(function (loginUrl) {
|
|
43212
|
-
|
|
43140
|
+
var destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst_1;
|
|
43213
43141
|
window.location.href = destinationUrl;
|
|
43214
43142
|
});
|
|
43215
43143
|
return;
|
|
@@ -43258,7 +43186,7 @@ function Feedback() {
|
|
|
43258
43186
|
function convertPendoToFeedbackOptions(options) {
|
|
43259
43187
|
var jwtOptions = pluginApi.agent.getJwtInfoCopy();
|
|
43260
43188
|
if (globalPendo._.isEmpty(jwtOptions)) {
|
|
43261
|
-
|
|
43189
|
+
var feedbackOptions = {};
|
|
43262
43190
|
feedbackOptions.user = globalPendo._.pick(options.visitor, 'id', 'full_name', 'firstName', 'lastName', 'email', 'tags', 'custom_allowed_products');
|
|
43263
43191
|
globalPendo._.extend(feedbackOptions.user, { allowed_products: [{ id: feedbackAllowedProductId }] });
|
|
43264
43192
|
feedbackOptions.account = globalPendo._.pick(options.account, 'id', 'name', 'monthly_value', 'is_paying', 'tags');
|
|
@@ -43365,13 +43293,15 @@ const testableAccessors$1 = {
|
|
|
43365
43293
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
43366
43294
|
ShadowRoot: ["host", "styleSheets"],
|
|
43367
43295
|
Element: ["shadowRoot"],
|
|
43368
|
-
MutationObserver: []
|
|
43296
|
+
MutationObserver: [],
|
|
43297
|
+
EventTarget: []
|
|
43369
43298
|
};
|
|
43370
43299
|
const testableMethods$1 = {
|
|
43371
43300
|
Node: ["contains", "getRootNode"],
|
|
43372
43301
|
ShadowRoot: ["getSelection"],
|
|
43373
43302
|
Element: ["querySelector", "querySelectorAll"],
|
|
43374
|
-
MutationObserver: ["constructor"]
|
|
43303
|
+
MutationObserver: ["constructor"],
|
|
43304
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
43375
43305
|
};
|
|
43376
43306
|
const untaintedBasePrototype$1 = {};
|
|
43377
43307
|
function angularZoneUnpatchedAlternative$1(key) {
|
|
@@ -43446,11 +43376,26 @@ function getUntaintedAccessor$1(key, instance, accessor) {
|
|
|
43446
43376
|
}
|
|
43447
43377
|
const untaintedMethodCache$1 = {};
|
|
43448
43378
|
function getUntaintedMethod$1(key, instance, method) {
|
|
43379
|
+
var _a2, _b, _c;
|
|
43449
43380
|
const cacheKey = `${key}.${String(method)}`;
|
|
43450
43381
|
if (untaintedMethodCache$1[cacheKey])
|
|
43451
43382
|
return untaintedMethodCache$1[cacheKey].bind(
|
|
43452
43383
|
instance
|
|
43453
43384
|
);
|
|
43385
|
+
const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
|
|
43386
|
+
_a2,
|
|
43387
|
+
String(method)
|
|
43388
|
+
);
|
|
43389
|
+
if (zoneSymbol) {
|
|
43390
|
+
const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
|
|
43391
|
+
const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
|
|
43392
|
+
if (typeof nativeFromZone === "function") {
|
|
43393
|
+
untaintedMethodCache$1[cacheKey] = nativeFromZone;
|
|
43394
|
+
return nativeFromZone.bind(
|
|
43395
|
+
instance
|
|
43396
|
+
);
|
|
43397
|
+
}
|
|
43398
|
+
}
|
|
43454
43399
|
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
43455
43400
|
const untaintedMethod = untaintedPrototype[method];
|
|
43456
43401
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
@@ -43492,6 +43437,16 @@ function querySelector$1(n2, selectors) {
|
|
|
43492
43437
|
function querySelectorAll$1(n2, selectors) {
|
|
43493
43438
|
return getUntaintedMethod$1("Element", n2, "querySelectorAll")(selectors);
|
|
43494
43439
|
}
|
|
43440
|
+
function addEventListener$1(n2, type, listener, options) {
|
|
43441
|
+
getUntaintedMethod$1("EventTarget", n2, "addEventListener")(type, listener, options);
|
|
43442
|
+
}
|
|
43443
|
+
function removeEventListener$1(n2, type, listener, options) {
|
|
43444
|
+
getUntaintedMethod$1("EventTarget", n2, "removeEventListener")(
|
|
43445
|
+
type,
|
|
43446
|
+
listener,
|
|
43447
|
+
options
|
|
43448
|
+
);
|
|
43449
|
+
}
|
|
43495
43450
|
function mutationObserverCtor$1() {
|
|
43496
43451
|
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
43497
43452
|
}
|
|
@@ -43533,6 +43488,8 @@ const index$1 = {
|
|
|
43533
43488
|
shadowRoot: shadowRoot$1,
|
|
43534
43489
|
querySelector: querySelector$1,
|
|
43535
43490
|
querySelectorAll: querySelectorAll$1,
|
|
43491
|
+
addEventListener: addEventListener$1,
|
|
43492
|
+
removeEventListener: removeEventListener$1,
|
|
43536
43493
|
mutationObserver: mutationObserverCtor$1,
|
|
43537
43494
|
patch: patch$1
|
|
43538
43495
|
};
|
|
@@ -44962,13 +44919,15 @@ const testableAccessors = {
|
|
|
44962
44919
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
44963
44920
|
ShadowRoot: ["host", "styleSheets"],
|
|
44964
44921
|
Element: ["shadowRoot"],
|
|
44965
|
-
MutationObserver: []
|
|
44922
|
+
MutationObserver: [],
|
|
44923
|
+
EventTarget: []
|
|
44966
44924
|
};
|
|
44967
44925
|
const testableMethods = {
|
|
44968
44926
|
Node: ["contains", "getRootNode"],
|
|
44969
44927
|
ShadowRoot: ["getSelection"],
|
|
44970
44928
|
Element: ["querySelector", "querySelectorAll"],
|
|
44971
|
-
MutationObserver: ["constructor"]
|
|
44929
|
+
MutationObserver: ["constructor"],
|
|
44930
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
44972
44931
|
};
|
|
44973
44932
|
const untaintedBasePrototype = {};
|
|
44974
44933
|
function angularZoneUnpatchedAlternative(key) {
|
|
@@ -45043,11 +45002,26 @@ function getUntaintedAccessor(key, instance, accessor) {
|
|
|
45043
45002
|
}
|
|
45044
45003
|
const untaintedMethodCache = {};
|
|
45045
45004
|
function getUntaintedMethod(key, instance, method) {
|
|
45005
|
+
var _a2, _b, _c;
|
|
45046
45006
|
const cacheKey = `${key}.${String(method)}`;
|
|
45047
45007
|
if (untaintedMethodCache[cacheKey])
|
|
45048
45008
|
return untaintedMethodCache[cacheKey].bind(
|
|
45049
45009
|
instance
|
|
45050
45010
|
);
|
|
45011
|
+
const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
|
|
45012
|
+
_a2,
|
|
45013
|
+
String(method)
|
|
45014
|
+
);
|
|
45015
|
+
if (zoneSymbol) {
|
|
45016
|
+
const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
|
|
45017
|
+
const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
|
|
45018
|
+
if (typeof nativeFromZone === "function") {
|
|
45019
|
+
untaintedMethodCache[cacheKey] = nativeFromZone;
|
|
45020
|
+
return nativeFromZone.bind(
|
|
45021
|
+
instance
|
|
45022
|
+
);
|
|
45023
|
+
}
|
|
45024
|
+
}
|
|
45051
45025
|
const untaintedPrototype = getUntaintedPrototype(key);
|
|
45052
45026
|
const untaintedMethod = untaintedPrototype[method];
|
|
45053
45027
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
@@ -45089,6 +45063,16 @@ function querySelector(n2, selectors) {
|
|
|
45089
45063
|
function querySelectorAll(n2, selectors) {
|
|
45090
45064
|
return getUntaintedMethod("Element", n2, "querySelectorAll")(selectors);
|
|
45091
45065
|
}
|
|
45066
|
+
function addEventListener(n2, type, listener, options) {
|
|
45067
|
+
getUntaintedMethod("EventTarget", n2, "addEventListener")(type, listener, options);
|
|
45068
|
+
}
|
|
45069
|
+
function removeEventListener(n2, type, listener, options) {
|
|
45070
|
+
getUntaintedMethod("EventTarget", n2, "removeEventListener")(
|
|
45071
|
+
type,
|
|
45072
|
+
listener,
|
|
45073
|
+
options
|
|
45074
|
+
);
|
|
45075
|
+
}
|
|
45092
45076
|
function mutationObserverCtor() {
|
|
45093
45077
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
45094
45078
|
}
|
|
@@ -45146,23 +45130,15 @@ const index = {
|
|
|
45146
45130
|
shadowRoot,
|
|
45147
45131
|
querySelector,
|
|
45148
45132
|
querySelectorAll,
|
|
45133
|
+
addEventListener,
|
|
45134
|
+
removeEventListener,
|
|
45149
45135
|
mutationObserver: mutationObserverCtor,
|
|
45150
45136
|
patch
|
|
45151
45137
|
};
|
|
45152
|
-
function getWindow(documentOrWindow) {
|
|
45153
|
-
const defaultView = documentOrWindow.defaultView;
|
|
45154
|
-
return defaultView ? defaultView : documentOrWindow;
|
|
45155
|
-
}
|
|
45156
45138
|
function on(type, fn, target = document) {
|
|
45157
|
-
const windowObj = getWindow(target);
|
|
45158
|
-
const nativeAddEventListener = getNative$1(
|
|
45159
|
-
"addEventListener",
|
|
45160
|
-
windowObj
|
|
45161
|
-
);
|
|
45162
|
-
const nativeRemoveEventListener = getNative$1("removeEventListener", windowObj);
|
|
45163
45139
|
const options = { capture: true, passive: true };
|
|
45164
|
-
|
|
45165
|
-
return () =>
|
|
45140
|
+
index.addEventListener(target, type, fn, options);
|
|
45141
|
+
return () => index.removeEventListener(target, type, fn, options);
|
|
45166
45142
|
}
|
|
45167
45143
|
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
45168
45144
|
let _mirror = {
|
|
@@ -48800,6 +48776,17 @@ var SessionRecorderBuffer = /** @class */ (function () {
|
|
|
48800
48776
|
return SessionRecorderBuffer;
|
|
48801
48777
|
}());
|
|
48802
48778
|
|
|
48779
|
+
var __assign = function() {
|
|
48780
|
+
__assign = Object.assign || function __assign(t) {
|
|
48781
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
48782
|
+
s = arguments[i];
|
|
48783
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
48784
|
+
}
|
|
48785
|
+
return t;
|
|
48786
|
+
};
|
|
48787
|
+
return __assign.apply(this, arguments);
|
|
48788
|
+
};
|
|
48789
|
+
|
|
48803
48790
|
function __rest(s, e) {
|
|
48804
48791
|
var t = {};
|
|
48805
48792
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -50953,7 +50940,7 @@ function includes(str, substring) {
|
|
|
50953
50940
|
function getResourceType(blockedURI, directive) {
|
|
50954
50941
|
if (!directive || typeof directive !== 'string')
|
|
50955
50942
|
return 'resource';
|
|
50956
|
-
|
|
50943
|
+
var d = directive.toLowerCase();
|
|
50957
50944
|
if (blockedURI === 'inline') {
|
|
50958
50945
|
if (includes(d, 'script-src-attr')) {
|
|
50959
50946
|
return 'inline event handler';
|
|
@@ -51012,11 +50999,12 @@ function getResourceType(blockedURI, directive) {
|
|
|
51012
50999
|
function getDirective(policy, directiveName) {
|
|
51013
51000
|
if (!policy || !directiveName)
|
|
51014
51001
|
return '';
|
|
51015
|
-
|
|
51016
|
-
for (
|
|
51017
|
-
|
|
51018
|
-
|
|
51019
|
-
|
|
51002
|
+
var needle = directiveName.toLowerCase();
|
|
51003
|
+
for (var _i = 0, _a = policy.split(';'); _i < _a.length; _i++) {
|
|
51004
|
+
var directive = _a[_i];
|
|
51005
|
+
var trimmed = directive.trim();
|
|
51006
|
+
var lower = trimmed.toLowerCase();
|
|
51007
|
+
if (lower === needle || lower.startsWith("".concat(needle, " "))) {
|
|
51020
51008
|
return trimmed;
|
|
51021
51009
|
}
|
|
51022
51010
|
}
|
|
@@ -51038,7 +51026,7 @@ function getDirective(policy, directiveName) {
|
|
|
51038
51026
|
function getArticle(phrase) {
|
|
51039
51027
|
if (!phrase || typeof phrase !== 'string')
|
|
51040
51028
|
return 'A';
|
|
51041
|
-
|
|
51029
|
+
var c = phrase.trim().charAt(0).toLowerCase();
|
|
51042
51030
|
return includes('aeiou', c) ? 'An' : 'A';
|
|
51043
51031
|
}
|
|
51044
51032
|
/**
|
|
@@ -51081,46 +51069,47 @@ function createCspViolationMessage(blockedURI, directive, isReportOnly, original
|
|
|
51081
51069
|
return 'Content Security Policy: Unknown violation occurred.';
|
|
51082
51070
|
}
|
|
51083
51071
|
try {
|
|
51084
|
-
|
|
51072
|
+
var reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
|
|
51085
51073
|
// special case for frame-ancestors since it doesn't fit our template at all
|
|
51086
51074
|
if ((directive === null || directive === void 0 ? void 0 : directive.toLowerCase()) === 'frame-ancestors') {
|
|
51087
|
-
return
|
|
51075
|
+
return "Content Security Policy".concat(reportOnlyText, ": The display of ").concat(blockedURI, " in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
|
|
51088
51076
|
}
|
|
51089
|
-
|
|
51090
|
-
|
|
51091
|
-
|
|
51092
|
-
|
|
51093
|
-
|
|
51094
|
-
|
|
51095
|
-
return
|
|
51077
|
+
var resourceType = getResourceType(blockedURI, directive);
|
|
51078
|
+
var article = getArticle(resourceType);
|
|
51079
|
+
var source = formatBlockedUri(blockedURI);
|
|
51080
|
+
var directiveValue = getDirective(originalPolicy, directive);
|
|
51081
|
+
var policyDisplay = directiveValue || directive;
|
|
51082
|
+
var resourceDescription = "".concat(article, " ").concat(resourceType).concat(source ? " from ".concat(source) : '');
|
|
51083
|
+
return "Content Security Policy".concat(reportOnlyText, ": ").concat(resourceDescription, " was blocked by your site's `").concat(policyDisplay, "` policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
|
|
51096
51084
|
}
|
|
51097
51085
|
catch (error) {
|
|
51098
|
-
return
|
|
51086
|
+
return "Content Security Policy: Error formatting violation message: ".concat(error.message);
|
|
51099
51087
|
}
|
|
51100
51088
|
}
|
|
51101
51089
|
|
|
51102
|
-
|
|
51103
|
-
|
|
51090
|
+
var MAX_LENGTH = 1000;
|
|
51091
|
+
var PII_PATTERN = {
|
|
51104
51092
|
ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
|
|
51105
51093
|
ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
|
|
51106
51094
|
creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
|
|
51107
51095
|
httpsUrls: /https:\/\/[^\s]+/g,
|
|
51108
51096
|
email: /[\w._+-]+@[\w.-]+\.\w+/g
|
|
51109
51097
|
};
|
|
51110
|
-
|
|
51111
|
-
|
|
51112
|
-
|
|
51113
|
-
|
|
51114
|
-
|
|
51098
|
+
var PII_REPLACEMENT = '*'.repeat(10);
|
|
51099
|
+
var JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
|
|
51100
|
+
var UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
|
|
51101
|
+
var joinedKeys = JSON_PII_KEYS.join('|');
|
|
51102
|
+
var keyPattern = "\"([^\"]*(?:".concat(joinedKeys, ")[^\"]*)\"");
|
|
51115
51103
|
// only scrub strings, numbers, and booleans
|
|
51116
|
-
|
|
51104
|
+
var acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
|
|
51117
51105
|
/**
|
|
51118
51106
|
* Truncates a string to the max length
|
|
51119
51107
|
* @access private
|
|
51120
51108
|
* @param {String} string
|
|
51121
51109
|
* @returns {String}
|
|
51122
51110
|
*/
|
|
51123
|
-
function truncate(string, includeEllipsis
|
|
51111
|
+
function truncate(string, includeEllipsis) {
|
|
51112
|
+
if (includeEllipsis === void 0) { includeEllipsis = false; }
|
|
51124
51113
|
if (string.length <= MAX_LENGTH)
|
|
51125
51114
|
return string;
|
|
51126
51115
|
if (includeEllipsis) {
|
|
@@ -51137,7 +51126,7 @@ function truncate(string, includeEllipsis = false) {
|
|
|
51137
51126
|
* @returns {String}
|
|
51138
51127
|
*/
|
|
51139
51128
|
function generateLogKey(methodName, message, stackTrace) {
|
|
51140
|
-
return
|
|
51129
|
+
return "".concat(methodName, "|").concat(message, "|").concat(stackTrace);
|
|
51141
51130
|
}
|
|
51142
51131
|
/**
|
|
51143
51132
|
* Checks if a string has 2 or more digits, a https URL, or an email address
|
|
@@ -51154,12 +51143,13 @@ function mightContainPII(string) {
|
|
|
51154
51143
|
* @param {String} string
|
|
51155
51144
|
* @returns {String}
|
|
51156
51145
|
*/
|
|
51157
|
-
function scrubPII(
|
|
51146
|
+
function scrubPII(_a) {
|
|
51147
|
+
var string = _a.string, _ = _a._;
|
|
51158
51148
|
if (!string || typeof string !== 'string')
|
|
51159
51149
|
return string;
|
|
51160
51150
|
if (!mightContainPII(string))
|
|
51161
51151
|
return string;
|
|
51162
|
-
return _.reduce(_.values(PII_PATTERN), (str, pattern)
|
|
51152
|
+
return _.reduce(_.values(PII_PATTERN), function (str, pattern) { return str.replace(pattern, PII_REPLACEMENT); }, string);
|
|
51163
51153
|
}
|
|
51164
51154
|
/**
|
|
51165
51155
|
* Scrub PII from a stringified JSON object
|
|
@@ -51168,12 +51158,14 @@ function scrubPII({ string, _ }) {
|
|
|
51168
51158
|
* @returns {String}
|
|
51169
51159
|
*/
|
|
51170
51160
|
function scrubJsonPII(string) {
|
|
51171
|
-
|
|
51161
|
+
var fullScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*[\\{\\[]"), 'i');
|
|
51172
51162
|
if (fullScrubRegex.test(string)) {
|
|
51173
51163
|
return UNABLE_TO_DISPLAY_BODY;
|
|
51174
51164
|
}
|
|
51175
|
-
|
|
51176
|
-
return string.replace(keyValueScrubRegex, (match, key)
|
|
51165
|
+
var keyValueScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*").concat(acceptedValues), 'gi');
|
|
51166
|
+
return string.replace(keyValueScrubRegex, function (match, key) {
|
|
51167
|
+
return "\"".concat(key, "\":\"").concat(PII_REPLACEMENT, "\"");
|
|
51168
|
+
});
|
|
51177
51169
|
}
|
|
51178
51170
|
/**
|
|
51179
51171
|
* Checks if a string is a JSON object
|
|
@@ -51185,7 +51177,7 @@ function scrubJsonPII(string) {
|
|
|
51185
51177
|
function mightContainJson(string, contentType) {
|
|
51186
51178
|
if (!string || typeof string !== 'string')
|
|
51187
51179
|
return false;
|
|
51188
|
-
|
|
51180
|
+
var firstChar = string.charAt(0);
|
|
51189
51181
|
if (contentType && contentType.indexOf('application/json') !== -1) {
|
|
51190
51182
|
return true;
|
|
51191
51183
|
}
|
|
@@ -51198,19 +51190,20 @@ function mightContainJson(string, contentType) {
|
|
|
51198
51190
|
* @param {String} contentType
|
|
51199
51191
|
* @returns {String}
|
|
51200
51192
|
*/
|
|
51201
|
-
function maskSensitiveFields(
|
|
51193
|
+
function maskSensitiveFields(_a) {
|
|
51194
|
+
var string = _a.string, contentType = _a.contentType, _ = _a._;
|
|
51202
51195
|
if (!string || typeof string !== 'string')
|
|
51203
51196
|
return string;
|
|
51204
51197
|
if (mightContainJson(string, contentType)) {
|
|
51205
51198
|
string = scrubJsonPII(string);
|
|
51206
51199
|
}
|
|
51207
51200
|
if (mightContainPII(string)) {
|
|
51208
|
-
string = scrubPII({ string, _ });
|
|
51201
|
+
string = scrubPII({ string: string, _: _ });
|
|
51209
51202
|
}
|
|
51210
51203
|
return string;
|
|
51211
51204
|
}
|
|
51212
51205
|
|
|
51213
|
-
|
|
51206
|
+
var DEV_LOG_TYPE = 'devlog';
|
|
51214
51207
|
function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
51215
51208
|
return {
|
|
51216
51209
|
browser_time: pluginAPI.util.getNow(),
|
|
@@ -51221,12 +51214,12 @@ function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
|
51221
51214
|
};
|
|
51222
51215
|
}
|
|
51223
51216
|
|
|
51224
|
-
|
|
51225
|
-
|
|
51226
|
-
|
|
51227
|
-
|
|
51228
|
-
|
|
51229
|
-
|
|
51217
|
+
var TOKEN_MAX_SIZE = 100;
|
|
51218
|
+
var TOKEN_REFILL_RATE = 10;
|
|
51219
|
+
var TOKEN_REFRESH_INTERVAL = 1000;
|
|
51220
|
+
var MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
|
|
51221
|
+
var DevlogBuffer = /** @class */ (function () {
|
|
51222
|
+
function DevlogBuffer(pendo, pluginAPI) {
|
|
51230
51223
|
this.pendo = pendo;
|
|
51231
51224
|
this.pluginAPI = pluginAPI;
|
|
51232
51225
|
this.events = [];
|
|
@@ -51237,36 +51230,36 @@ class DevlogBuffer {
|
|
|
51237
51230
|
this.lastRefillTime = this.pluginAPI.util.getNow();
|
|
51238
51231
|
this.nextRefillTime = this.lastRefillTime + TOKEN_REFRESH_INTERVAL;
|
|
51239
51232
|
}
|
|
51240
|
-
isEmpty() {
|
|
51233
|
+
DevlogBuffer.prototype.isEmpty = function () {
|
|
51241
51234
|
return this.events.length === 0 && this.payloads.length === 0;
|
|
51242
|
-
}
|
|
51243
|
-
refillTokens() {
|
|
51244
|
-
|
|
51235
|
+
};
|
|
51236
|
+
DevlogBuffer.prototype.refillTokens = function () {
|
|
51237
|
+
var now = this.pluginAPI.util.getNow();
|
|
51245
51238
|
if (now >= this.nextRefillTime) {
|
|
51246
|
-
|
|
51247
|
-
|
|
51248
|
-
|
|
51239
|
+
var timeSinceLastRefill = now - this.lastRefillTime;
|
|
51240
|
+
var secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
|
|
51241
|
+
var tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
|
|
51249
51242
|
this.tokens = Math.min(this.tokens + tokensToRefill, TOKEN_MAX_SIZE);
|
|
51250
51243
|
this.lastRefillTime = now;
|
|
51251
51244
|
this.nextRefillTime = now + TOKEN_REFRESH_INTERVAL;
|
|
51252
51245
|
}
|
|
51253
|
-
}
|
|
51254
|
-
clear() {
|
|
51246
|
+
};
|
|
51247
|
+
DevlogBuffer.prototype.clear = function () {
|
|
51255
51248
|
this.events = [];
|
|
51256
51249
|
this.lastEvent = null;
|
|
51257
51250
|
this.uncompressedSize = 0;
|
|
51258
|
-
}
|
|
51259
|
-
hasTokenAvailable() {
|
|
51251
|
+
};
|
|
51252
|
+
DevlogBuffer.prototype.hasTokenAvailable = function () {
|
|
51260
51253
|
this.refillTokens();
|
|
51261
51254
|
return this.tokens > 0;
|
|
51262
|
-
}
|
|
51263
|
-
estimateEventSize(event) {
|
|
51255
|
+
};
|
|
51256
|
+
DevlogBuffer.prototype.estimateEventSize = function (event) {
|
|
51264
51257
|
return JSON.stringify(event).length;
|
|
51265
|
-
}
|
|
51266
|
-
push(event) {
|
|
51258
|
+
};
|
|
51259
|
+
DevlogBuffer.prototype.push = function (event) {
|
|
51267
51260
|
if (!this.hasTokenAvailable())
|
|
51268
51261
|
return false;
|
|
51269
|
-
|
|
51262
|
+
var eventSize = this.estimateEventSize(event);
|
|
51270
51263
|
if (this.uncompressedSize + eventSize > MAX_UNCOMPRESSED_SIZE) {
|
|
51271
51264
|
this.compressCurrentChunk();
|
|
51272
51265
|
}
|
|
@@ -51275,54 +51268,55 @@ class DevlogBuffer {
|
|
|
51275
51268
|
this.events.push(event);
|
|
51276
51269
|
this.tokens = Math.max(this.tokens - 1, 0);
|
|
51277
51270
|
return true;
|
|
51278
|
-
}
|
|
51279
|
-
compressCurrentChunk() {
|
|
51271
|
+
};
|
|
51272
|
+
DevlogBuffer.prototype.compressCurrentChunk = function () {
|
|
51280
51273
|
if (this.events.length === 0)
|
|
51281
51274
|
return;
|
|
51282
|
-
|
|
51275
|
+
var jzb = this.pendo.compress(this.events);
|
|
51283
51276
|
this.payloads.push(jzb);
|
|
51284
51277
|
this.clear();
|
|
51285
|
-
}
|
|
51286
|
-
generateUrl() {
|
|
51287
|
-
|
|
51278
|
+
};
|
|
51279
|
+
DevlogBuffer.prototype.generateUrl = function () {
|
|
51280
|
+
var queryParams = {
|
|
51288
51281
|
v: this.pendo.VERSION,
|
|
51289
51282
|
ct: this.pluginAPI.util.getNow()
|
|
51290
51283
|
};
|
|
51291
51284
|
return this.pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, this.pendo.apiKey, queryParams);
|
|
51292
|
-
}
|
|
51293
|
-
pack() {
|
|
51285
|
+
};
|
|
51286
|
+
DevlogBuffer.prototype.pack = function () {
|
|
51294
51287
|
if (this.isEmpty())
|
|
51295
51288
|
return;
|
|
51296
|
-
|
|
51289
|
+
var url = this.generateUrl();
|
|
51297
51290
|
this.compressCurrentChunk();
|
|
51298
|
-
|
|
51299
|
-
jzb,
|
|
51300
|
-
url
|
|
51301
|
-
}));
|
|
51291
|
+
var payloads = this.pendo._.map(this.payloads, function (jzb) { return ({
|
|
51292
|
+
jzb: jzb,
|
|
51293
|
+
url: url
|
|
51294
|
+
}); });
|
|
51302
51295
|
this.payloads = [];
|
|
51303
51296
|
return payloads;
|
|
51304
|
-
}
|
|
51305
|
-
|
|
51297
|
+
};
|
|
51298
|
+
return DevlogBuffer;
|
|
51299
|
+
}());
|
|
51306
51300
|
|
|
51307
|
-
|
|
51308
|
-
|
|
51301
|
+
var DevlogTransport = /** @class */ (function () {
|
|
51302
|
+
function DevlogTransport(globalPendo, pluginAPI) {
|
|
51309
51303
|
this.pendo = globalPendo;
|
|
51310
51304
|
this.pluginAPI = pluginAPI;
|
|
51311
51305
|
}
|
|
51312
|
-
buildGetUrl(baseUrl, jzb) {
|
|
51313
|
-
|
|
51306
|
+
DevlogTransport.prototype.buildGetUrl = function (baseUrl, jzb) {
|
|
51307
|
+
var params = {};
|
|
51314
51308
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
51315
51309
|
this.pluginAPI.agent.addAccountIdParams(params, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
51316
51310
|
}
|
|
51317
|
-
|
|
51311
|
+
var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
51318
51312
|
if (!this.pendo._.isEmpty(jwtOptions)) {
|
|
51319
51313
|
this.pendo._.extend(params, jwtOptions);
|
|
51320
51314
|
}
|
|
51321
51315
|
params.jzb = jzb;
|
|
51322
|
-
|
|
51323
|
-
return
|
|
51324
|
-
}
|
|
51325
|
-
get(url, options) {
|
|
51316
|
+
var queryString = this.pendo._.map(params, function (value, key) { return "".concat(key, "=").concat(value); }).join('&');
|
|
51317
|
+
return "".concat(baseUrl).concat(baseUrl.indexOf('?') !== -1 ? '&' : '?').concat(queryString);
|
|
51318
|
+
};
|
|
51319
|
+
DevlogTransport.prototype.get = function (url, options) {
|
|
51326
51320
|
options.method = 'GET';
|
|
51327
51321
|
if (this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
51328
51322
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
@@ -51330,86 +51324,90 @@ class DevlogTransport {
|
|
|
51330
51324
|
else {
|
|
51331
51325
|
return this.pendo.ajax.get(url);
|
|
51332
51326
|
}
|
|
51333
|
-
}
|
|
51334
|
-
sendRequestWithGet
|
|
51335
|
-
|
|
51327
|
+
};
|
|
51328
|
+
DevlogTransport.prototype.sendRequestWithGet = function (_a) {
|
|
51329
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51330
|
+
var getUrl = this.buildGetUrl(url, jzb);
|
|
51336
51331
|
return this.get(getUrl, {
|
|
51337
51332
|
headers: {
|
|
51338
51333
|
'Content-Type': 'application/octet-stream'
|
|
51339
51334
|
}
|
|
51340
51335
|
});
|
|
51341
|
-
}
|
|
51342
|
-
post(url, options) {
|
|
51336
|
+
};
|
|
51337
|
+
DevlogTransport.prototype.post = function (url, options) {
|
|
51343
51338
|
options.method = 'POST';
|
|
51344
51339
|
if (options.keepalive && this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
51345
51340
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
51346
51341
|
}
|
|
51347
51342
|
else if (options.keepalive && this.pluginAPI.transmit.sendBeacon.supported()) {
|
|
51348
|
-
|
|
51343
|
+
var result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
|
|
51349
51344
|
return result ? Promise$2.resolve() : Promise$2.reject(new Error('sendBeacon failed to send devlog data'));
|
|
51350
51345
|
}
|
|
51351
51346
|
else {
|
|
51352
51347
|
return this.pendo.ajax.post(url, options.body);
|
|
51353
51348
|
}
|
|
51354
|
-
}
|
|
51355
|
-
sendRequestWithPost
|
|
51356
|
-
|
|
51357
|
-
|
|
51349
|
+
};
|
|
51350
|
+
DevlogTransport.prototype.sendRequestWithPost = function (_a, isUnload) {
|
|
51351
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51352
|
+
var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
51353
|
+
var bodyPayload = {
|
|
51358
51354
|
events: jzb,
|
|
51359
51355
|
browser_time: this.pluginAPI.util.getNow()
|
|
51360
51356
|
};
|
|
51361
51357
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
51362
51358
|
this.pluginAPI.agent.addAccountIdParams(bodyPayload, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
51363
51359
|
}
|
|
51364
|
-
|
|
51360
|
+
var body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
|
|
51365
51361
|
return this.post(url, {
|
|
51366
|
-
body,
|
|
51362
|
+
body: body,
|
|
51367
51363
|
headers: {
|
|
51368
51364
|
'Content-Type': 'application/json'
|
|
51369
51365
|
},
|
|
51370
51366
|
keepalive: isUnload
|
|
51371
51367
|
});
|
|
51372
|
-
}
|
|
51373
|
-
sendRequest
|
|
51374
|
-
|
|
51368
|
+
};
|
|
51369
|
+
DevlogTransport.prototype.sendRequest = function (_a, isUnload) {
|
|
51370
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51371
|
+
var compressedLength = jzb.length;
|
|
51375
51372
|
if (compressedLength <= this.pluginAPI.constants.ENCODED_EVENT_MAX_LENGTH && !this.pluginAPI.ConfigReader.get('sendEventsWithPostOnly')) {
|
|
51376
|
-
return this.sendRequestWithGet({ url, jzb });
|
|
51373
|
+
return this.sendRequestWithGet({ url: url, jzb: jzb });
|
|
51377
51374
|
}
|
|
51378
|
-
return this.sendRequestWithPost({ url, jzb }, isUnload);
|
|
51379
|
-
}
|
|
51380
|
-
|
|
51375
|
+
return this.sendRequestWithPost({ url: url, jzb: jzb }, isUnload);
|
|
51376
|
+
};
|
|
51377
|
+
return DevlogTransport;
|
|
51378
|
+
}());
|
|
51381
51379
|
|
|
51382
51380
|
function ConsoleCapture() {
|
|
51383
|
-
|
|
51384
|
-
|
|
51385
|
-
|
|
51386
|
-
|
|
51387
|
-
|
|
51388
|
-
|
|
51389
|
-
|
|
51390
|
-
|
|
51391
|
-
|
|
51392
|
-
|
|
51393
|
-
|
|
51394
|
-
|
|
51381
|
+
var pluginAPI;
|
|
51382
|
+
var _;
|
|
51383
|
+
var globalPendo;
|
|
51384
|
+
var buffer;
|
|
51385
|
+
var sendQueue;
|
|
51386
|
+
var sendInterval;
|
|
51387
|
+
var transport;
|
|
51388
|
+
var isPtmPaused;
|
|
51389
|
+
var isCapturingConsoleLogs = false;
|
|
51390
|
+
var CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
|
|
51391
|
+
var CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
|
|
51392
|
+
var DEV_LOG_SUB_TYPE = 'console';
|
|
51395
51393
|
// deduplicate logs
|
|
51396
|
-
|
|
51394
|
+
var lastLogKey = '';
|
|
51397
51395
|
return {
|
|
51398
51396
|
name: 'ConsoleCapture',
|
|
51399
|
-
initialize,
|
|
51400
|
-
teardown,
|
|
51401
|
-
addIntercepts,
|
|
51402
|
-
createConsoleEvent,
|
|
51403
|
-
captureStackTrace,
|
|
51404
|
-
send,
|
|
51405
|
-
setCaptureState,
|
|
51406
|
-
recordingStarted,
|
|
51407
|
-
recordingStopped,
|
|
51408
|
-
onAppHidden,
|
|
51409
|
-
onAppUnloaded,
|
|
51410
|
-
onPtmPaused,
|
|
51411
|
-
onPtmUnpaused,
|
|
51412
|
-
securityPolicyViolationFn,
|
|
51397
|
+
initialize: initialize,
|
|
51398
|
+
teardown: teardown,
|
|
51399
|
+
addIntercepts: addIntercepts,
|
|
51400
|
+
createConsoleEvent: createConsoleEvent,
|
|
51401
|
+
captureStackTrace: captureStackTrace,
|
|
51402
|
+
send: send,
|
|
51403
|
+
setCaptureState: setCaptureState,
|
|
51404
|
+
recordingStarted: recordingStarted,
|
|
51405
|
+
recordingStopped: recordingStopped,
|
|
51406
|
+
onAppHidden: onAppHidden,
|
|
51407
|
+
onAppUnloaded: onAppUnloaded,
|
|
51408
|
+
onPtmPaused: onPtmPaused,
|
|
51409
|
+
onPtmUnpaused: onPtmUnpaused,
|
|
51410
|
+
securityPolicyViolationFn: securityPolicyViolationFn,
|
|
51413
51411
|
get isCapturingConsoleLogs() {
|
|
51414
51412
|
return isCapturingConsoleLogs;
|
|
51415
51413
|
},
|
|
@@ -51426,16 +51424,16 @@ function ConsoleCapture() {
|
|
|
51426
51424
|
function initialize(pendo, PluginAPI) {
|
|
51427
51425
|
_ = pendo._;
|
|
51428
51426
|
pluginAPI = PluginAPI;
|
|
51429
|
-
|
|
51427
|
+
var ConfigReader = pluginAPI.ConfigReader;
|
|
51430
51428
|
ConfigReader.addOption(CAPTURE_CONSOLE_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
|
|
51431
|
-
|
|
51429
|
+
var captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
|
|
51432
51430
|
if (!captureConsoleEnabled)
|
|
51433
51431
|
return;
|
|
51434
51432
|
globalPendo = pendo;
|
|
51435
51433
|
buffer = new DevlogBuffer(pendo, pluginAPI);
|
|
51436
51434
|
transport = new DevlogTransport(pendo, pluginAPI);
|
|
51437
51435
|
sendQueue = new pluginAPI.SendQueue(transport.sendRequest.bind(transport));
|
|
51438
|
-
sendInterval = setInterval(()
|
|
51436
|
+
sendInterval = setInterval(function () {
|
|
51439
51437
|
if (!sendQueue.failed()) {
|
|
51440
51438
|
send();
|
|
51441
51439
|
}
|
|
@@ -51461,17 +51459,19 @@ function ConsoleCapture() {
|
|
|
51461
51459
|
function onPtmUnpaused() {
|
|
51462
51460
|
isPtmPaused = false;
|
|
51463
51461
|
if (!buffer.isEmpty()) {
|
|
51464
|
-
for (
|
|
51465
|
-
|
|
51462
|
+
for (var _i = 0, _a = buffer.events; _i < _a.length; _i++) {
|
|
51463
|
+
var event_1 = _a[_i];
|
|
51464
|
+
pluginAPI.Events.eventCaptured.trigger(event_1);
|
|
51466
51465
|
}
|
|
51467
51466
|
send();
|
|
51468
51467
|
}
|
|
51469
51468
|
}
|
|
51470
|
-
function setCaptureState(
|
|
51469
|
+
function setCaptureState(_a) {
|
|
51470
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
|
|
51471
51471
|
if (shouldCapture === isCapturingConsoleLogs)
|
|
51472
51472
|
return;
|
|
51473
51473
|
isCapturingConsoleLogs = shouldCapture;
|
|
51474
|
-
pluginAPI.log.info(
|
|
51474
|
+
pluginAPI.log.info("[ConsoleCapture] Console log capture ".concat(shouldCapture ? 'started' : 'stopped').concat(reason ? ": ".concat(reason) : ''));
|
|
51475
51475
|
}
|
|
51476
51476
|
function recordingStarted() {
|
|
51477
51477
|
setCaptureState({ shouldCapture: true, reason: 'recording started' });
|
|
@@ -51485,12 +51485,12 @@ function ConsoleCapture() {
|
|
|
51485
51485
|
}
|
|
51486
51486
|
function addIntercepts() {
|
|
51487
51487
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
51488
|
-
|
|
51488
|
+
var originalMethod = console[methodName];
|
|
51489
51489
|
if (!originalMethod)
|
|
51490
51490
|
return;
|
|
51491
51491
|
console[methodName] = _.wrap(originalMethod, function (originalFn) {
|
|
51492
51492
|
// slice 1 to omit originalFn
|
|
51493
|
-
|
|
51493
|
+
var args = _.toArray(arguments).slice(1);
|
|
51494
51494
|
originalFn.apply(console, args);
|
|
51495
51495
|
createConsoleEvent(args, methodName);
|
|
51496
51496
|
});
|
|
@@ -51502,10 +51502,10 @@ function ConsoleCapture() {
|
|
|
51502
51502
|
function securityPolicyViolationFn(evt) {
|
|
51503
51503
|
if (!evt || typeof evt !== 'object')
|
|
51504
51504
|
return;
|
|
51505
|
-
|
|
51506
|
-
|
|
51507
|
-
|
|
51508
|
-
|
|
51505
|
+
var blockedURI = evt.blockedURI, violatedDirective = evt.violatedDirective, effectiveDirective = evt.effectiveDirective, disposition = evt.disposition, originalPolicy = evt.originalPolicy;
|
|
51506
|
+
var directive = violatedDirective || effectiveDirective;
|
|
51507
|
+
var isReportOnly = disposition === 'report';
|
|
51508
|
+
var message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
|
|
51509
51509
|
if (isReportOnly) {
|
|
51510
51510
|
createConsoleEvent([message], 'warn', { skipStackTrace: true, skipScrubPII: true });
|
|
51511
51511
|
}
|
|
@@ -51513,12 +51513,13 @@ function ConsoleCapture() {
|
|
|
51513
51513
|
createConsoleEvent([message], 'error', { skipStackTrace: true, skipScrubPII: true });
|
|
51514
51514
|
}
|
|
51515
51515
|
}
|
|
51516
|
-
function createConsoleEvent(args, methodName,
|
|
51516
|
+
function createConsoleEvent(args, methodName, _a) {
|
|
51517
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.skipStackTrace, skipStackTrace = _c === void 0 ? false : _c, _d = _b.skipScrubPII, skipScrubPII = _d === void 0 ? false : _d;
|
|
51517
51518
|
if (!isCapturingConsoleLogs || !args || args.length === 0 || !_.contains(CONSOLE_METHODS, methodName))
|
|
51518
51519
|
return;
|
|
51519
51520
|
// stringify args
|
|
51520
|
-
|
|
51521
|
-
|
|
51521
|
+
var message = _.compact(_.map(args, function (arg) {
|
|
51522
|
+
var stringifiedArg;
|
|
51522
51523
|
try {
|
|
51523
51524
|
stringifiedArg = stringify(arg);
|
|
51524
51525
|
}
|
|
@@ -51530,22 +51531,22 @@ function ConsoleCapture() {
|
|
|
51530
51531
|
if (!message)
|
|
51531
51532
|
return;
|
|
51532
51533
|
// capture stack trace
|
|
51533
|
-
|
|
51534
|
+
var stackTrace = '';
|
|
51534
51535
|
if (!skipStackTrace) {
|
|
51535
|
-
|
|
51536
|
+
var maxStackFrames = methodName === 'error' ? 4 : 1;
|
|
51536
51537
|
stackTrace = captureStackTrace(maxStackFrames);
|
|
51537
51538
|
}
|
|
51538
51539
|
// truncate message and stack trace
|
|
51539
51540
|
message = truncate(message);
|
|
51540
51541
|
stackTrace = truncate(stackTrace);
|
|
51541
51542
|
// de-duplicate log
|
|
51542
|
-
|
|
51543
|
+
var logKey = generateLogKey(methodName, message, stackTrace);
|
|
51543
51544
|
if (isExistingDuplicateLog(logKey)) {
|
|
51544
51545
|
buffer.lastEvent.devLogCount++;
|
|
51545
51546
|
return;
|
|
51546
51547
|
}
|
|
51547
|
-
|
|
51548
|
-
|
|
51548
|
+
var devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
|
|
51549
|
+
var consoleEvent = __assign(__assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _: _ }), devLogTrace: stackTrace, devLogCount: 1 });
|
|
51549
51550
|
if (!buffer.hasTokenAvailable())
|
|
51550
51551
|
return consoleEvent;
|
|
51551
51552
|
if (!isPtmPaused) {
|
|
@@ -51557,8 +51558,8 @@ function ConsoleCapture() {
|
|
|
51557
51558
|
}
|
|
51558
51559
|
function captureStackTrace(maxStackFrames) {
|
|
51559
51560
|
try {
|
|
51560
|
-
|
|
51561
|
-
return _.map(stackFrames, frame
|
|
51561
|
+
var stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
|
|
51562
|
+
return _.map(stackFrames, function (frame) { return frame.toString(); }).join('\n');
|
|
51562
51563
|
}
|
|
51563
51564
|
catch (error) {
|
|
51564
51565
|
return '';
|
|
@@ -51570,21 +51571,22 @@ function ConsoleCapture() {
|
|
|
51570
51571
|
function updateLastLog(logKey) {
|
|
51571
51572
|
lastLogKey = logKey;
|
|
51572
51573
|
}
|
|
51573
|
-
function send(
|
|
51574
|
+
function send(_a) {
|
|
51575
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
|
|
51574
51576
|
if (!buffer || buffer.isEmpty())
|
|
51575
51577
|
return;
|
|
51576
51578
|
if (!globalPendo.isSendingEvents()) {
|
|
51577
51579
|
buffer.clear();
|
|
51578
51580
|
return;
|
|
51579
51581
|
}
|
|
51580
|
-
|
|
51582
|
+
var payloads = buffer.pack();
|
|
51581
51583
|
if (!payloads || payloads.length === 0)
|
|
51582
51584
|
return;
|
|
51583
51585
|
if (unload || hidden) {
|
|
51584
51586
|
sendQueue.drain(payloads, unload);
|
|
51585
51587
|
}
|
|
51586
51588
|
else {
|
|
51587
|
-
sendQueue.push(
|
|
51589
|
+
sendQueue.push.apply(sendQueue, payloads);
|
|
51588
51590
|
}
|
|
51589
51591
|
}
|
|
51590
51592
|
function teardown() {
|
|
@@ -51608,7 +51610,7 @@ function ConsoleCapture() {
|
|
|
51608
51610
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
51609
51611
|
if (!console[methodName])
|
|
51610
51612
|
return _.noop;
|
|
51611
|
-
|
|
51613
|
+
var unwrap = console[methodName]._pendoUnwrap;
|
|
51612
51614
|
if (_.isFunction(unwrap)) {
|
|
51613
51615
|
unwrap();
|
|
51614
51616
|
}
|