PageSourceSearch

https://oris1.view-source.net/viewsource_k0m1/fa/js/common.min.260127v1.js

js view-source.net collected 2026-10-04 13:32:02 UTC 14,399 bytes, 1 lines download raw bytes

1class ErrorLogger{constructor(){this.config={logUrl:"https://l.view-source.net/app/log/",appId:5,token:"56386150720F82F5B0DCF78C5AD7B553"},this.init()}init(){window.addEventListener("error",this.handleGlobalError.bind(this)),window.addEventListener("unhandledrejection",this.handleUnhandledRejection.bind(this))}handleGlobalError(e){this.shouldIgnoreError(e.message,e.error,null)||this.logError({type:"javascript_error",message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,stack:e.error?.stack})}handleUnhandledRejection(e){this.shouldIgnoreError(e.reason?.message||e.reason,e.reason,null)||this.logError({type:"promise_rejection",message:e.reason?.message||e.reason,stack:e.reason?.stack})}shouldIgnoreError(e,t=null,o=null){if(401===o||403===o||0===o)return!0;if(t&&t.name){if(["AbortError","NetworkError","ResizeObserver loop limit exceeded"].includes(t.name))return!0}return["Failed to load resource","ResizeObserver loop limit exceeded","Loading chunk","Script error"].some(t=>e.includes(t))}logApiError(e,t,o="GET",n={}){this.logError({type:"api_error",message:e.message,apiUrl:t,method:o,code:e.code||e.status,stack:e.stack,...n})}logUserError(e,t={}){this.logError({type:"user_error",message:e,context:t})}logError(e){try{const t=this.filterSensitiveData(e),o=JSON.stringify({url:window.location.href,timestamp:(new Date).toISOString(),details:{...t,page:t.filename||window.location.href,line:t.lineno,column:t.colno,userId:this.getUserId(),sessionId:this.getSessionId()}}),n=new URLSearchParams({appId:this.config.appId,token:this.config.token,type:"1",url:window.location.href,content:o,_t:Date.now(),_r:Math.random().toString(36).substr(2,9)}),i=this.config.logUrl+"?"+n.toString(),s=new Image;s.src=i,s.onerror=()=>{}}catch(e){}}filterSensitiveData(e){const t=["token","password","authorization","cookie"],o={...e},n=e=>{if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return e.map(n);const o={};for(const i in e){const s=i.toLowerCase();t.some(e=>s.includes(e))?o[i]="[FILTERED]":"object"==typeof e[i]?o[i]=n(e[i]):o[i]=e[i]}return o};return n(o)}getUserId(){try{const e=localStorage.getItem("user_info");if(e){return JSON.parse(e).id||"anonymous"}}catch(e){}return"anonymous"}getSessionId(){let e=sessionStorage.getItem("error_logger_session_id");return e||(e="session_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),sessionStorage.setItem("error_logger_session_id",e)),e}}class ApiError extends Error{constructor(e,t=null,o=null){super(e),this.name="ApiError",this.code=t,this.response=o}}class ApiClient{constructor(){this.baseURL=("undefined"!=typeof __API_BASE_URL__?__API_BASE_URL__:null)||this.getDefaultBaseUrl(),this.token=this.getToken(),this.errorLogger=new ErrorLogger}getDefaultBaseUrl(){const e=window.location.hostname;return`${window.location.protocol}//${e}`}getToken(){try{let e=localStorage.getItem("user_token");return e||(e=this.getCookie("token"),e&&localStorage.setItem("user_token",e)),e||null}catch(e){return this.getCookie("token")||null}}getPageLang(){try{const e=document.documentElement.lang;if(e)return e.toLowerCase();const t=document.body?.getAttribute("lang");if(t)return t.toLowerCase();const o=window.location.pathname.match(/^\/([a-z]{2}(-[a-z]{2})?)\//);return o?o[1].toLowerCase():null}catch(e){return null}}getCookie(e){const t=`; ${document.cookie}`.split(`; ${e}=`);return 2===t.length?t.pop().split(";").shift():null}setCookie(e,t,o=30){const n=new Date;n.setTime(n.getTime()+24*o*60*60*1e3),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`}deleteCookie(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/`}setToken(e){try{e?(localStorage.setItem("user_token",e),this.token=e):(localStorage.removeItem("user_token"),this.token=null)}catch(e){}}getHeaders(e={}){const t={"Content-Type":"application/json",...e};return this.token&&(t.token=this.token),t}async request(e,t={}){const{method:o="GET",data:n=null,headers:i={},isFormData:s=!1}=t,a=this.getHeaders(i);s&&delete a["Content-Type"];const r={method:o,headers:a};n&&(s?r.body=n:"GET"!==o&&(r.body=JSON.stringify(n)));try{const t=await fetch(this.baseURL+e,r);if(401===t.status)return this.handleUnauthorized(),{code:401,msg:"Please login first or login expired",data:null,isUnauthorized:!0};if(!t.ok)throw new ApiError(`HTTP error! [rp01];status: ${t.status}`,t.status,t);const o=await t.json();if(401===o.code)return this.handleUnauthorized(),{code:401,msg:o.msg||"Please login first or login expired",data:null,isUnauthorized:!0};if(String(o.code).startsWith("5"))throw new ApiError(o.msg||"Server internal error",o.code,o);return o}catch(t){throw t instanceof ApiError&&this.errorLogger.logApiError(t,e,o,{baseURL:this.baseURL,hasToken:!!this.token}),t}}async get(e,t={}){const o=this.getPageLang();o&&!t.lang&&(t.lang=o);const n=new URLSearchParams(t).toString(),i=n?`${e}?${n}`:e;return this.request(i)}async post(e,t={}){const o=this.getPageLang();return o&&!t.lang&&(t.lang=o),this.request(e,{method:"POST",data:t})}async put(e,t={}){const o=this.getPageLang();return o&&!t.lang&&(t.lang=o),this.request(e,{method:"PUT",data:t})}async delete(e,t={}){const o=this.getPageLang();o&&!t.lang&&(t.lang=o);const n=new URLSearchParams(t).toString(),i=n?`${e}?${n}`:e;return this.request(i,{method:"DELETE"})}async upload(e,t){return this.request(e,{method:"POST",data:t,is
1FormData:!0})}}class CommonManager{constructor(){this.authModal=null,this.cookieConsent=null,this.isLoadingAuthModal=!1}init(){this.initMobileMenu(),this.initDropdownMenus(),this.initCookieConsent(),this.initLanguageSelector()}initMobileMenu(){const e=document.getElementById("mobile-menu-btn"),t=document.getElementById("mobile-menu");e&&t&&e.addEventListener("click",function(){t.classList.toggle("hidden")});const o=document.querySelectorAll(".mobile-dropdown-btn");o.forEach(function(e){e.addEventListener("click",function(){const t=e.parentElement,n=t?t.querySelector(".mobile-dropdown-content"):null,i=e.querySelector("svg");n&&n.classList.toggle("hidden"),i&&i.classList.toggle("rotate-180"),o.forEach(function(t){if(t!==e){const e=t.parentElement,o=e?e.querySelector(".mobile-dropdown-content"):null,n=t.querySelector("svg");o&&o.classList.add("hidden"),n&&n.classList.remove("rotate-180")}})})});document.querySelectorAll(".mobile-group-btn").forEach(function(e){e.addEventListener("click",function(t){t.stopPropagation();const o=e.getAttribute("data-target"),n=document.getElementById(o),i=e.querySelector("svg");n&&n.classList.toggle("hidden"),i&&i.classList.toggle("rotate-180");const s=e.closest(".mobile-grouped-menu");if(s){s.querySelectorAll(".mobile-group-btn").forEach(function(t){if(t!==e){const e=t.getAttribute("data-target"),o=document.getElementById(e),n=t.querySelector("svg");o&&o.classList.add("hidden"),n&&n.classList.remove("rotate-180")}})}})})}initDropdownMenus(){if("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0){const e=document.querySelectorAll(".dropdown-container");e.forEach((t,o)=>{const n=t.querySelector(".dropdown-button"),i=t.querySelector(".dropdown-menu");n&&i&&n.addEventListener("click",function(o){o.preventDefault(),o.stopPropagation();const n=t.classList.contains("touch-active");e.forEach(e=>{e!==t&&e.classList.remove("touch-active")}),n?t.classList.remove("touch-active"):(t.classList.add("touch-active"),this.adjustDropdownPosition(t,i))}.bind(this))}),document.addEventListener("click",function(t){t.target.closest(".dropdown-container")||e.forEach(e=>{e.classList.remove("touch-active")})})}}adjustDropdownPosition(e,t){const o=e.getBoundingClientRect(),n=window.innerWidth,i=t.style.display,s=t.style.visibility,a=t.style.opacity;t.style.display="block",t.style.visibility="visible",t.style.opacity="0",t.style.left="",t.style.right="",t.style.transform="";const r=t.offsetWidth;t.style.display=i,t.style.visibility=s,t.style.opacity=a;let c=o.left;r<n-20&&(c=o.left+o.width/2-r/2),c<10&&(c=10);c+r>n-10&&(c=n-r-10),c<10&&(c=10),t.style.position="fixed",t.style.left=c+"px",t.style.top=o.bottom+5+"px",t.style.transform="translateX(0)",t.style.right="auto"}initCookieConsent(){return this.sessionCookieConsent="all",void this.initAnalytics()}createCookieConsentBanner(){const e=document.createElement("div");e.id="cookie-consent-banner",e.className="cookie-consent-banner",e.innerHTML='\n      <div class="cookie-consent-content">\n        <div class="cookie-consent-text">\n          <h3 class="cookie-consent-title">We use cookies</h3>\n          <p class="cookie-consent-description">\n            We use essential cookies for sign-in, security and core features. If you allow, we’ll also use anonymous, aggregated analytics to quickly fix issues and build improvements you’ll actually use. You can change this choice anytime.\n          </p>\n        </div>\n        <div class="cookie-consent-actions">\n          <button id="cookie-accept-all" class="cookie-btn cookie-btn-accept">\n            Accept All Cookies\n          </button>\n          <button id="cookie-accept-necessary" class="cookie-btn cookie-btn-necessary">\n            Reject Non-Essential Cookies\n          </button>\n          <a href="/privacy-policy#cookies" class="cookie-policy-link">Cookie Policy</a>\n        </div>\n      </div>\n    ',document.body.appendChild(e),this.bindCookieEvents(e)}bindCookieEvents(e){const t=e.querySelector("#cookie-accept-all"),o=e.querySelector("#cookie-accept-necessary");t.addEventListener("click",()=>{this.acceptAllCookies(),this.hideCookieBanner(e)}),o.addEventListener("click",()=>
1{this.acceptNecessaryCookies(),this.hideCookieBanner(e)})}acceptAllCookies(){this.setCookie("cookie_consent","all",365),this.setCookie("analytics_consent","true",365),this.initAnalytics()}acceptNecessaryCookies(){this.setCookie("cookie_consent","necessary",365),this.setCookie("analytics_consent","false",365),this.disableAnalytics(),this.cleanupNonEssentialCookies()}hideCookieBanner(e){e.classList.add("cookie-consent-hidden"),setTimeout(()=>{e.remove()},300)}initAnalytics(){"undefined"!=typeof gtag?(gtag("consent","update",{analytics_storage:"granted",ad_storage:"granted"}),gtag("config","GA_MEASUREMENT_ID",{anonymize_ip:!0,respect_dnt:!0})):this.loadGoogleAnalytics(),this.initOtherTrackingTools()}loadGoogleAnalytics(){}initOtherTrackingTools(){window.analyticsManager&&window.analyticsManager.initClarityConditional()}disableAnalytics(){"undefined"!=typeof gtag&&gtag("consent","update",{analytics_storage:"denied",ad_storage:"denied"}),void 0!==window.clarity&&(window.clarity=function(){}),void 0!==window._paq&&window._paq.push(["optUserOut"])}setCookie(e,t,o){const n=new Date(Date.now()+864e5*o).toUTCString();document.cookie=`${e}=${t}; expires=${n}; path=/; SameSite=Lax`}getCookie(e){return document.cookie.split("; ").find(t=>t.startsWith(e+"="))?.split("=")[1]}deleteCookie(e){this.setCookie(e,"",-1)}isAnalyticsAllowed(){return!("true"!==this.getCookie("analytics_consent"))||"all"===this.sessionCookieConsent}cleanupNonEssentialCookies(){["_ga","_ga_","_gid","_gat","__utma","__utmb","__utmc","__utmt","__utmz","_clck","_clsk","CLID","ANONCHK","MR","MUID","SM"].forEach(e=>{this.deleteCookie(e);const t=window.location.hostname.replace(/^www\./,"");document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=.${t};`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${t};`}),this.disableTrackingAPIs()}disableTrackingAPIs(){window.clarity=function(){}}getCookieConsentStatus(){const e=this.getCookie("cookie_consent"),t="true"===this.getCookie("analytics_consent");return{consent:e||this.sessionCookieConsent||null,analytics:t||"all"===this.sessionCookieConsent,hasConsent:!(!e&&!this.sessionCookieConsent),isSessionOnly:!e&&!!this.sessionCookieConsent}}
1resetCookieConsent(){this.deleteCookie("cookie_consent"),this.deleteCookie("analytics_consent"),this.sessionCookieConsent=null,this.cleanupNonEssentialCookies(),location.reload()}updateCookiePreferences(e=!1){e?this.acceptAllCookies():this.acceptNecessaryCookies()}initLanguageSelector(){const e=document.getElementById("languageBtn"),t=e?e.closest(".language-selector"):null;e&&t&&(e.addEventListener("click",e=>{e.stopPropagation(),t.classList.toggle("active")}),document.addEventListener("click",e=>{t.contains(e.target)||t.classList.remove("active")}),window.matchMedia("(hover: hover)").matches&&(t.addEventListener("mouseenter",()=>{t.classList.add("active")}),t.addEventListener("mouseleave",()=>{t.classList.remove("active")})))}}window.apiClient=new ApiClient,window.commonManager=new CommonManager;class AnalyticsManager{constructor(){this.matomoInitialized=!1,this.clarityInitialized=!1}init(){this.initMatomo(),this.initClarityConditional()}initMatomo(){if(!this.matomoInitialized)try{var e=window._paq=window._paq||[];e.push(["trackPageView"]),e.push(["enableLinkTracking"]),function(){var t="https://l.view-source.net/";e.push(["setTrackerUrl",t+"m.php"]),e.push(["setSiteId","8"]);var o=document,n=o.createElement("script"),i=o.getElementsByTagName("script")[0];n.async=!0,n.src=t+"m.js",i.parentNode.insertBefore(n,i)}(),this.matomoInitialized=!0}catch(e){}}initClarityConditional(){if(!this.clarityInitialized)try{const e=()=>{var e,t,o,n,i,s;if(!this.clarityInitialized)try{e=window,t=document,n="script",e[o="clarity"]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},(i=t.createElement(n)).async=1,i.src="https://www.clarity.ms/tag/t8eg5x1fin",(s=t.getElementsByTagName(n)[0]).parentNode.insertBefore(i,s),this.clarityInitialized=!0}catch(e){}};(e=>{document.cookie.split("; ").find(t=>t.startsWith(e+"="))?.split("=")[1]})("analytics_consent");e(),window.loadClarity=e}catch(e){}}trackPageView(e=null){window._paq&&(e&&_paq.push(["setCustomUrl",e]),_paq.push(["trackPageView"]))}trackEvent(e,t,o=null,n=null){window._paq&&_paq.push(["trackEvent",e,t,o,n]),window.clarity&&this.clarityInitialized&&window.clarity("event",t)}setUserId(e){window._paq&&_paq.push(["setUserId",e]),window.clarity&&this.clarityInitialized&&window.clarity("identify",e)}resetUser(){window._paq&&_paq.push(["resetUserId"])}}window.analyticsManager=new AnalyticsManager,document.addEventListener("DOMContentLoaded",function(){window.commonManager.init(),window.analyticsManager.init()}),"undefined"!=typeof module&&module.exports&&(module.exports={CommonManager:CommonManager,ApiClient:ApiClient,AnalyticsManager:AnalyticsManager});

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.