PageSourceSearch

https://assets.geeksforgeeks.org/gfg-assets/_next/static/chunks/3968.4456d19cd9934eb4.js

js geeksforgeeks.org collected 2026-09-24 07:59:32 UTC 16,709 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3968],{33968:function(a,b,c){c.r(b),c.d(b,{default:function(){return s}});var d=c(85893),e=c(11163),f=c(67294),g=c(45697),h=c.n(g);function i(){return(i=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])}return a}).apply(this,arguments)}function j(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}var k,l=function(a,b){return a(b={exports:{}},b.exports),b.exports}(function(a){!function(b){if("undefined"!=typeof window){var c,d=0,e=!1,f=!1,g=7,h="[iFrameSizer]",i=h.length,j=null,k=window.requestAnimationFrame,l={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},m={},n=null,o={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(){w("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},p={};window.jQuery&&(c=window.jQuery,c.fn?c.fn.iFrameResize||(c.fn.iFrameResize=function(a){function b(b,c){K(c,a)}return this.filter("iframe").each(b).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof b&&b.amd?b([],Q):a.exports=Q(),window.iFrameResize=window.iFrameResize||Q()}function q(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function r(a,b,c){a.addEventListener(b,c,!1)}function s(a,b,c){a.removeEventListener(b,c,!1)}function t(a){return m[a]?m[a].log:e}function u(a,b){x("log",a,b,t(a))}function v(a,b){x("info",a,b,t(a))}function w(a,b){x("warn",a,b,!0)}function x(a,b,c,d){if(!0===d&&"object"==typeof window.console){var e,f,g;console[a](h+"["+(g="Host page: "+(f=e=b),window.top!==window.self&&(g=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+f:"Nested host page: "+f),g)+"]",c)}}function y(a){function b(){c("Height"),c("Width"),H(function(){G(O),D(P),o("onResized",O)},O,"init")}function c(a){var b=Number(m[P]["max"+a]),c=Number(m[P]["min"+a]),d=a.toLowerCase(),e=Number(O[d]);u(P,"Checking "+d+" is in range "+c+"-"+b),e<c&&(e=c,u(P,"Set "+d+" to min value")),e>b&&(e=b,u(P,"Set "+d+" to max value")),O[d]=""+e}function d(a){return N.substr(N.indexOf(":")+g+a)}function e(a,b){M(function(){var c,d;I("Send Page Info","pageInfo:"+(c=document.body.getBoundingClientRect(),JSON.stringify({iframeHeight:(d=O.iframe.getBoundingClientRect()).height,iframeWidth:d.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(d.top-c.top,10),offsetLeft:parseInt(d.left-c.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),a,b)},32,b)}function f(a){var b=a.getBoundingClientRect();return C(P),{x:Math.floor(Number(b.left)+Number(j.x)),y:Math.floor(Number(b.top)+Number(j.y))}}function k(a){var b=a?f(O.iframe):{x:0,y:0},c={x:Number(O.width)+b.x,y:Number(O.height)+b.y};u(P,"Reposition requested from iFrame (offset x:"+b.x+" y:"+b.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(a?"Offset":"")](c.x,c.y):w(P,"Unable to scroll to requested position, window.parentIFrame not found"):(j=c,l(),u(P,"--"))}function l(){!1!==o("onScroll",j)?D(P):E()}function n(a){o(a,{iframe:O.iframe,screenX:O.width,screenY:O.height,type:O.type})}function o(a,b){return z(P,a,b)}var p,q,t,x,y,A,K,L,N=a.data,O={},P=null;"[iFrameResizerChild]Ready"===N?!function(){for(var a in m)I("iFrame requested init",J(a),m[a].iframe,a)}():h===(""+N).substr(0,i)&&N.substr(i).split(":")[0]in m?(P=(O=(q=(p=N.substr(i).split(":"))[1]?parseInt(p[1],10):0,t=m[p[0]]&&m[p[0]].iframe,x=getComputedStyle(t),{iframe:t,id:p[0],height:q+function a(b){if("border-box"!==b.boxSizing)return 0;var c=b.paddingTop?parseInt(b.paddingTop,10):0,d=b.paddingBottom?parseInt(b.paddingBottom,10):0;return c+d}(x)+function a(b){if("border-box"!==b.boxSizing)return 0;var c=b.borderTopWidth?parseInt(b.borderTopWidth,10):0,d=b.borderBottomWidth?parseInt(b.borderBottomWidth,10):0;return c+d}(x),width:p[2],type:p[3]})).id,m[P]&&(m[P].loaded=!0),y=O.type in{true:1,false:1,undefined:1},y&&u(P,"Ignoring init message from meta parent page"),!y&&(K=!0,m[A=P]||(K=!1,w(O.type+" No settings for "+A+". Message was: "+N)),K)&&(u(P,"Received: "+N),L=!0,null===O.iframe&&(w(P,"IFrame ("+O.id+") not found"),L=!1),L&&function(){var b,c=a.origin,d=m[P]&&m[P].checkOrigin;if(d&&""+c!="null"&&!(d.constructor===Array?function(){var a=0,b=!1;for(u(P,"Checking connection is from allowed list of origins: "+d);a<d.length;a++)if(d[a]===c){b=!0;break}return b}():(b=m[P]&&m[P].remoteHost,u(P,"Checking connection is from: "+b),c===b)))throw Error("Unexpected message received from: "+c+" for "+O.iframe.id+". Message was: "+a.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&!function(){var a,c,g,h,i,p;switch(m[P]&&m[P].firstRun&&m[P]&&(m[P].firstRun=!1),O.type){case"close"
1:B(O.iframe);break;case"message":a=d(6),u(P,"onMessage passed: {iframe: "+O.iframe.id+", message: "+a+"}"),o("onMessage",{iframe:O.iframe,message:JSON.parse(a)}),u(P,"--");break;case"mouseenter":n("onMouseEnter");break;case"mouseleave":n("onMouseLeave");break;case"autoResize":m[P].autoResize=JSON.parse(d(9));break;case"scrollTo":k(!1);break;case"scrollToOffset":k(!0);break;case"pageInfo":e(m[P]&&m[P].iframe,P),function(){function a(a,d){function f(){m[c]?e(m[c].iframe,c):b()}["scroll","resize"].forEach(function(b){u(c,a+b+" listener for sendPageInfo"),d(window,b,f)})}function b(){a("Remove ",s)}var c=P;a("Add ",r),m[c]&&(m[c].stopPageInfo=b)}();break;case"pageInfoStop":m[P]&&m[P].stopPageInfo&&(m[P].stopPageInfo(),delete m[P].stopPageInfo);break;case"inPageLink":c=d(9),h=c.split("#")[1]||"",i=decodeURIComponent(h),p=document.getElementById(i)||document.getElementsByName(i)[0],p?(g=f(p),u(P,"Moving to in page link (#"+h+") at x: "+g.x+" y: "+g.y),j={x:g.x,y:g.y},l(),u(P,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(h):u(P,"In page link #"+h+" not found and window.parentIFrame not found"):u(P,"In page link #"+h+" not found");break;case"reset":F(O);break;case"init":b(),o("onInit",O.iframe);break;default:b()}}())):v(P,"Ignored: "+N)}function z(a,b,c){var d=null,e=null;if(m[a]){if("function"==typeof(d=m[a][b]))e=d(c);else throw TypeError(b+" on iFrame["+a+"] is not a function")}return e}function A(a){delete m[a.id]}function B(a){var b=a.id;if(!1===z(b,"onClose",b)){u(b,"Close iframe cancelled by onClose event");return}u(b,"Removing iFrame: "+b);try{a.parentNode&&a.parentNode.removeChild(a)}catch(c){w(c)}z(b,"onClosed",b),u(b,"--"),A(a)}function C(a){null===j&&u(a,"Get page position: "+(j={x:window.pageXOffset!==b?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==b?window.pageYOffset:document.documentElement.scrollTop}).x+","+j.y)}function D(a){null!==j&&(window.scrollTo(j.x,j.y),u(a,"Set page position: "+j.x+","+j.y),E())}function E(){j=null}function F(a){u(a.id,"Size reset requested by "+("init"===a.type?"host page":"iFrame")),C(a.id),H(function(){G(a),I("reset","reset",a.iframe,a.id)},a,"reset")}function G(a){function b(b){var d;!function(b){if(!a.id){u("undefined","messageData id not set");return}a.iframe.style[b]=a[b]+"px",u(a.id,"IFrame ("+c+") "+b+" set to "+a[b]+"px")}(b),d=b,f||"0"!==a[d]||(f=!0,u(c,"Hidden iFrame detected, creating visibility listener"),N())}var c=a.iframe.id;m[c]&&(m[c].sizeHeight&&b("height"),m[c].sizeWidth&&b("width"))}function H(a,b,c){c!==b.type&&k&&!window.jasmine?(u(b.id,"Requesting animation frame"),k(a)):a()}function I(a,b,c,d,e){var f=!1;m[d=d||c.id]&&(!function(){if(c&&"contentWindow"in c&&null!==c.contentWindow){var e;e=m[d]&&m[d].targetOrigin,u(d,"["+a+"] Sending msg to iframe["+d+"] ("+b+") targetOrigin: "+e),c.contentWindow.postMessage(h+b,e)}else w(d,"["+a+"] IFrame("+d+") not found")}(),e&&m[d]&&m[d].warningTimeout&&(m[d].msgTimeout=setTimeout(function(){!m[d]||m[d].loaded||f||(f=!0,w(d,"IFrame has not responded within "+m[d].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."))},m[d].warningTimeout)))}function J(a){return a+":"+m[a].bodyMarginV1+":"+m[a].sizeWidth+":"+m[a].log+":"+m[a].interval+":"+m[a].enablePublicMethods+":"+m[a].autoResize+":"+m[a].bodyMargin+":"+m[a].heightCalculationMethod+":"+m[a].bodyBackground+":"+m[a].bodyPadding+":"+m[a].tolerance+":"+m[a].inPageLinks+":"+m[a].resizeFrom+":"+m[a].widthCalculationMethod}function K(a,c){function f(a){var b=a.split("Callback");if(2===b.length){var c="on"+b[0].charAt(0).toUpperCase()+b[0].slice(1);this[c]=this[a],delete this[a],w(j,"Deprecated: '"+a+"' has been renamed '"+c+"'. The old method will be removed in the next major version.")}}var g,h,i,j=function(b){if(""===b){var f;a.id=b=(f=c&&c.id||o.id+d++,null!==document.getElementById(f)&&(f+=d++),f),e=(c||{}).log,u(b,"Added missing iframe ID: "+b+" ("+a.src+")")}return b}(a.id);if(j in m&&"iFrameResizer"in a)w(j,"Ignored iFrame, already setup.");else{!function(b){if(b=b||{},m[j]={firstRun:!0,iframe:a,remoteHost:a.src&&a.src.split("/").slice(0,3).join("/")}
1,function(a){if("object"!=typeof a)throw TypeError("Options is not an object")}(b),Object.keys(b).forEach(f,b),function(a){for(var b in o)Object.prototype.hasOwnProperty.call(o,b)&&(m[j][b]=Object.prototype.hasOwnProperty.call(a,b)?a[b]:o[b])}(b),m[j]){var c;m[j].targetOrigin=!0===m[j].checkOrigin?""===(c=m[j].remoteHost)||null!==c.match(/^(about:blank|javascript:|file:\/\/)/)?"*":c:"*"}}(c),function(){switch(u(j,"IFrame scrolling "+(m[j]&&m[j].scrolling?"enabled":"disabled")+" for "+j),a.style.overflow=!1===(m[j]&&m[j].scrolling)?"hidden":"auto",m[j]&&m[j].scrolling){case"omit":break;case!0:a.scrolling="yes";break;case!1:a.scrolling="no";break;default:a.scrolling=m[j]?m[j].scrolling:"no"}}(),function(){function b(b){1/0!==m[j][b]&&0!==m[j][b]&&(a.style[b]=m[j][b]+"px",u(j,"Set "+b+" = "+m[j][b]+"px"))}function c(a){if(m[j]["min"+a]>m[j]["max"+a])throw Error("Value for min"+a+" can not be greater than max"+a)}c("Height"),c("Width"),b("maxHeight"),b("minHeight"),b("maxWidth"),b("minWidth")}(),("number"==typeof(m[j]&&m[j].bodyMargin)||"0"===(m[j]&&m[j].bodyMargin))&&(m[j].bodyMarginV1=m[j].bodyMargin,m[j].bodyMargin=""+m[j].bodyMargin+"px"),h=J(j),(i=q())&&(g=i,a.parentNode&&new g(function(b){b.forEach(function(b){Array.prototype.slice.call(b.removedNodes).forEach(function(b){b===a&&B(a)})})}).observe(a.parentNode,{childList:!0})),r(a,"load",function(){var c,d;I("iFrame.onload",h,a,b,!0),c=m[j]&&m[j].firstRun,d=m[j]&&m[j].heightCalculationMethod in l,!c&&d&&F({iframe:a,height:0,width:0,type:"init"})}),I("init",h,a,b,!0),m[j]&&(m[j].iframe.iFrameResizer={close:B.bind(null,m[j].iframe),removeListeners:A.bind(null,m[j].iframe),resize:I.bind(null,"Window resize","resize",m[j].iframe),moveToAnchor:function(a){I("Move to anchor","moveToAnchor:"+a,m[j].iframe,j)},sendMessage:function(a){I("Send Message","message:"+(a=JSON.stringify(a)),m[j].iframe,j)}})}}function L(a,b){null===n&&(n=setTimeout(function(){n=null,a()},b))}function M(a,b,c){p[c]||(p[c]=setTimeout(function(){p[c]=null,a()},b))}function N(){function a(){Object.keys(m).forEach(function(a){!function(a){var b;function c(b){return"0px"===(m[a]&&m[a].iframe.style[b])}m[a]&&null!==(b=m[a].iframe).offsetParent&&(c("height")||c("width"))&&I("Visibility change","resize",m[a].iframe,a)}(a)})}var b,c=q();c&&(b=document.querySelector("body"),new c(function b(c){u("window","Mutation observed: "+c[0].target+" "+c[0].type),L(a,16)}).observe(b,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}function O(){"hidden"!==document.visibilityState&&(u("document","Trigger event: Visiblity change"),L(function(){P("Tab Visable","resize")},16))}function P(a,b){Object.keys(m).forEach(function(c){var d;m[d=c]&&"parent"===m[d].resizeFrom&&m[d].autoResize&&!m[d].firstRun&&I(a,b,m[c].iframe,c)})}function Q(){var a;function c(b,c){c&&(!function(){if(c.tagName){if("IFRAME"!==c.tagName.toUpperCase())throw TypeError("Expected <IFRAME> tag, found <"+c.tagName+">")}else throw TypeError("Object is not a valid DOM element")}(),K(c,b),a.push(c))}return!function(){var a,b=["moz","webkit","o","ms"];for(a=0;a<b.length&&!k;a+=1)k=window[b[a]+"RequestAnimationFrame"];k?k=k.bind(window):u("setup","RequestAnimationFrame not supported")}(),r(window,"message",y),r(window,"resize",function(){var a;u("window","Trigger event: "+(a="resize")),L(function(){P("Window "+a,"resize")},16)}),r(document,"visibilitychange",O),r(document,"-webkit-visibilitychange",O),function(d,e){var f;switch(a=[],(f=d)&&f.enablePublicMethods&&w("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof e){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(e||"iframe"),c.bind(b,d));break;case"object":c(d,e);break;default:throw TypeError("Unexpected data type ("+typeof e+")")}return a}}}()}),m=function(){},n=function(a){var b,c=a.title,d=a.forwardRef,e=j(a,["title","forwardRef"]),g=(b=e,b.autoResize,b.bodyBackground,b.bodyMargin,b.bodyPadding,b.checkOrigin,b.inPageLinks,b.heightCalculationMethod,b.interval,b.log,b.maxHeight,b.maxWidth,b.minHeight,b.minWidth,b.resizeFrom,b.scrolling,b.sizeHeight,b.sizeWidth,b.warningTimeout,b.tolerance,b.widthCalculationMethod,b.onClosed,b.onInit,b.onMessage,b.onMouseEnter,b.onMouseLeave,b.onResized,j(b,["autoResize","bodyBackgroun
1d","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"])),h=(0,f.useRef)(null),k=function(){return m(!h.current,"[iframeSizerReact]["+(h&&h.current&&h.current.id)+"] Close event ignored, to remove the iframe update your React component"),!h.current};return(0,f.useEffect)(function(){var a=h.current;return l(i({},e,{onClose:k}),a),function(){return a.iFrameResizer&&a.iFrameResizer.removeListeners()}},[]),(0,f.useImperativeHandle)(d,function(){return{resize:function(){return h.current.iFrameResizer.resize()},moveToAnchor:function(a){return h.current.iFrameResizer.moveToAnchor(a)},sendMessage:function(a,b){h.current.iFrameResizer.sendMessage(a,b)}}}),f.createElement("iframe",i({title:c},g,{ref:h}))};n.defaultProps={title:"iframe"},n.propTypes={title:h().string};var o=n,p=c(43135),q=c(98967),r=function(a){var b=a.pathname,c=(0,f.useState)(!1),e=c[0],g=c[1],h=(0,q.Z)(),i=h.defaultTextColor,j=h.mode,k=p.Jx.GFG_SITE_URL.substr(0,[p.Jx.GFG_SITE_URL.length-1])+b,l="".concat(p.Jx.GFG_DISCUSS_URL).concat(a.id,"/").concat(encodeURIComponent(a.title),"/").concat("gfg","?rel=").concat(encodeURIComponent(k),"&mode=").concat(j),m=function(){g(!0)};return(0,f.useEffect)(function(){a.loadComments&&m(!0)},[a.loadComments]),(0,f.useEffect)(function(){return function(){g(!1)}},[b]),(0,d.jsxs)("section",{className:"video-wrapper",id:"comments",children:[!e&&(0,d.jsx)("div",{id:"loadComment",style:{textAlign:"center",cursor:"pointer"},children:(0,d.jsx)("button",{id:"comment",onClick:m,style:{height:"40px",width:"45%",marginRight:"0%",boxShadow:"0 2px 5px 0 rgba(0,0,0,0.4), 0 6px 20px 0 rgba(0,0,0,0)",borderColor:"#4cb96b",borderRadius:"4px",backgroundColor:"var(--gfg-grey-bg)",color:i,cursor:"pointer"},children:"Load Comments"})}),e&&(0,d.jsx)(o,{log:!p.n5,src:l,style:{width:"1px",minWidth:"100%",border:"none",minHeight:"150px"}})]})};function s(a){var b=a.videoData,c=(0,e.useRouter)();return(0,d.jsx)(f.Fragment,{children:(0,d.jsx)(r,{loadComments:!0,id:null==b?void 0:b.id,title:null==b?void 0:b.title,pathname:c.asPath})})}}}])

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.