@deriv-com/custom-scripts 1.21.6 → 1.22.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.
@@ -0,0 +1,8 @@
1
+ var e,n,i=Object.getOwnPropertyNames,t=(e={"js/trading_central_scripts.min.js"(e,n){
2
+ /*! iFrame Resizer (iframeSizer.min.js ) - v4.2.10 - 2020-02-04
3
+ * Desc: Force cross domain iframes to size to content.
4
+ * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
5
+ * Copyright: (c) 2020 David J. Bradshaw - dave@bradshaw.net
6
+ * License: MIT
7
+ */
8
+ !function(e){if("undefined"!=typeof window){var i,t=0,o=!1,r=!1,a=7,s="[iFrameSizer]",d=s.length,c=null,u=window.requestAnimationFrame,f={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},l={},m=null,g={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){M("onMessage function not defined")},onResized:function(){},onScroll:function(){return!0}},h={};window.jQuery&&((i=window.jQuery).fn?i.fn.iFrameResize||(i.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,i){H(i,e)})).end()}):x("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof define&&define.amd?define([],L):"object"==typeof n&&"object"==typeof n.exports&&(n.exports=L()),window.iFrameResize=window.iFrameResize||L()}function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,i){e.addEventListener(n,i,!1)}function b(e,n,i){e.removeEventListener(n,i,!1)}function y(e){return l[e]?l[e].log:o}function v(e,n){k(0,0,0,y(e))}function x(e,n){k(0,0,0,y(e))}function M(e,n){k(0,0,0,!0)}function k(e,n,i,t){!0===t&&window.console}function z(e){function n(){i("Height"),i("Width"),N((function(){C(L),T(q),m("onResized",L)}),L,"init")}function i(e){var n=Number(l[q]["max"+e]),i=Number(l[q]["min"+e]),t=e.toLowerCase(),o=Number(L[t]);v(q,"Checking "+t+" is in range "+i+"-"+n),o<i&&(o=i,v(q,"Set "+t+" to min value")),n<o&&(o=n,v(q,"Set "+t+" to max value")),L[t]=""+o}function t(e){return B.substr(B.indexOf(":")+a+e)}function o(e,n){var i;h[i=n]||(h[i]=setTimeout((function(){h[i]=null,S("Send Page Info","pageInfo:"+function(){var e=document.body.getBoundingClientRect(),n=L.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),e,n)}),32))}function r(e){var n=e.getBoundingClientRect();return R(q),{x:Math.floor(Number(n.left)+Number(c.x)),y:Math.floor(Number(n.top)+Number(c.y))}}function u(e){var n=e?r(L.iframe):{x:0,y:0},i={x:Number(L.width)+n.x,y:Number(L.height)+n.y};v(q,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):M(q,"Unable to scroll to requested position, window.parentIFrame not found"):(c=i,f(),v(q,"--"))}function f(){!1!==m("onScroll",c)?T(q):E()}function m(e,n){return I(q,e,n)}var g,p,y,k,z,F,H,P,A,B=e.data,L={},q=null;"[iFrameResizerChild]Ready"===B?function(){for(var e in l)S("iFrame requested init",j(e),l[e].iframe,e)}():s===(""+B).substr(0,d)&&B.substr(d).split(":")[0]in l?(F=(z=B.substr(d).split(":"))[1]?parseInt(z[1],10):0,H=l[z[0]]&&l[z[0]].iframe,P=getComputedStyle(H),L={iframe:H,id:z[0],height:F+(A=P,"border-box"!==A.boxSizing?0:(A.paddingTop?parseInt(A.paddingTop,10):0)+(A.paddingBottom?parseInt(A.paddingBottom,10):0))+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(P),width:z[2],type:z[3]},q=L.id,l[q]&&(l[q].loaded=!0),(k=L.type in{true:1,false:1,undefined:1})&&v(q,"Ignoring init message from meta parent page"),!k&&(y=!0,l[p=q]||(y=!1,M(L.type+" No settings for "+p+". Message was: "+B)),y)&&(v(q,"Received: "+B),g=!0,null===L.iframe&&(M(q,"IFrame ("+L.id+") not found"),g=!1),g&&function(){var n,i=e.origin,t=l[q]&&l[q].checkOrigin;if(t&&""+i!="null"&&!(t.constructor===Array?function(){var e=0,n=!1;for(v(q,"Checking connection is from allowed list of origins: "+t);e<t.length;e++)if(t[e]===i){n=!0;break}return n}():(n=l[q]&&l[q].remoteHost,v(q,"Checking connection is from: "+n),i===n)))throw new Error("Unexpected message received from: "+i+" for "+L.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(l[q]&&l[q].firstRun&&l[q]&&(l[q].firstRun=!1),L.type){case"close":O(L.iframe);break;case"message":!function(e){v(q,"onMessage passed: {iframe: "+L.iframe.id+", message: "+e+"}"),m("onMessage",{iframe:L.iframe,message:JSON.parse(e)}),v(q,"--")}(t(6));break;case"autoResize":l[q].autoResize=JSON.parse(t(9));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"pageInfo":o(l[q]&&l[q].iframe,q),function(){function e(e,t){function r(){l[i]?o(l[i].iframe,i):n()}["scroll","resize"].forEach((function(n){v(i,e+n+" listener for sendPageInfo"),t(window,n,r)}))}function n(){e("Remove ",b)}var i=q;e("Add ",w),l[i]&&(l[i].stopPageInfo=n)}();break;case"pageInfoStop":l[q]&&l[q].stopPageInfo&&(l[q].stopPageInfo(),delete l[q].stopPageInfo);break;case"inPageLink":!function(e){var n,i=e.split("#")[1]||"",t=decodeURIComponent(i),o=document.getElementById(t)||document.getElementsByName(t)[0];o?(n=r(o),v(q,"Moving to in page link (#"+i+") at x: "+n.x+" y: "+n.y),c={x:n.x,y:n.y},f(),v(q,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(i):v(q,"In page link #"+i+" not found and window.parentIFrame not found"):v(q,"In page link #"+i+" not found")}(t(9));break;case"reset":W(L);break;case"init":n(),m("onInit",L.iframe);break;default:n()}}())):x(q,"Ignored: "+B)}function I(e,n,i){var t=null,o=null;if(l[e]){if("function"!=typeof(t=l[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function F(e){var n=e.id;delete l[n]}function O(e){var n=e.id;if(!1!==I(n,"onClose",n)){v(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(i){M(i)}I(n,"onClosed",n),v(n,"--"),F(e)}else v(n,"Close iframe cancelled by onClose event")}function R(n){null===c&&v(n,"Get page position: "+(c={x:window.pageXOffset!==e?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==e?window.pageYOffset:document.documentElement.scrollTop}).x+","+c.y)}function T(e){null!==c&&(window.scrollTo(c.x,c.y),v(e,"Set page position: "+c.x+","+c.y),E())}function E(){c=null}function W(e){v(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),R(e.id),N((function(){C(e),S("reset","reset",e.iframe,e.id)}),e,"reset")}function C(e){function n(n){var t;t=n,e.id?(e.iframe.style[t]=e[t]+"px",v(e.id,"IFrame ("+i+") "+t+" set to "+e[t]+"px")):v("undefined","messageData id not set"),function(n){r||"0"!==e[n]||(r=!0,v(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(l).forEach((function(e){!function(e){function n(n){return"0px"===(l[e]&&l[e].iframe.style[n])}l[e]&&null!==l[e].iframe.offsetParent&&(n("height")||n("width"))&&S("Visibility change","resize",l[e].iframe,e)}(e)}))}function n(n){v("window","Mutation observed: "+n[0].target+" "+n[0].type),P(e,16)}var i,t=p();t&&(i=document.querySelector("body"),new t(n).observe(i,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}(n)}var i=e.iframe.id;l[i]&&(l[i].sizeHeight&&n("height"),l[i].sizeWidth&&n("width"))}function N(e,n,i){i!==n.type&&u&&!window.jasmine?(v(n.id,"Requesting animation frame"),u(e)):e()}function S(e,n,i,t,o){var r,a=!1;t=t||i.id,l[t]&&(i&&"contentWindow"in i&&null!==i.contentWindow?(r=l[t]&&l[t].targetOrigin,v(t,"["+e+"] Sending msg to iframe["+t+"] ("+n+") targetOrigin: "+r),i.contentWindow.postMessage(s+n,r)):M(t,"["+e+"] IFrame("+t+") not found"),o&&l[t]&&l[t].warningTimeout&&(l[t].msgTimeout=setTimeout((function(){!l[t]||l[t].loaded||a||(a=!0,M(t,"IFrame has not responded within "+l[t].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),l[t].warningTimeout)))}function j(e){return e+":"+l[e].bodyMarginV1+":"+l[e].sizeWidth+":"+l[e].log+":"+l[e].interval+":"+l[e].enablePublicMethods+":"+l[e].autoResize+":"+l[e].bodyMargin+":"+l[e].heightCalculationMethod+":"+l[e].bodyBackground+":"+l[e].bodyPadding+":"+l[e].tolerance+":"+l[e].inPageLinks+":"+l[e].resizeFrom+":"+l[e].widthCalculationMethod}function H(n,i){var r,a,s,d,c,u,m,h=(""===(a=n.id)&&(n.id=(r=i&&i.id||g.id+t++,null!==document.getElementById(r)&&(r+=t++),a=r),o=(i||{}).log,v(a,"Added missing iframe ID: "+a+" ("+n.src+")")),a);function b(e){1/0!==l[h][e]&&0!==l[h][e]&&(n.style[e]=l[h][e]+"px",v(h,"Set "+e+" = "+l[h][e]+"px"))}function y(e){if(l[h]["min"+e]>l[h]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}h in l&&"iFrameResizer"in n?M(h,"Ignored iFrame, already setup."):(u=(u=i)||{},l[h]={firstRun:!0,iframe:n,remoteHost:n.src&&n.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(u),Object.keys(u).forEach((function(e){var n=e.split("Callback");if(2===n.length){var i="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[i]=this[e],delete this[e],M(h,"Deprecated: '"+e+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}),u),function(e){for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&(l[h][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:g[n])}(u),l[h]&&(l[h].targetOrigin=!0===l[h].checkOrigin?""===(m=l[h].remoteHost)||null!==m.match(/^(about:blank|javascript:|file:\/\/)/)?"*":m:"*"),function(){switch(v(h,"IFrame scrolling "+(l[h]&&l[h].scrolling?"enabled":"disabled")+" for "+h),n.style.overflow=!1===(l[h]&&l[h].scrolling)?"hidden":"auto",l[h]&&l[h].scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=l[h]?l[h].scrolling:"no"}}(),y("Height"),y("Width"),b("maxHeight"),b("minHeight"),b("maxWidth"),b("minWidth"),"number"!=typeof(l[h]&&l[h].bodyMargin)&&"0"!==(l[h]&&l[h].bodyMargin)||(l[h].bodyMarginV1=l[h].bodyMargin,l[h].bodyMargin=l[h].bodyMargin+"px"),s=j(h),(c=p())&&(d=c,n.parentNode&&new d((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===n&&O(n)}))}))})).observe(n.parentNode,{childList:!0})),w(n,"load",(function(){S("iFrame.onload",s,n,e,!0),function(){var e=l[h]&&l[h].firstRun,i=l[h]&&l[h].heightCalculationMethod in f;!e&&i&&W({iframe:n,height:0,width:0,type:"init"})}()})),S("init",s,n,e,!0),l[h]&&(l[h].iframe.iFrameResizer={close:O.bind(null,l[h].iframe),removeListeners:F.bind(null,l[h].iframe),resize:S.bind(null,"Window resize","resize",l[h].iframe),moveToAnchor:function(e){S("Move to anchor","moveToAnchor:"+e,l[h].iframe,h)},sendMessage:function(e){S("Send Message","message:"+(e=JSON.stringify(e)),l[h].iframe,h)}}))}function P(e,n){null===m&&(m=setTimeout((function(){m=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visiblity change"),P((function(){B("Tab Visable","resize")}),16))}function B(e,n){Object.keys(l).forEach((function(i){var t;!l[t=i]||"parent"!==l[t].resizeFrom||!l[t].autoResize||l[t].firstRun||S(e,n,l[i].iframe,i)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),H(n,e),i.push(n))}var i;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!u;e+=1)u=window[n[e]+"RequestAnimationFrame"];u?u=u.bind(window):v("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){var e;v("window","Trigger event: "+(e="resize")),P((function(){B("Window "+e,"resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(t,o){switch(i=[],(r=t)&&r.enablePublicMethods&&M("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,t));break;case"object":n(t,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}var r;return i}}}()}},function(){return n||(0,e[i(e)[0]])((n={exports:{}}).exports,n),n.exports});export default t();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deriv-com/custom-scripts",
3
- "version": "1.21.6",
3
+ "version": "1.22.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"