1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5490],{15490:(a,e,n)=>{n.r(e),n.d(e,{default:()=>y});var t=n(95155),r=n(12115),i=n(15469),l=n(2108),o=n(71830),s=n(21873),u=n(87531),c=n(5190);let h=c.GY,p=Object.entries({Abbottabad:"kpk-hazara",Astore:"gb",Attock:"punjab-north",Awaran:"balochistan","Azad Kashmir":"ajk",Badin:"sindh",Bahawalnagar:"punjab-south",Bahawalpur:"punjab-south",Bajaur:"kpk-central",Bannu:"kpk-south",Barkhan:"balochistan",Battagram:"kpk-hazara",Bhakkar:"punjab-central",Buner:"kpk-north",Chagai:"balochistan",Chakwal:"punjab-north",Charsadda:"kpk-central",Chitral:"kpk-north",Dadu:"sindh","Dera Bugti":"balochistan","Dera Ghazi Khan":"punjab-south","Dera Ismail Khan":"kpk-south",Diamer:"gb",Faisalabad:"punjab-central",Ghanche:"gb",Ghizer:"gb",Ghotki:"sindh",Gilgit:"gb",Gujranwala:"punjab-north",Gujrat:"punjab-north",Gwadar:"balochistan",Hafizabad:"punjab-north",Hangu:"kpk-central",Haripur:"kpk-hazara",Hunza:"gb",Hyderabad:"sindh","Islamabad Capital Territory":"islamabad",Jacobabad:"sindh",Jafarabad:"balochistan",Jamshoro:"sindh","Jhal Magsi":"balochistan",Jhang:"punjab-central",Jhelum:"punjab-north",Kachhi:"balochistan",Kalat:"balochistan",Karachi:"karachi",Karak:"kpk-central",Kashmore:"sindh",Kasur:"punjab-central",Kech:"balochistan",Khairpur:"sindh",Khanewal:"punjab-south",Kharan:"balochistan",Kharmang:"gb",Khushab:"punjab-central",Khuzdar:"balochistan",Khyber:"kpk-central",Kohat:"kpk-central",Kohistan:"kpk-hazara",Kohlu:"balochistan",Kurram:"kpk-central",Lahore:"lahore","Lakki Marwat":"kpk-south",Lasbela:"balochistan",Layyah:"punjab-south",Lodhran:"punjab-south",Loralai:"balochistan","Lower Dir":"kpk-north",Malakand:"kpk-north","Mandi Bahauddin":"punjab-north",Mansehra:"kpk-hazara",Mardan:"kpk-central",Mastung:"balochistan",Matiari:"sindh",Mianwali:"punjab-central",Mirpurkhas:"sindh",Mohmand:"kpk-central",Multan:"punjab-south",Musakhel:"balochistan",Muzaffargarh:"punjab-south",Nagar:"gb",Narowal:"punjab-north",Nasirabad:"balochistan","Naushehro Feroze":"sindh",Nawabshah:"sindh","North Waziristan":"kpk-south",Nowshera:"kpk-central",Nushki:"balochistan",Okara:"punjab-central",Orakzai:"kpk-central",Pakpattan:"punjab-central",Panjgur:"balochistan",Peshawar:"kpk-central",Pishin:"balochistan","Qambar Shahdadkot":"sindh","Qilla Abdullah":"balochistan","Qilla Saifullah":"balochistan",Quetta:"balochistan","Rahim Yar Khan":"punjab-south",Rajanpur:"punjab-south",Rawalpindi:"punjab-north",Sahiwal:"punjab-central",Sanghar:"sindh",Sargodha:"punjab-central",Shangla:"kpk-north",Sheikhpura:"punjab-north",Shigar:"gb",Shikarpur:"sindh",Sialkot:"punjab-north",Sibi:"balochistan",Skardu:"gb","South Waziristan":"kpk-south",Sukkur:"sindh",Swabi:"kpk-central",Swat:"kpk-north","Tando Allahyar":"sindh","Tando Muhammad Khan":"sindh",Tank:"kpk-south",Tharparkar:"sindh",Thatta:"sindh","Toba Tek Singh":"punjab-central",Umerkot:"sindh","Upper Dir":"kpk-north",Vihari:"punjab-south",Zhob:"balochistan",Ziarat:"balochistan"}).reduce((a,e)=>{let[n,t]=e;return a[n.toLowerCase()]=t,a},{});var d=n(22619),k=n(71781),b=n(44726),m=n.n(b);function f(a){return a.map(a=>{let[e,n]=a;return[e,n]})}let g=[800,900];function v(a,e,n,t,r){var l;let o,s=a.getScreenCTM();if(!s)return;let u=a.createSVGPoint();u.x=e,u.y=n;let c=u.matrixTransform(s.inverse()),h=null==(l=r.invert)?void 0:l.call(r,[c.x,c.y]);if(!h||!Number.isFinite(h[0])||!Number.isFinite(h[1]))return;let[p,d]=h;if(!(p<60)&&!(p>81)&&!(d<23)&&!(d>38)){for(let a of t)if(!a.isBackgroundClaim&&(0,i.A)(a.feature,h)){o=a;break}if(!o){for(let a of t)if(a.isBackgroundClaim&&(0,i.A)(a.feature,h)){o=a;break}}return o}}function j(a,e,n){let t=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!a)return n?"ÙØ§Ù
عÙÙÙ
":"Unknown";if(t&&"ajk"===a)return n?"Ú©Ø´Ù
ÛØ± Ù Ú¯Ùگت":"Kashmir & Gilgit";let r=e[a];return r?r[n?"ur":"en"]:a}function y(a){var e,n,i,b,y,w,x,C;let{selectedProvince:M,hoveredProvince:K,onProvinceClick:N,onProvinceHover:B,provinceStats:A,isRTL:S,provinceColors:z,provinceNames:F,maxWidthClass:I=k.a_,showCampaignCountInTooltip:P=!0,tooltipVariant:E="light",mergeGbWithKashmir:T=!1,onProvinceCentroid:D,fillContainer:G=!1}=a,[L,J]=(0,r.useState)(null),[O,R]=(0,r.useState)(null),[_,Y]=(0,r.useState)(null),H=(0,r.useRef)(null),U=(0,r.useId)().replace(/:/g,"");(0,r.useEffect)(()=>{let a=!0,e=new AbortController;
1return async function(){try{let[n,t]=await Promise.all([fetch("/data/pakistan-districts.geojson",{signal:e.signal}),fetch("/data/kashmir_geo.geojson",{signal:e.signal})]);if(!n.ok)throw Error("Map request failed (".concat(n.status,")"));let r=await n.json(),i=[];t.ok&&(i=(await t.json()).features.filter(a=>{let e=a.geometry;if(!e)return!1;let n=e.coordinates;return Array.isArray(n)&&n.length>0}).map((a,e)=>{var n;let t=null!=(n=a.properties)?n:{},r="China"===t.SOVEREIGNT||"Trans-Karakoram Tract"===t.NAME_EN||"Shaksam Valley"===t.BRK_NAME,i="JK"===t.district||!r;return{type:"Feature",properties:{shapeName:"Azad Kashmir",shapeID:r?"PAK-IIOJK-CHN-".concat(e):i?"PAK-IIOJK-JK-".concat(e):"PAK-IIOJK-K".concat(e)},geometry:a.geometry}}));let l={...r,features:[...i,...r.features]};if(!a)return;J(l),R(null)}catch(n){if(!a||e.signal.aborted)return;R(n instanceof Error?n.message:"Unknown error")}}(),()=>{a=!1,e.abort()}},[]);let W=(0,r.useMemo)(()=>{if(!L)return null;let[a,e]=g,n=L.features.filter(a=>null!=a.geometry),t=(0,l.Ay)().center([69.3451,30.3753]).scale(1800).translate([a/2,e/2]);H.current=t;let r=(0,o.A)(t),i=n.map((a,e)=>{var n,t,i;let l=(null==(t=a.properties)||null==(n=t.shapeName)?void 0:n.trim())||"";if(!l)return null;let o=r(a);if(!o)return null;let s=r.centroid(a),u=Number.isFinite(s[0])&&Number.isFinite(s[1])?[s[0],s[1]]:[g[0]/2,g[1]/2],c=null==(i=a.properties)?void 0:i.shapeID,h=function(a){var e;let n=a.trim().toLowerCase();return n&&null!=(e=p[n])?e:null}(l),d=T&&"gb"===h?"ajk":h;return{id:c||"".concat(l,"-").concat(e),districtName:l,province:d,d:o,feature:a,centroid:u,isBackgroundClaim:"string"==typeof c&&c.startsWith("PAK-IIOJK")}}).filter(a=>!!a),s=i.reduce((a,e)=>(!e.province||e.isBackgroundClaim||(a[e.province]||(a[e.province]=[]),a[e.province].push(e.feature)),a),{sindh:[],karachi:[],punjab:[],lahore:[],"punjab-north":[],"punjab-central":[],"punjab-south":[],kpk:[],"kpk-south":[],"kpk-central":[],"kpk-north":[],"kpk-hazara":[],balochistan:[],islamabad:[],ajk:[],gb:[]}),u=Object.keys(s).map(a=>{let e=s[a];if(!e.length&&!(T&&"ajk"===a))return null;let n=e.flatMap(a=>a.geometry?[a.geometry]:[]);if(T&&"ajk"===a&&(n=[...n,...i.filter(a=>{if(!a.isBackgroundClaim||"ajk"!==a.province)return!1;let e=a.id;return"string"==typeof e&&e.startsWith("PAK-IIOJK")&&a.feature.geometry}).map(a=>a.feature.geometry).filter(a=>!!a)]),!n.length)return null;let t=T&&"ajk"===a?function(a){let e=[];for(let n of a){let a=function a(e){if("Polygon"===e.type)return e.coordinates.map(f);if("MultiPolygon"===e.type)return e.coordinates.map(a=>a.map(f));if("GeometryCollection"===e.type){let r=[];for(let i of e.geometries){var n,t;let e=a(i);e&&(Array.isArray(null==(t=e[0])||null==(n=t[0])?void 0:n[0])?r.push(...e):r.push(e))}return r.length?r:null}return null}(n);a&&e.push(a)}if(0===e.length)return null;if(1===e.length){var n,t;let a=e[0];return Array.isArray(null==(t=a[0])||null==(n=t[0])?void 0:n[0])?{type:"MultiPolygon",coordinates:a}:{type:"Polygon",coordinates:a}}let[r,...i]=e,l=m().union(r,...i);return l.length?{type:"MultiPolygon",coordinates:l}:null}(n):{type:"GeometryCollection",geometries:n};if(!t)return null;let l=r(t);return l?{province:a,d:l}:null}).filter(a=>!!a),c=1/0,h=1/0,d=-1/0,k=-1/0;for(let a of i)for(let e of a.d.matchAll(/([0-9.-]+),([0-9.-]+)/g)){let a=parseFloat(e[1]),n=parseFloat(e[2]);Number.isFinite(a)&&Number.isFinite(n)&&(a<c&&(c=a),n<h&&(h=n),a>d&&(d=a),n>k&&(k=n))}let b=Math.max(0,c-20),v=Math.max(0,h-20),j=Math.min(g[0],d+20)-b,y=Math.min(g[1],k+20)-v;return{districts:i,provinceBoundaries:u,viewBox:Number.isFinite(b)&&j>0&&y>0?"".concat(b," ").concat(v," ").concat(j," ").concat(y):"0 0 ".concat(g[0]," ").concat(g[1])}},[L,T]);if((0,r.useEffect)(()=>{if(!D)return;if(!W||!M)return void D(null);let a=W.districts.filter(a=>{var e;return!a.isBackgroundClaim&&(e=a.province,!!e&&!!M&&!!(e===M||"punjab"===M&&(0,c.MC)(e)||"kpk"===M&&(0,c.Mv)(e)))});if(0===a.length)return void D(null);let[e,n]=g,t=0,r=0;for(let e of a)t+=e.centroid[0],r+=e.centroid[1];D({pctX:t/a.length/e,pctY:r/a.length/n})},[D,W,M]),!L&&!O)return(0,t.jsx)("div",{className:(0,u.cn)("relative mx-auto",G?"flex h-full min-h-0 w-full items-stretch justify-center":"w-full",I),children:(0,t.jsx)("div",{className:(0,u.cn)("relative overflow-hidden rounded-lg bg-gray-100/70 animate-pulse",G?"h-full w-full":(0,u.cn)("w-full",k.Z0)),style:G?void 0:{aspectRatio:"800 / 900"}})});if(O||!W)return(0,t.jsx)("div",{className:(0,u.cn)("relative mx-auto",G?"flex h-full min-h-0 w-full items-stretch justify-center":"w-full",I),children:(0,t.jsxs)("div",{className:(0,u.cn)("relative overflow-hidden rounded-lg border border-gray-200 bg-gray-50","flex items-center justify-center gap-2 text-sm text-charcoal/65",G?"h-full w-full":(0,u.cn)("w-full",k.Z0)),style:G?void 0:{aspectRatio:"800 / 900"},children:[(0,t.jsx)(s.A,{className:"w-4 h-4 text-charcoal/40"}),(0,t.jsx)("span",{children:S?"ÙÙØ´Û Ø¯Ø³ØªÛØ§Ø¨ ÙÛÛÚº":"Map unavailable"})]})});let V=M||K,Q=W.districts.filter(a=>
1a.isBackgroundClaim),X=W.districts.filter(a=>!a.isBackgroundClaim),Z=X.filter(a=>!T&&"gb"===a.province),q=a=>{var e,n,r,i,l;let o=null==a.province?0:null!=(l=null!=(i=null==(e=A[a.province])?void 0:e.campaigns)?i:(0,c.MC)(a.province)?null==(n=A.punjab)?void 0:n.campaigns:(0,c.Mv)(a.province)?null==(r=A.kpk)?void 0:r.campaigns:0)?l:0,s=null!=a.province&&o>0,u=M===a.province||"punjab"===M&&(0,c.MC)(a.province)||"kpk"===M&&(0,c.Mv)(a.province),p=K===a.province||"punjab"===K&&(0,c.MC)(a.province)||"kpk"===K&&(0,c.Mv)(a.province),d=a.province?h[a.province]:null,k="quetta"===a.districtName.trim().toLowerCase(),b="peshawar"===a.districtName.trim().toLowerCase(),m=T&&"ajk"===a.province,f="#CBD5E1",g=.3;return a.province&&d&&(f=d.fill,g=m?1:u?.95:p?.75:s?.55:.3),k&&(f=h.balochistan.fill,g=u?.98:p?.86:.72),b&&(f=h["kpk-central"].fill,g=u?.98:p?.86:.72),(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:a.d,fill:f,fillOpacity:g,stroke:a.isBackgroundClaim||m?"none":"#FFFFFF",strokeWidth:a.isBackgroundClaim||m?0:.8,strokeOpacity:a.isBackgroundClaim||m?0:1,className:"focus:outline-none",style:{transition:"fill-opacity 150ms ease, fill 150ms ease",outline:"none",cursor:a.province&&!a.isBackgroundClaim?"pointer":"default",pointerEvents:a.isBackgroundClaim?"none":"all"},role:a.isBackgroundClaim?"presentation":"button",tabIndex:a.isBackgroundClaim?-1:0,onMouseDown:a=>{0===a.button&&a.preventDefault()},"aria-hidden":a.isBackgroundClaim||void 0,"aria-label":a.isBackgroundClaim?void 0:"".concat(a.districtName,", ").concat(j(a.province,F,S,T)),onClick:e=>{e.stopPropagation(),!a.isBackgroundClaim&&a.province&&N(a.province)},onKeyDown:e=>{!a.isBackgroundClaim&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a.province&&N(a.province))}})},a.id)};return(0,t.jsx)("div",{className:(0,u.cn)("relative mx-auto",G?"flex h-full min-h-0 w-full items-stretch justify-center":"w-full",I),children:(0,t.jsxs)("div",{className:(0,u.cn)("relative overflow-visible rounded-lg bg-transparent",G?"h-full w-full":"w-full"),style:G?void 0:{aspectRatio:"800 / 900"},children:[(0,t.jsx)("svg",{width:"100%",height:"100%",viewBox:W.viewBox,preserveAspectRatio:"xMidYMid meet",style:{display:"block"},onMouseMove:a=>{let e=H.current,n=a.currentTarget;if(!e||!W)return;let t=v(n,a.clientX,a.clientY,W.districts,e);if(t){let e=n.getBoundingClientRect();B(t.province),Y({districtName:t.districtName,province:t.province,x:a.clientX-e.left,y:a.clientY-e.top})}else B(null),Y(null)},onClick:a=>{let e=H.current,n=a.currentTarget;e&&W&&(v(n,a.clientX,a.clientY,W.districts,e)||N(null))},onMouseLeave:()=>{B(null),Y(null)},children:(0,t.jsxs)("g",{children:[Q.length>0&&Z.length>0?(0,t.jsx)("defs",{children:(0,t.jsxs)("mask",{id:"kashmir-claim-gb-cutout-".concat(U),maskUnits:"userSpaceOnUse",children:[(0,t.jsx)("rect",{width:g[0],height:g[1],fill:"white"}),Z.map(a=>(0,t.jsx)("path",{d:a.d,fill:"black"},"gb-claim-mask-".concat(a.id)))]})}):null,Q.length>0?(0,t.jsx)("g",{mask:Z.length>0?"url(#kashmir-claim-gb-cutout-".concat(U,")"):void 0,children:Q.map(q)}):null,X.map(q),W.provinceBoundaries.map(a=>{let e=V===a.province||"punjab"===V&&(0,c.MC)(a.province)||"kpk"===V&&(0,c.Mv)(a.province),n=h[a.province].stroke;return(0,t.jsx)("path",{d:a.d,fill:"none",stroke:n,strokeWidth:e?2:1,strokeLinejoin:"round",strokeLinecap:"round",opacity:e?1:.6,pointerEvents:"none"},"province-outline-".concat(a.province))})]})}),_&&(0,t.jsxs)("div",{className:(0,u.cn)("absolute pointer-events-none z-30 w-max max-w-[calc(100%-1rem)] rounded-[5px] border px-2.5 py-1.5 shadow-md backdrop-blur-md","dark"===E?"border-white/25 bg-slate-900/95":"border-gray-200 bg-white/98"),style:{left:_.x+14,top:_.y+14,borderColor:_.province&&_.province in h?h[_.province].stroke:void 0},children:[(0,t.jsx)("div",{className:(0,d.aV)(S,"text-sm font-bold","dark"===E?"text-white":"text-gray-900"),children:j(_.province,F,S,T)}),P&&_.province&&(null!=(w=null!=(y=null==(e=A[_.province])?void 0:e.campaigns)?y:(0,c.MC)(_.province)?null==(n=A.punjab)?void 0:n.campaigns:0)?w:0)>0&&(0,t.jsxs)("div",{className:(0,u.cn)("mt-1 text-[11px]","dark"===E?"text-white/65":"text-charcoal/55"),children:[null!=(C=null!=(x=null==(i=A[_.province])?void 0:i.campaigns)?x:(0,c.MC)(_.province)?null==(b=A.punjab)?void 0:b.campaigns:0)?C:0," ",S?"Ù
ÛÙ
ات":"campaigns"]})]})]})})}}}]);
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.